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
{{ message }}
This repository was archived by the owner on Oct 1, 2023. It is now read-only.
By default, light or dark themes are displayed by [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme), You can change it by `defaultTheme`
49
+
50
+
support `light`, `dark` or `{ theme: [begin hours, end hours] }`
51
+
52
+
```js
53
+
module.exports= {
54
+
theme:'default-prefers-color-scheme',
55
+
themeConfig: {
56
+
defaultTheme:'dark',
57
+
// or
58
+
defaultTheme: { dark: [18, 6] },
59
+
// or
60
+
defaultTheme: { light: [6, 18], dark: [18, 6] },
61
+
},
62
+
// When using `light theme` or `dark theme`, you need to add a postcss plugins to your config.js
Copy file name to clipboardExpand all lines: examples/started.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ npm i vuepress-theme-default-prefers-color-scheme
8
8
9
9
## Usage
10
10
11
-
```js
11
+
```js {3}
12
12
// .vuepress -> config.js
13
13
module.exports= {
14
14
theme:'default-prefers-color-scheme',
@@ -18,6 +18,39 @@ module.exports = {
18
18
}
19
19
```
20
20
21
+
## Options
22
+
23
+
### defaultTheme
24
+
- Type: `string`, `object`
25
+
- Default: `undefined`
26
+
- Required: `false`
27
+
28
+
::: tip
29
+
By default, light or dark themes are displayed by [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme), You can change it by `defaultTheme`
30
+
:::
31
+
32
+
support `light`, `dark` or `{ theme: [begin hours, end hours] }`
33
+
34
+
```js {4,6,8}
35
+
module.exports= {
36
+
theme:'default-prefers-color-scheme',
37
+
themeConfig: {
38
+
defaultTheme:'dark',
39
+
// or
40
+
defaultTheme: { dark: [18, 6] },
41
+
// or
42
+
defaultTheme: { light: [6, 18], dark: [18, 6] },
43
+
},
44
+
// When using `light theme` or `dark theme`, you need to add a postcss plugins to your config.js
0 commit comments