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
* You can use the `MaterialCssVariables` enum [from here](https://github.com/johannesjo/angular-material-css-vars/blob/master/projects/material-css-vars/src/lib/model.ts) to make sure you get the variable name right.
- You can use the `MaterialCssVariables` enum [from here](https://github.com/johannesjo/angular-material-css-vars/blob/master/projects/material-css-vars/src/lib/model.ts) to make sure you get the variable name right.
63
+
- Rudimentary dark theme support via body class
64
+
-`setDarkTheme(isDark: boolean)`
58
65
59
66
## Utility
67
+
60
68
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).
The other is to include your own variables for [$default-light-theme](https://github.com/johannesjo/angular-material-css-vars/blob/master/projects/material-css-vars/src/lib/_variables.scss).
120
+
106
121
```scss
107
-
@use 'angular-material-css-vars' as mat-css-vars with (
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.
133
150
134
151
See the Material guide on [Theming your custom component](https://material.angular.io/guide/theming-your-components) for more information.
135
152
136
153
## Font config
154
+
137
155
If needed the typography can be adjusted as well. You can introduce your own CSS variables, if you wish.
Angular Material v15 introduces MDC based components, which is basically a re-write for a lot of the available components. `angular-material-css-vars` v5+ only supports MDC components.
161
181
162
182
In case you are still using the legacy components, you can use the package [angular-material-css-vars-legacy](https://github.com/json-derulo/angular-material-css-vars-legacy).
163
183
164
184
## Angular compatibility table
165
185
166
186
| Angular | angular-material-css-vars |
167
-
|---------|---------------------------|
187
+
|-------|-------------------------|
168
188
| 16 | 5.x |
169
189
| 15 | 4.x |
170
190
| 13/14 | 3.x |
171
191
| 12 | 2.x |
172
192
| 11 | 1.x |
173
193
174
194
## Credit...
195
+
175
196
...goes to @zbirizdo[project](https://github.com/zbirizdo/material-css-vars) on which parts of this are based which is in turn supposedly based on [this gist](https://gist.github.com/shprink/c7f333e3ad51830f14a6383f3ab35439).
176
197
177
198
...and to @pedrojrivera without whom there would be no support for @angular/material v12.
Copy file name to clipboardExpand all lines: additional-hacks.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
## Custom elevation shadow color
2
+
2
3
In case you also want to add a color to your shadows, you can include the following mixin directly before you execute `@include initMaterialCssVars();`. Thanks goes to @picc09 for finding this out.
0 commit comments