Skip to content

Commit 07065d3

Browse files
committed
docs: add how to custom dark mode style
1 parent b432098 commit 07065d3

File tree

8 files changed

+626
-374
lines changed

8 files changed

+626
-374
lines changed

demo/custom/valaxy-theme-custom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "valaxy-theme-custom",
33
"version": "0.0.0",
44
"private": true,
5-
"packageManager": "[email protected].1",
5+
"packageManager": "[email protected].3",
66
"author": {
77
"email": "[email protected]",
88
"name": "YunYouJun",

docs/pages/guide/custom/styles.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ end: false
1010

1111
## Automatic Style Injection {lang="en"}
1212

13-
> 仅首次新建 styles/index.scss 文件时,需要重启开发服务器,以确保 scss 被加载。
13+
::: warning
14+
15+
- `index.ts` / `index.scss` / `index.css` 不应当同时存在,否则可能会导致重复引入。
16+
- 仅首次新建 styles/index.scss 文件时,需要重启开发服务器,以确保 scss 被加载。
17+
18+
:::
1419

1520
:::zh-CN
21+
1622
新建 `styles` 文件夹,目录下的以下文件将会被自动引入:
1723

1824
- `index.ts`
@@ -23,7 +29,6 @@ end: false
2329
我们推荐您:
2430

2531
- 新建 `index.ts` 文件,并在其中自由引入其他样式文件 `xxx.scss`
26-
- `index.ts` / `index.scss` / `index.css` 不应当同时存在,否则可能会导致重复引入。
2732

2833
:::
2934

@@ -124,3 +129,31 @@ input {
124129
cursor: var(--cursor-text), text;
125130
}
126131
```
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+
```

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.22.14",
55
"private": true,
6-
"packageManager": "[email protected].1",
6+
"packageManager": "[email protected].3",
77
"description": "📄 Vite & Vue powered static blog generator.",
88
"author": {
99
"email": "[email protected]",
@@ -82,10 +82,10 @@
8282
"valaxy-theme-yun": "workspace:*"
8383
},
8484
"devDependencies": {
85-
"@antfu/eslint-config": "^4.8.1",
85+
"@antfu/eslint-config": "^4.10.1",
8686
"@iconify-json/logos": "catalog:",
8787
"@iconify-json/vscode-icons": "catalog:",
88-
"@microsoft/api-extractor": "^7.51.1",
88+
"@microsoft/api-extractor": "^7.52.1",
8989
"@playwright/test": "^1.51.0",
9090
"@types/debug": "^4.1.12",
9191
"@types/fs-extra": "^11.0.4",
@@ -95,12 +95,12 @@
9595
"@types/node": "^22.13.10",
9696
"@types/prompts": "^2.4.9",
9797
"@types/resolve": "^1.20.6",
98-
"bumpp": "^10.0.3",
98+
"bumpp": "^10.1.0",
9999
"cross-env": "^7.0.3",
100100
"eslint": "^9.22.0",
101101
"https-localhost": "^4.7.1",
102102
"husky": "^9.1.7",
103-
"lint-staged": "^15.4.3",
103+
"lint-staged": "^15.5.0",
104104
"npm-run-all": "^4.1.5",
105105
"prompts": "^2.4.2",
106106
"rimraf": "^6.0.1",

packages/devtools/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@rollup/pluginutils": "^5.1.4",
38-
"axios": "^1.8.2",
38+
"axios": "^1.8.3",
3939
"body-parser": "^2.1.0",
4040
"cors": "^2.8.5",
4141
"http-proxy-middleware": "^3.0.3",
@@ -49,12 +49,12 @@
4949
"@advjs/gui": "0.0.7-beta.7",
5050
"@iconify-json/ri": "catalog:",
5151
"@intlify/unplugin-vue-i18n": "^6.0.3",
52-
"@primevue/themes": "^4.3.1",
52+
"@primevue/themes": "^4.3.2",
5353
"@types/body-parser": "^1.19.5",
5454
"@types/splitpanes": "^2.2.6",
5555
"@types/wicg-file-system-access": "^2023.10.5",
5656
"gray-matter": "^4.0.3",
57-
"primevue": "^4.3.1",
57+
"primevue": "^4.3.2",
5858
"splitpanes": "^4.0.2",
5959
"typescript": "catalog:",
6060
"unbuild": "catalog:",

packages/valaxy-theme-yun/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"@explosions/fireworks": "^0.1.0",
2929
"@iconify-json/ant-design": "catalog:",
3030
"@iconify-json/simple-icons": "catalog:",
31-
"@vueuse/motion": "^2.2.6",
31+
"@vueuse/motion": "^3.0.3",
3232
"animejs": "^3.2.2",
3333
"gsap": "^3.12.7",
34-
"primevue": "^4.3.1"
34+
"primevue": "^4.3.2"
3535
},
3636
"devDependencies": {
3737
"@types/animejs": "^3.1.13",

packages/valaxy/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@clack/prompts": "^0.10.0",
6666
"@iconify-json/ri": "catalog:",
6767
"@intlify/unplugin-vue-i18n": "^6.0.3",
68-
"@shikijs/transformers": "^3.1.0",
68+
"@shikijs/transformers": "^3.2.1",
6969
"@types/katex": "^0.16.7",
7070
"@unhead/addons": "1",
7171
"@unhead/schema-org": "1",
@@ -110,7 +110,7 @@
110110
"markdown-it-table-of-contents": "^0.9.0",
111111
"markdown-it-task-lists": "^2.1.1",
112112
"medium-zoom": "^1.1.0",
113-
"mermaid": "^11.4.1",
113+
"mermaid": "^11.5.0",
114114
"mlly": "^1.7.4",
115115
"nprogress": "^0.2.0",
116116
"open": "10.1.0",
@@ -121,7 +121,7 @@
121121
"qrcode": "^1.5.4",
122122
"resolve-global": "^2.0.0",
123123
"sass": "^1.85.1",
124-
"shiki": "^3.1.0",
124+
"shiki": "^3.2.1",
125125
"star-markdown-css": "^0.5.3",
126126
"table": "^6.9.0",
127127
"unhead": "1",
@@ -136,7 +136,7 @@
136136
"vite-plugin-vue-layouts": "^0.11.0",
137137
"vite-ssg": "^25.2.0",
138138
"vite-ssg-sitemap": "^0.8.1",
139-
"vitepress-plugin-group-icons": "^1.3.6",
139+
"vitepress-plugin-group-icons": "^1.3.7",
140140
"vue": "^3.5.13",
141141
"vue-i18n": "catalog:",
142142
"vue-router": "^4.5.0",

0 commit comments

Comments
 (0)