@@ -10,9 +10,15 @@ end: false
10
10
11
11
## Automatic Style Injection {lang="en"}
12
12
13
- > 仅首次新建 styles/index.scss 文件时,需要重启开发服务器,以确保 scss 被加载。
13
+ ::: warning
14
+
15
+ - ` index.ts ` / ` index.scss ` / ` index.css ` 不应当同时存在,否则可能会导致重复引入。
16
+ - 仅首次新建 styles/index.scss 文件时,需要重启开发服务器,以确保 scss 被加载。
17
+
18
+ :::
14
19
15
20
::: zh-CN
21
+
16
22
新建 ` styles ` 文件夹,目录下的以下文件将会被自动引入:
17
23
18
24
- ` index.ts `
@@ -23,7 +29,6 @@ end: false
23
29
我们推荐您:
24
30
25
31
- 新建 ` index.ts ` 文件,并在其中自由引入其他样式文件 ` xxx.scss ` 。
26
- - ` index.ts ` / ` index.scss ` / ` index.css ` 不应当同时存在,否则可能会导致重复引入。
27
32
28
33
:::
29
34
@@ -124,3 +129,31 @@ input {
124
129
cursor : var (--cursor-text ), text ;
125
130
}
126
131
```
132
+
133
+ ### 覆盖暗色模式 {lang="zh-CN"}
134
+
135
+ 需使用 ` html.dark ` 选择器包裹样式。
136
+
137
+ ``` ts [styles/index.ts]
138
+ import ' ./vars.scss'
139
+ ```
140
+
141
+ ``` scss [styles/vars.scss]
142
+ // 亮色
143
+ .yun-page-header-gradient {
144
+ background : linear-gradient (to right , blue 0 , rgba (0 , 0 , 0 , 0.2 ) 100% );
145
+ }
146
+
147
+ // 覆盖 Dark Mode
148
+ html .dark {
149
+ --va-c-bg-light :rgba (5 , 16 , 29 , 0.8 );
150
+
151
+ .yun-page-header-gradient {
152
+ background : linear-gradient (to right , rgba (0 , 0 , 0 , 0.2 ) 0 , rgba (0 , 0 , 0 , 0.2 ) 100% );
153
+ }
154
+
155
+ .yun-footer-gradient {
156
+ background : linear-gradient (to right , rgba (0 , 0 , 0 , 0.2 ) 0 , rgba (0 , 0 , 0 , 0.2 ) 100% );
157
+ }
158
+ }
159
+ ```
0 commit comments