@vuepress/theme-default 2.0.0-beta.4 → 2.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/{clientAppEnhance.d.ts → client/clientAppEnhance.d.ts} +0 -0
  2. package/lib/client/clientAppEnhance.js +34 -0
  3. package/lib/{clientAppSetup.d.ts → client/clientAppSetup.d.ts} +0 -0
  4. package/lib/client/clientAppSetup.js +6 -0
  5. package/lib/client/components/AutoLink.vue +113 -0
  6. package/lib/client/components/DropdownTransition.vue +21 -0
  7. package/lib/client/components/Home.vue +15 -0
  8. package/lib/client/components/HomeContent.vue +5 -0
  9. package/lib/client/components/HomeFeatures.vue +23 -0
  10. package/lib/client/components/HomeFooter.vue +17 -0
  11. package/lib/client/components/HomeHero.vue +97 -0
  12. package/lib/client/components/Navbar.vue +76 -0
  13. package/lib/client/components/NavbarBrand.vue +55 -0
  14. package/lib/client/components/NavbarDropdown.vue +126 -0
  15. package/lib/{components/NavbarLinks.vue → client/components/NavbarItems.vue} +27 -47
  16. package/lib/{components → client/components}/Page.vue +5 -15
  17. package/lib/{components → client/components}/PageMeta.vue +48 -59
  18. package/lib/{components → client/components}/PageNav.vue +43 -56
  19. package/lib/client/components/Sidebar.vue +13 -0
  20. package/lib/client/components/SidebarItem.vue +80 -0
  21. package/lib/client/components/SidebarItems.vue +54 -0
  22. package/lib/client/components/ToggleDarkModeButton.vue +57 -0
  23. package/lib/client/components/ToggleSidebarButton.vue +24 -0
  24. package/lib/client/components/global/Badge.vue +31 -0
  25. package/lib/client/components/global/CodeGroup.d.ts +5 -0
  26. package/lib/client/components/global/CodeGroup.js +106 -0
  27. package/lib/client/components/global/CodeGroupItem.vue +31 -0
  28. package/lib/{composables → client/composables}/index.d.ts +2 -0
  29. package/lib/{composables → client/composables}/index.js +2 -0
  30. package/lib/client/composables/useDarkMode.d.ts +12 -0
  31. package/lib/client/composables/useDarkMode.js +57 -0
  32. package/lib/{composables → client/composables}/useNavLink.d.ts +6 -1
  33. package/lib/{composables → client/composables}/useNavLink.js +0 -0
  34. package/lib/{composables → client/composables}/useResolveRouteWithRedirect.d.ts +1 -1
  35. package/lib/{composables → client/composables}/useResolveRouteWithRedirect.js +2 -2
  36. package/lib/client/composables/useScrollPromise.d.ts +6 -0
  37. package/lib/client/composables/useScrollPromise.js +14 -0
  38. package/lib/{composables → client/composables}/useSidebarItems.d.ts +12 -7
  39. package/lib/client/composables/useSidebarItems.js +117 -0
  40. package/lib/{composables → client/composables}/useThemeData.d.ts +2 -2
  41. package/lib/{composables → client/composables}/useThemeData.js +1 -1
  42. package/lib/client/index.d.ts +4 -0
  43. package/lib/client/index.js +2 -0
  44. package/lib/client/layouts/404.vue +25 -0
  45. package/lib/client/layouts/Layout.vue +128 -0
  46. package/lib/{shim.d.ts → client/shim.d.ts} +0 -0
  47. package/lib/{styles/_wrapper.scss → client/styles/_mixins.scss} +7 -2
  48. package/lib/client/styles/_variables.scss +11 -0
  49. package/lib/{styles → client/styles}/arrow.scss +4 -6
  50. package/lib/{styles → client/styles}/badge.scss +9 -11
  51. package/lib/{styles → client/styles}/code-group.scss +9 -2
  52. package/lib/{styles → client/styles}/code.scss +21 -33
  53. package/lib/client/styles/custom-container.scss +88 -0
  54. package/lib/{styles → client/styles}/home.scss +27 -24
  55. package/lib/{styles → client/styles}/index.scss +4 -4
  56. package/lib/{styles → client/styles}/layout.scss +52 -35
  57. package/lib/{styles/dropdown.scss → client/styles/navbar-dropdown.scss} +37 -47
  58. package/lib/client/styles/navbar.scss +177 -0
  59. package/lib/client/styles/normalize.scss +172 -0
  60. package/lib/{styles → client/styles}/page.scss +15 -8
  61. package/lib/client/styles/sidebar.scss +134 -0
  62. package/lib/{styles → client/styles}/toc.scss +0 -0
  63. package/lib/client/styles/transitions.scss +22 -0
  64. package/lib/client/styles/vars-dark.scss +46 -0
  65. package/lib/client/styles/vars.scss +133 -0
  66. package/lib/{utils → client/utils}/index.d.ts +1 -0
  67. package/lib/{utils → client/utils}/index.js +1 -0
  68. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
  69. package/lib/client/utils/isActiveSidebarItem.js +20 -0
  70. package/lib/{utils → client/utils}/resolveEditLink.d.ts +1 -1
  71. package/lib/{utils → client/utils}/resolveEditLink.js +14 -8
  72. package/lib/client/utils/resolveRepoType.d.ts +2 -0
  73. package/lib/{utils → client/utils}/resolveRepoType.js +3 -1
  74. package/lib/node/defaultTheme.d.ts +10 -0
  75. package/lib/node/defaultTheme.js +120 -0
  76. package/lib/node/index.d.ts +5 -5
  77. package/lib/node/index.js +10 -6
  78. package/lib/node/utils/assignDefaultLocaleOptions.d.ts +7 -0
  79. package/lib/node/{assignDefaultLocaleOptions.js → utils/assignDefaultLocaleOptions.js} +11 -9
  80. package/lib/node/utils/index.d.ts +2 -0
  81. package/lib/node/utils/index.js +18 -0
  82. package/lib/node/utils/resolveContainerPluginOptions.d.ts +8 -0
  83. package/lib/node/utils/resolveContainerPluginOptions.js +21 -0
  84. package/lib/{types → shared}/index.d.ts +0 -0
  85. package/lib/{types → shared}/index.js +5 -1
  86. package/lib/{types → shared}/nav.d.ts +11 -12
  87. package/lib/{types → shared}/nav.js +0 -0
  88. package/lib/{types → shared}/options.d.ts +42 -10
  89. package/lib/{types → shared}/options.js +0 -0
  90. package/lib/{types → shared}/page.d.ts +13 -5
  91. package/lib/{types → shared}/page.js +0 -0
  92. package/package.json +38 -29
  93. package/templates/build.html +33 -0
  94. package/CHANGELOG.md +0 -353
  95. package/lib/clientAppEnhance.js +0 -23
  96. package/lib/clientAppSetup.js +0 -11
  97. package/lib/components/DropdownLink.vue +0 -141
  98. package/lib/components/DropdownTransition.vue +0 -34
  99. package/lib/components/Home.vue +0 -133
  100. package/lib/components/NavLink.vue +0 -105
  101. package/lib/components/Navbar.vue +0 -113
  102. package/lib/components/Sidebar.vue +0 -38
  103. package/lib/components/SidebarChild.d.ts +0 -6
  104. package/lib/components/SidebarChild.js +0 -83
  105. package/lib/components/ToggleSidebarButton.vue +0 -27
  106. package/lib/components/global/Badge.vue +0 -37
  107. package/lib/components/global/CodeGroup.vue +0 -85
  108. package/lib/components/global/CodeGroupItem.vue +0 -25
  109. package/lib/components/global/OutboundLink.vue +0 -30
  110. package/lib/composables/useSidebarItems.js +0 -108
  111. package/lib/index.d.ts +0 -6
  112. package/lib/index.js +0 -67
  113. package/lib/layouts/404.vue +0 -38
  114. package/lib/layouts/Layout.vue +0 -132
  115. package/lib/node/assignDefaultLocaleOptions.d.ts +0 -5
  116. package/lib/node/resolveActiveHeaderLinksPluginOptions.d.ts +0 -6
  117. package/lib/node/resolveActiveHeaderLinksPluginOptions.js +0 -16
  118. package/lib/node/resolveContainerPluginOptions.d.ts +0 -26
  119. package/lib/node/resolveContainerPluginOptions.js +0 -79
  120. package/lib/node/resolveGitPluginOptions.d.ts +0 -6
  121. package/lib/node/resolveGitPluginOptions.js +0 -22
  122. package/lib/node/resolveMediumZoomPluginOptions.d.ts +0 -6
  123. package/lib/node/resolveMediumZoomPluginOptions.js +0 -17
  124. package/lib/styles/_normalize.scss +0 -148
  125. package/lib/styles/_variables.scss +0 -34
  126. package/lib/styles/custom-container.scss +0 -78
  127. package/lib/styles/navbar.scss +0 -140
  128. package/lib/styles/plugins.scss +0 -18
  129. package/lib/styles/sidebar.scss +0 -147
  130. package/lib/styles/sr-only.scss +0 -12
  131. package/lib/styles/transitions.scss +0 -13
  132. package/lib/utils/resolveRepoType.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ export * from './assignDefaultLocaleOptions';
2
+ export * from './resolveContainerPluginOptions';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./assignDefaultLocaleOptions"), exports);
18
+ __exportStar(require("./resolveContainerPluginOptions"), exports);
@@ -0,0 +1,8 @@
1
+ import type { ContainerPluginOptions } from '@vuepress/plugin-container';
2
+ import type { DefaultThemeData } from '../../shared';
3
+ /**
4
+ * Resolve options for @vuepress/plugin-container
5
+ *
6
+ * For custom containers default title
7
+ */
8
+ export declare const resolveContainerPluginOptions: (localeOptions: DefaultThemeData, type: 'tip' | 'warning' | 'danger') => ContainerPluginOptions;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveContainerPluginOptions = void 0;
4
+ /**
5
+ * Resolve options for @vuepress/plugin-container
6
+ *
7
+ * For custom containers default title
8
+ */
9
+ const resolveContainerPluginOptions = (localeOptions, type) => {
10
+ const locales = Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
11
+ result[key] = {
12
+ defaultInfo: value?.[type] ?? localeOptions[type],
13
+ };
14
+ return result;
15
+ }, {});
16
+ return {
17
+ type,
18
+ locales,
19
+ };
20
+ };
21
+ exports.resolveContainerPluginOptions = resolveContainerPluginOptions;
File without changes
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -12,12 +12,13 @@ export interface NavGroup<T> extends NavItem {
12
12
  children: T[];
13
13
  }
14
14
  /**
15
- * Props for `<NavLink>`
15
+ * Props for `<AutoLink>`
16
16
  */
17
17
  export interface NavLink extends NavItem {
18
18
  link: string;
19
19
  rel?: string;
20
20
  target?: string;
21
+ activeMatch?: string;
21
22
  }
22
23
  /**
23
24
  * Navbar types
@@ -29,16 +30,14 @@ export declare type ResolvedNavbarItem = NavbarItem | NavGroup<ResolvedNavbarIte
29
30
  /**
30
31
  * Sidebar types
31
32
  */
32
- export interface SidebarItem extends NavLink, NavGroup<SidebarItem | string> {
33
- isGroup?: false;
34
- }
35
- export interface SidebarGroup extends NavGroup<SidebarItem | string> {
36
- isGroup: true;
37
- }
38
- export declare type SidebarConfigArray = (SidebarGroup | SidebarItem | string)[];
33
+ export declare type SidebarItem = NavItem & Partial<NavLink>;
34
+ export declare type SidebarGroup = SidebarItem & NavGroup<SidebarItem | SidebarGroup | string>;
35
+ export declare type SidebarGroupCollapsible = SidebarGroup & {
36
+ collapsible?: boolean;
37
+ };
38
+ export declare type SidebarConfigArray = (SidebarItem | SidebarGroupCollapsible | string)[];
39
39
  export declare type SidebarConfigObject = Record<string, SidebarConfigArray>;
40
40
  export declare type SidebarConfig = SidebarConfigArray | SidebarConfigObject;
41
- export interface ResolvedSidebarItem extends Partial<NavLink> {
42
- isGroup?: boolean;
43
- children?: ResolvedSidebarItem[];
44
- }
41
+ export declare type ResolvedSidebarItem = SidebarItem & Partial<NavGroup<ResolvedSidebarItem>> & {
42
+ collapsible?: boolean;
43
+ };
File without changes
@@ -1,13 +1,6 @@
1
- import type { LocaleData, ThemeConfig } from '@vuepress/core';
2
1
  import type { ThemeData } from '@vuepress/plugin-theme-data';
2
+ import type { LocaleData } from '@vuepress/shared';
3
3
  import type { NavbarConfig, SidebarConfig } from './nav';
4
- export interface DefaultThemeOptions extends ThemeConfig, DefaultThemeLocaleOptions {
5
- /**
6
- * To avoid confusion with the root `plugins` option,
7
- * we use `themePlugins`
8
- */
9
- themePlugins?: DefaultThemePluginsOptions;
10
- }
11
4
  export interface DefaultThemePluginsOptions {
12
5
  /**
13
6
  * Enable @vuepress/plugin-active-header-links or not
@@ -28,6 +21,10 @@ export interface DefaultThemePluginsOptions {
28
21
  codeGroup?: boolean;
29
22
  codeGroupItem?: boolean;
30
23
  };
24
+ /**
25
+ * Enable @vuepress/plugin-external-link-icon or not
26
+ */
27
+ externalLinkIcon?: boolean;
31
28
  /**
32
29
  * Enable @vuepress/plugin-git or not
33
30
  */
@@ -66,6 +63,18 @@ export interface DefaultThemeLocaleData extends LocaleData {
66
63
  * Logo to display in navbar
67
64
  */
68
65
  logo?: null | string;
66
+ /**
67
+ * Navbar logo config for dark mode
68
+ *
69
+ * Logo to display in navbar in dark mode
70
+ */
71
+ logoDark?: null | string;
72
+ /**
73
+ * Navbar dark mode button config
74
+ *
75
+ * Enable dark mode switching and display a button in navbar or not
76
+ */
77
+ darkMode?: boolean;
69
78
  /**
70
79
  * Navbar repository config
71
80
  *
@@ -104,6 +113,21 @@ export interface DefaultThemeLocaleData extends LocaleData {
104
113
  * Set to `false` to disable sidebar in current locale
105
114
  */
106
115
  sidebar?: 'auto' | false | SidebarConfig;
116
+ /**
117
+ * Sidebar depth
118
+ *
119
+ * - Set to `0` to disable all levels
120
+ * - Set to `1` to include `<h2>`
121
+ * - Set to `2` to include `<h2>` and `<h3>`
122
+ * - ...
123
+ *
124
+ * The max value depends on which headers you have extracted
125
+ * via `markdown.extractHeaders.level`.
126
+ *
127
+ * The default value of `markdown.extractHeaders.level` is `[2, 3]`,
128
+ * so the default max value of `sidebarDepth` is `2`
129
+ */
130
+ sidebarDepth?: number;
107
131
  /**
108
132
  * Page meta - edit link config
109
133
  *
@@ -135,7 +159,7 @@ export interface DefaultThemeLocaleData extends LocaleData {
135
159
  /**
136
160
  * Page meta - edit link config
137
161
  *
138
- * Set this config if the branch of your docs is not 'master'
162
+ * Set this config if the branch of your docs is not 'main'
139
163
  */
140
164
  docsBranch?: string;
141
165
  /**
@@ -199,7 +223,15 @@ export interface DefaultThemeLocaleData extends LocaleData {
199
223
  */
200
224
  backToHome?: string;
201
225
  /**
202
- * sr-only message in `<OutboundLink>`
226
+ * A11y text for external link icon
203
227
  */
204
228
  openInNewWindow?: string;
229
+ /**
230
+ * A11y text for dark mode toggle button
231
+ */
232
+ toggleDarkMode?: string;
233
+ /**
234
+ * A11y text for sidebar toggle button
235
+ */
236
+ toggleSidebar?: string;
205
237
  }
File without changes
@@ -1,11 +1,17 @@
1
1
  import type { GitPluginPageData } from '@vuepress/plugin-git';
2
2
  import type { NavLink, SidebarConfig } from './nav';
3
3
  export interface DefaultThemePageData extends GitPluginPageData {
4
- filePathRelative: string;
4
+ filePathRelative: string | null;
5
5
  }
6
- export interface DefaultThemeHomePageFrontmatter {
6
+ export interface DefaultThemePageFrontmatter {
7
+ home?: boolean;
8
+ navbar?: boolean;
9
+ pageClass?: string;
10
+ }
11
+ export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
7
12
  home: true;
8
13
  heroImage?: string;
14
+ heroImageDark?: string;
9
15
  heroAlt?: string;
10
16
  heroText?: string | null;
11
17
  tagline?: string | null;
@@ -21,12 +27,14 @@ export interface DefaultThemeHomePageFrontmatter {
21
27
  footer?: string;
22
28
  footerHtml?: boolean;
23
29
  }
24
- export interface DefaultThemePageFrontmatter {
25
- home?: boolean;
30
+ export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
31
+ home?: false;
26
32
  editLink?: boolean;
33
+ editLinkPattern?: string;
27
34
  lastUpdated?: boolean;
28
35
  contributors?: boolean;
36
+ sidebar?: 'auto' | false | SidebarConfig;
37
+ sidebarDepth?: number;
29
38
  prev?: string | NavLink;
30
39
  next?: string | NavLink;
31
- sidebar?: 'auto' | false | SidebarConfig;
32
40
  }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.42",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -17,38 +17,47 @@
17
17
  "url": "git+https://github.com/vuepress/vuepress-next.git"
18
18
  },
19
19
  "license": "MIT",
20
- "author": "Evan You",
21
- "main": "lib/index.js",
22
- "types": "lib/index.d.ts",
20
+ "author": "meteorlxy",
21
+ "main": "lib/node/index.js",
22
+ "types": "lib/node/index.d.ts",
23
23
  "files": [
24
- "lib"
24
+ "lib",
25
+ "templates"
25
26
  ],
26
- "scripts": {
27
- "build": "tsc -b tsconfig.build.json",
28
- "clean": "rimraf lib *.tsbuildinfo",
29
- "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
30
- },
31
27
  "dependencies": {
32
- "@vuepress/client": "2.0.0-beta.4",
33
- "@vuepress/core": "2.0.0-beta.4",
34
- "@vuepress/plugin-active-header-links": "2.0.0-beta.4",
35
- "@vuepress/plugin-back-to-top": "2.0.0-beta.4",
36
- "@vuepress/plugin-container": "2.0.0-beta.4",
37
- "@vuepress/plugin-git": "2.0.0-beta.4",
38
- "@vuepress/plugin-medium-zoom": "2.0.0-beta.4",
39
- "@vuepress/plugin-nprogress": "2.0.0-beta.4",
40
- "@vuepress/plugin-palette": "2.0.0-beta.4",
41
- "@vuepress/plugin-prismjs": "2.0.0-beta.4",
42
- "@vuepress/plugin-theme-data": "2.0.0-beta.4",
43
- "@vuepress/shared": "2.0.0-beta.4",
44
- "@vuepress/utils": "2.0.0-beta.4",
45
- "sass": "^1.32.8",
46
- "sass-loader": "^11.0.1",
47
- "vue": "^3.0.7",
48
- "vue-router": "^4.0.4"
28
+ "@vuepress/client": "2.0.0-beta.42",
29
+ "@vuepress/core": "2.0.0-beta.42",
30
+ "@vuepress/plugin-active-header-links": "2.0.0-beta.42",
31
+ "@vuepress/plugin-back-to-top": "2.0.0-beta.42",
32
+ "@vuepress/plugin-container": "2.0.0-beta.42",
33
+ "@vuepress/plugin-external-link-icon": "2.0.0-beta.42",
34
+ "@vuepress/plugin-git": "2.0.0-beta.42",
35
+ "@vuepress/plugin-medium-zoom": "2.0.0-beta.42",
36
+ "@vuepress/plugin-nprogress": "2.0.0-beta.42",
37
+ "@vuepress/plugin-palette": "2.0.0-beta.42",
38
+ "@vuepress/plugin-prismjs": "2.0.0-beta.42",
39
+ "@vuepress/plugin-theme-data": "2.0.0-beta.42",
40
+ "@vuepress/shared": "2.0.0-beta.42",
41
+ "@vuepress/utils": "2.0.0-beta.42",
42
+ "@vueuse/core": "^8.2.1",
43
+ "sass": "^1.49.10",
44
+ "vue": "^3.2.33",
45
+ "vue-router": "^4.0.14"
46
+ },
47
+ "peerDependencies": {
48
+ "sass-loader": "^12.6.0"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "sass-loader": {
52
+ "optional": true
53
+ }
49
54
  },
50
55
  "publishConfig": {
51
56
  "access": "public"
52
57
  },
53
- "gitHead": "d42716e1b5b682ffb5d7cf124d0a24344493c467"
54
- }
58
+ "scripts": {
59
+ "build": "tsc -b tsconfig.build.json",
60
+ "clean": "rimraf lib *.tsbuildinfo",
61
+ "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
62
+ }
63
+ }
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ lang }}">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="generator" content="VuePress {{ version }}">
7
+ <style>
8
+ :root {
9
+ --c-bg: #fff;
10
+ }
11
+ html.dark {
12
+ --c-bg: #22272e;
13
+ }
14
+ html, body {
15
+ background-color: var(--c-bg);
16
+ }
17
+ </style>
18
+ <script>
19
+ const userMode = localStorage.getItem('vuepress-color-scheme');
20
+ const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
21
+ if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
22
+ document.documentElement.classList.toggle('dark', true);
23
+ }
24
+ </script>
25
+ <!--vuepress-ssr-head-->
26
+ <!--vuepress-ssr-resources-->
27
+ <!--vuepress-ssr-styles-->
28
+ </head>
29
+ <body>
30
+ <div id="app"><!--vuepress-ssr-app--></div>
31
+ <!--vuepress-ssr-scripts-->
32
+ </body>
33
+ </html>