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
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,8 @@ Will be transformed to:
186
186
}
187
187
```
188
188
189
+
### light-dark with html and :root selectors
190
+
189
191
Note that `light-dark` function does not work on `:root`/`html` element. Use `light-root` and `dark-root` mixins instead:
190
192
191
193
```scss
@@ -206,6 +208,43 @@ Note that `light-dark` function does not work on `:root`/`html` element. Use `li
206
208
}
207
209
```
208
210
211
+
### light-dark and !important
212
+
213
+
`!important` at rule level:
214
+
215
+
```scss
216
+
.button {
217
+
color: light-dark(red, blue) !important;
218
+
}
219
+
220
+
// Is transformed to
221
+
.button {
222
+
background: red!important;
223
+
}
224
+
225
+
[data-mantine-color-scheme='dark'] .button {
226
+
background: blue!important;
227
+
}
228
+
```
229
+
230
+
`!important` at value level:
231
+
232
+
```scss
233
+
// !important at value level
234
+
.button {
235
+
color: light-dark(red!important, blue);
236
+
}
237
+
238
+
// Is transformed to
239
+
.button {
240
+
background: red!important;
241
+
}
242
+
243
+
[data-mantine-color-scheme='dark'] .button {
244
+
background: blue;
245
+
}
246
+
```
247
+
209
248
## alpha function
210
249
211
250
`alpha` function can be used to add alpha channel to color. Note that it uses [color-mix](https://caniuse.com/mdn-css_types_color_color-mix) which is not supported in some older browsers.
0 commit comments