You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-43Lines changed: 35 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ You want to style your angular material dynamically with all the colors in the r
9
9
```bash
10
10
npm i angular-material-css-vars -S
11
11
```
12
-
2. If @angular/material is already configured remove `@import '@angular/material/theming';` from your main stylesheet file if present.
12
+
2. If @angular/material is already configured remove `@include mat.core()` from your main stylesheet file if present.
13
13
3. Add this to your main stylesheet instead:
14
14
```scss
15
-
@use 'angular-material-css-vars/main' as mat-css;
15
+
@use 'angular-material-css-vars' as mat-css-vars;
16
16
17
17
// init theme
18
-
@include mat-css.init-material-css-vars(
18
+
@include mat-css-vars.init-material-css-vars(
19
19
// optional
20
20
$dark-theme-selector: '.isDarkTheme',
21
21
$light-theme-selector: '.isLightTheme',
@@ -69,18 +69,18 @@ export class AppModule {
69
69
## Utility
70
70
There are also several [utility functions and mixins](https://github.com/johannesjo/angular-material-css-vars/blob/master/projects/material-css-vars/src/lib/_public-util.scss).
71
71
```scss
72
-
@use 'angular-material-css-vars/public-util' as mat-css-utilities;
The other is to include your own variables for [$mat-css-default-light-theme](https://github.com/johannesjo/angular-material-css-vars/blob/master/projects/material-css-vars/src/lib/_variables.scss).
139
137
```scss
140
-
@use 'angular-material-css-vars/main' as mat-css-main;
141
-
@use 'angular-material-css-vars/variables' as mat-css-vars;
142
-
@use 'angular-material-css-vars/public-util' as mat-css-utilities;
This lib won't work with IE11 but thanks to @Coly010 there is [a workaround for that too](https://github.com/johannesjo/angular-material-css-vars/issues/11#issuecomment-572749449).
172
-
173
166
## App Theme Mixins
174
167
The `init-material-css-vars` mixin allows content to be passed into it. This allows you to create app themes that can take advantage of the dynamic theme created inside this mixin. It may be possible to do all theming using the utility mixins outlined above, but in other cases, you may need access to the theme palette, including foreground and background palettes.
175
168
@@ -178,18 +171,17 @@ See the Material guide on [Theming your custom component](https://material.angul
178
171
## Font config
179
172
If needed the typography can be adjusted as well.
180
173
```scss
181
-
@use 'angular-material-css-vars/main' as mat-css-main;
0 commit comments