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
Theme files support CSS variable syntax on the `:root` selector.
40
+
```css
41
+
/* light.css */
42
+
:root {
43
+
--color: black;
44
+
--background-color: white;
45
+
}
46
+
47
+
/* dark.css */
48
+
:root {
49
+
--color: white;
50
+
--background-color: black;
51
+
}
52
+
```
53
+
54
+
Use variables from your theme files in your stylesheets.
55
+
```css
56
+
/* styles.css */
57
+
body {
58
+
color: theme-var(--color);
59
+
background-color: theme-var(--background-color);
60
+
}
61
+
```
62
+
63
+
### Usage with [CSS Modules](https://github.com/css-modules/css-modules)
64
+
65
+
Use loader options `modules` and `localIdentName` to generate locally scoped CSS class names. These work the same as [css-loader](https://github.com/webpack-contrib/css-loader#css-scope).
0 commit comments