@vuepress/theme-default 2.0.0-rc.41 → 2.0.0-rc.43

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 (66) hide show
  1. package/lib/client/components/VPDropdownTransition.vue +7 -5
  2. package/lib/client/components/VPHome.vue +1 -1
  3. package/lib/client/components/VPHomeFeatures.vue +4 -6
  4. package/lib/client/components/VPHomeFooter.vue +6 -5
  5. package/lib/client/components/VPHomeHero.vue +23 -28
  6. package/lib/client/components/VPNavbar.vue +28 -19
  7. package/lib/client/components/VPNavbarBrand.vue +3 -3
  8. package/lib/client/components/VPNavbarDropdown.vue +14 -14
  9. package/lib/client/components/VPNavbarItems.vue +6 -5
  10. package/lib/client/components/VPPage.vue +6 -5
  11. package/lib/client/components/VPPageMeta.vue +3 -3
  12. package/lib/client/components/VPPageNav.vue +9 -9
  13. package/lib/client/components/VPSidebar.vue +14 -13
  14. package/lib/client/components/VPSidebarItem.vue +13 -6
  15. package/lib/client/components/VPSidebarItems.vue +2 -1
  16. package/lib/client/components/VPToggleColorModeButton.vue +4 -3
  17. package/lib/client/components/VPToggleSidebarButton.vue +3 -3
  18. package/lib/client/components/global/Badge.vue +14 -4
  19. package/lib/client/components/global/CodeGroup.d.ts +3 -3
  20. package/lib/client/components/global/CodeGroup.js +14 -10
  21. package/lib/client/components/global/CodeGroupItem.vue +13 -0
  22. package/lib/client/composables/useContributors.d.ts +1 -1
  23. package/lib/client/composables/useDarkMode.js +4 -2
  24. package/lib/client/composables/useEditLink.d.ts +1 -1
  25. package/lib/client/composables/useLastUpdated.d.ts +1 -1
  26. package/lib/client/composables/useLastUpdated.js +1 -1
  27. package/lib/client/composables/useNavbarConfig.js +3 -1
  28. package/lib/client/composables/useNavbarSelectLanguage.js +1 -0
  29. package/lib/client/composables/useNavigate.js +1 -1
  30. package/lib/client/composables/useScrollPromise.js +3 -1
  31. package/lib/client/composables/useSidebarItems.d.ts +16 -16
  32. package/lib/client/composables/useSidebarItems.js +53 -52
  33. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  34. package/lib/client/composables/useUpdateDeviceStatus.js +8 -4
  35. package/lib/client/config.d.ts +1 -0
  36. package/lib/client/config.js +1 -9
  37. package/lib/client/layouts/Layout.vue +21 -17
  38. package/lib/client/layouts/NotFound.vue +3 -5
  39. package/lib/client/shim.d.ts +9 -0
  40. package/lib/client/styles/arrow.scss +1 -1
  41. package/lib/client/styles/code-group.scss +4 -4
  42. package/lib/client/styles/content/code.scss +3 -3
  43. package/lib/client/styles/content/index.scss +0 -1
  44. package/lib/client/styles/external-link-icon.scss +1 -1
  45. package/lib/client/styles/normalize.scss +28 -30
  46. package/lib/client/styles/plugins.scss +2 -2
  47. package/lib/client/styles/vars-dark.scss +20 -63
  48. package/lib/client/styles/vars.scss +42 -165
  49. package/lib/client/typings.d.ts +4 -4
  50. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  51. package/lib/client/utils/resolveRepoType.js +4 -4
  52. package/lib/node/defaultTheme.js +12 -32
  53. package/lib/node/utils/assignDefaultLocaleOptions.js +2 -6
  54. package/lib/node/utils/index.d.ts +1 -1
  55. package/lib/node/utils/index.js +1 -1
  56. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  57. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  58. package/lib/shared/navbar.d.ts +3 -3
  59. package/lib/shared/options.d.ts +23 -13
  60. package/lib/shared/page.d.ts +4 -4
  61. package/lib/shared/sidebar.d.ts +1 -1
  62. package/package.json +29 -21
  63. package/templates/build.html +7 -7
  64. package/lib/client/styles/content/custom-container.scss +0 -142
  65. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  66. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -1,15 +1,17 @@
1
1
  <script setup lang="ts">
2
+ import type { VNode } from 'vue'
3
+
2
4
  defineSlots<{
3
- default?: (props: Record<never, never>) => any
5
+ default?: (props: Record<never, never>) => VNode | VNode[] | null
4
6
  }>()
5
7
 
6
- const setHeight = (items): void => {
8
+ const setHeight = (item: Element): void => {
7
9
  // explicitly set height so that it can be transitioned
8
- items.style.height = items.scrollHeight + 'px'
10
+ ;(item as HTMLElement).style.height = `${item.scrollHeight}px`
9
11
  }
10
12
 
11
- const unsetHeight = (items): void => {
12
- items.style.height = ''
13
+ const unsetHeight = (item: Element): void => {
14
+ ;(item as HTMLElement).style.height = ''
13
15
  }
14
16
  </script>
15
17
 
@@ -9,7 +9,7 @@ import { Content } from 'vuepress/client'
9
9
  <main class="vp-home">
10
10
  <VPHomeHero />
11
11
  <VPHomeFeatures />
12
- <div class="theme-default-content">
12
+ <div class="theme-default-content" vp-content>
13
13
  <Content />
14
14
  </div>
15
15
  <VPHomeFooter />
@@ -8,6 +8,7 @@ const frontmatter = usePageFrontmatter<DefaultThemeHomePageFrontmatter>()
8
8
  const features = computed(() => frontmatter.value.features ?? [])
9
9
  </script>
10
10
 
11
+ <!-- eslint-disable-next-line vue/no-root-v-if -->
11
12
  <template>
12
13
  <div v-if="features.length" class="vp-features">
13
14
  <div v-for="feature in features" :key="feature.title" class="vp-feature">
@@ -28,9 +29,9 @@ const features = computed(() => frontmatter.value.features ?? [])
28
29
 
29
30
  margin-top: 2.5rem;
30
31
  padding: 1.2rem 0;
31
- border-top: 1px solid var(--c-border);
32
+ border-top: 1px solid var(--vp-c-gutter);
32
33
 
33
- transition: border-color var(--t-color);
34
+ transition: border-color var(--vp-t-color);
34
35
 
35
36
  @media (max-width: $MQMobile) {
36
37
  flex-direction: column;
@@ -50,9 +51,6 @@ const features = computed(() => frontmatter.value.features ?? [])
50
51
  h2 {
51
52
  padding-bottom: 0;
52
53
  border-bottom: none;
53
-
54
- color: var(--c-text-light);
55
-
56
54
  font-weight: 500;
57
55
  font-size: 1.4rem;
58
56
 
@@ -62,7 +60,7 @@ const features = computed(() => frontmatter.value.features ?? [])
62
60
  }
63
61
 
64
62
  p {
65
- color: var(--c-text-lighter);
63
+ color: var(--vp-c-text-mute);
66
64
  }
67
65
  }
68
66
  </style>
@@ -9,23 +9,24 @@ const footer = computed(() => frontmatter.value.footer)
9
9
  const footerHtml = computed(() => frontmatter.value.footerHtml)
10
10
  </script>
11
11
 
12
+ <!-- eslint-disable-next-line vue/no-root-v-if -->
12
13
  <template>
13
14
  <template v-if="footer">
14
15
  <!-- eslint-disable-next-line vue/no-v-html -->
15
- <div v-if="footerHtml" class="vp-footer" v-html="footer" />
16
- <div v-else class="vp-footer" v-text="footer" />
16
+ <div v-if="footerHtml" class="vp-footer" vp-footer v-html="footer" />
17
+ <div v-else class="vp-footer" vp-footer v-text="footer" />
17
18
  </template>
18
19
  </template>
19
20
 
20
21
  <style>
21
22
  .vp-footer {
22
23
  padding: 2.5rem;
23
- border-top: 1px solid var(--c-border);
24
+ border-top: 1px solid var(--vp-c-border);
24
25
 
25
- color: var(--c-text-lighter);
26
+ color: var(--vp-c-text-mute);
26
27
 
27
28
  text-align: center;
28
29
 
29
- transition: border-color var(--t-color);
30
+ transition: border-color var(--vp-t-color);
30
31
  }
31
32
  </style>
@@ -15,24 +15,12 @@ const frontmatter = usePageFrontmatter<DefaultThemeHomePageFrontmatter>()
15
15
  const siteLocale = useSiteLocaleData()
16
16
  const isDarkMode = useDarkMode()
17
17
 
18
- const heroImage = computed(() => {
19
- if (isDarkMode.value && frontmatter.value.heroImageDark !== undefined) {
20
- return frontmatter.value.heroImageDark
21
- }
22
- return frontmatter.value.heroImage
23
- })
24
- const heroAlt = computed(
25
- () => frontmatter.value.heroAlt || heroText.value || 'hero',
26
- )
27
- const heroHeight = computed(() => frontmatter.value.heroHeight || 280)
28
-
29
18
  const heroText = computed(() => {
30
19
  if (frontmatter.value.heroText === null) {
31
20
  return null
32
21
  }
33
22
  return frontmatter.value.heroText || siteLocale.value.title || 'Hello'
34
23
  })
35
-
36
24
  const tagline = computed(() => {
37
25
  if (frontmatter.value.tagline === null) {
38
26
  return null
@@ -44,6 +32,16 @@ const tagline = computed(() => {
44
32
  'Welcome to your VuePress site'
45
33
  )
46
34
  })
35
+ const heroImage = computed(() => {
36
+ if (isDarkMode.value && frontmatter.value.heroImageDark !== undefined) {
37
+ return frontmatter.value.heroImageDark
38
+ }
39
+ return frontmatter.value.heroImage
40
+ })
41
+ const heroAlt = computed(
42
+ () => frontmatter.value.heroAlt || heroText.value || 'hero',
43
+ )
44
+ const heroHeight = computed(() => frontmatter.value.heroHeight ?? 280)
47
45
 
48
46
  const actions = computed(() => {
49
47
  if (!Array.isArray(frontmatter.value.actions)) {
@@ -147,7 +145,7 @@ const HomeHeroImage: FunctionalComponent = () => {
147
145
 
148
146
  .vp-hero-description {
149
147
  max-width: 35rem;
150
- color: var(--c-text-lightest);
148
+ color: var(--vp-c-text-mute);
151
149
  font-size: 1.6rem;
152
150
  line-height: 1.3;
153
151
 
@@ -161,13 +159,12 @@ const HomeHeroImage: FunctionalComponent = () => {
161
159
 
162
160
  box-sizing: border-box;
163
161
  padding: 0.8rem 1.6rem;
164
- border-width: 2px;
165
- border-style: solid;
162
+ border: 2px solid var(--vp-c-accent);
166
163
  border-radius: 4px;
167
164
 
168
165
  font-size: 1.2rem;
169
166
 
170
- transition: background-color var(--t-color);
167
+ transition: background-color border-color color var(--vp-t-color);
171
168
 
172
169
  @media (max-width: $MQMobileNarrow) {
173
170
  padding: 0.6rem 1.2rem;
@@ -175,24 +172,22 @@ const HomeHeroImage: FunctionalComponent = () => {
175
172
  }
176
173
 
177
174
  &.primary {
178
- border-color: var(--c-brand);
179
- background-color: var(--c-brand);
180
- color: var(--c-bg);
181
-
182
- &:hover {
183
- background-color: var(--c-brand-light);
184
- }
175
+ background-color: var(--vp-c-accent);
176
+ color: var(--vp-c-accent-text);
185
177
  }
186
178
 
187
179
  &.secondary {
188
- border-color: var(--c-brand);
189
- background-color: var(--c-bg);
190
- color: var(--c-brand);
180
+ background-color: var(--vp-c-bg);
181
+ color: var(--vp-c-accent);
191
182
 
192
183
  &:hover {
193
- background-color: var(--c-brand-light);
194
- color: var(--c-bg);
184
+ color: var(--vp-c-accent-text);
195
185
  }
196
186
  }
187
+
188
+ &:hover {
189
+ border-color: var(--vp-c-accent-hover);
190
+ background-color: var(--vp-c-accent-hover);
191
+ }
197
192
  }
198
193
  </style>
@@ -1,19 +1,27 @@
1
1
  <script setup lang="ts">
2
- import { useThemeLocaleData } from '@theme/useThemeData'
3
- import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
4
2
  import VPNavbarBrand from '@theme/VPNavbarBrand.vue'
5
3
  import VPNavbarItems from '@theme/VPNavbarItems.vue'
6
4
  import VPToggleColorModeButton from '@theme/VPToggleColorModeButton.vue'
7
5
  import VPToggleSidebarButton from '@theme/VPToggleSidebarButton.vue'
8
- import { computed, ref } from 'vue'
6
+ import { useThemeLocaleData } from '@theme/useThemeData'
7
+ import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
8
+ import { hasGlobalComponent } from '@vuepress/helper/client'
9
+ import type { VNode } from 'vue'
10
+ import { computed, ref, resolveComponent } from 'vue'
9
11
 
10
- defineEmits<(e: 'toggle-sidebar') => void>()
12
+ defineEmits<{
13
+ toggleSidebar: []
14
+ }>()
11
15
 
12
16
  defineSlots<{
13
- before?: (props: Record<never, never>) => any
14
- after?: (props: Record<never, never>) => any
17
+ before?: (props: Record<never, never>) => VNode | VNode[] | null
18
+ after?: (props: Record<never, never>) => VNode | VNode[] | null
15
19
  }>()
16
20
 
21
+ const SearchBox = hasGlobalComponent('SearchBox')
22
+ ? resolveComponent('SearchBox')
23
+ : null
24
+
17
25
  const themeLocale = useThemeLocaleData()
18
26
 
19
27
  const navbar = ref<HTMLElement | null>(null)
@@ -25,22 +33,23 @@ const linksWrapperStyle = computed(() => {
25
33
  return {}
26
34
  }
27
35
  return {
28
- maxWidth: linksWrapperMaxWidth.value + 'px',
36
+ maxWidth: `${linksWrapperMaxWidth.value}px`,
29
37
  }
30
38
  })
31
39
 
32
40
  const getCssValue = (el: HTMLElement | null, property: string): number => {
33
41
  // NOTE: Known bug, will return 'auto' if style value is 'auto'
34
- const val = el?.ownerDocument?.defaultView?.getComputedStyle(el, null)?.[
35
- property
42
+ const val = el?.ownerDocument.defaultView?.getComputedStyle(el, null)[
43
+ property as keyof CSSStyleDeclaration
36
44
  ]
37
- const num = Number.parseInt(val, 10)
45
+
46
+ const num = Number.parseInt(val as string, 10)
38
47
 
39
48
  return Number.isNaN(num) ? 0 : num
40
49
  }
41
50
 
42
51
  useUpdateDeviceStatus(
43
- DeviceType.MOBILE,
52
+ DeviceType.Mobile,
44
53
  (mobileDesktopBreakpoint: number): void => {
45
54
  // avoid overlapping of long title and long navbar links
46
55
  const navbarHorizontalPadding =
@@ -52,15 +61,15 @@ useUpdateDeviceStatus(
52
61
  linksWrapperMaxWidth.value =
53
62
  navbar.value!.offsetWidth -
54
63
  navbarHorizontalPadding -
55
- (navbarBrand.value?.offsetWidth || 0)
64
+ (navbarBrand.value?.offsetWidth ?? 0)
56
65
  }
57
66
  },
58
67
  )
59
68
  </script>
60
69
 
61
70
  <template>
62
- <header ref="navbar" class="vp-navbar">
63
- <VPToggleSidebarButton @toggle="$emit('toggle-sidebar')" />
71
+ <header ref="navbar" class="vp-navbar" vp-navbar>
72
+ <VPToggleSidebarButton @toggle="$emit('toggleSidebar')" />
64
73
 
65
74
  <span ref="navbarBrand">
66
75
  <VPNavbarBrand />
@@ -71,7 +80,7 @@ useUpdateDeviceStatus(
71
80
  <VPNavbarItems class="vp-hide-mobile" />
72
81
  <slot name="after" />
73
82
  <VPToggleColorModeButton v-if="themeLocale.colorModeSwitch" />
74
- <VPSearch />
83
+ <SearchBox />
75
84
  </div>
76
85
  </header>
77
86
  </template>
@@ -93,15 +102,15 @@ useUpdateDeviceStatus(
93
102
  box-sizing: border-box;
94
103
  height: var(--navbar-height);
95
104
  padding: var(--navbar-padding-v) var(--navbar-padding-h);
96
- border-bottom: 1px solid var(--c-border);
105
+ border-bottom: 1px solid var(--vp-c-border);
97
106
 
98
- background-color: var(--c-bg-navbar);
107
+ background-color: var(--vp-navbar-c-bg);
99
108
 
100
109
  line-height: var(--navbar-line-height);
101
110
 
102
111
  transition:
103
- background-color var(--t-color),
104
- border-color var(--t-color);
112
+ background-color var(--vp-t-color),
113
+ border-color var(--vp-t-color);
105
114
 
106
115
  @media screen and (max-width: $MQMobile) {
107
116
  padding-left: 4rem;
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { useDarkMode } from '@theme/useDarkMode'
3
3
  import { useThemeLocaleData } from '@theme/useThemeData'
4
- import { computed, h } from 'vue'
5
4
  import type { FunctionalComponent } from 'vue'
5
+ import { computed, h } from 'vue'
6
6
  import {
7
7
  ClientOnly,
8
8
  RouteLink,
@@ -76,7 +76,7 @@ const NavbarBrandLogo: FunctionalComponent = () => {
76
76
 
77
77
  .vp-site-name {
78
78
  position: relative;
79
- color: var(--c-text);
79
+ color: var(--vp-c-text);
80
80
  font-weight: 600;
81
81
  font-size: 1.3rem;
82
82
 
@@ -86,7 +86,7 @@ const NavbarBrandLogo: FunctionalComponent = () => {
86
86
  overflow: hidden;
87
87
 
88
88
  // 5.5rem for navbar padding-inline
89
- // 4.5rem for ColorModeSwitch and VPSearch
89
+ // 4.5rem for ColorModeSwitch and SearchBox
90
90
  // 1rem for gap
91
91
  width: calc(100vw - 11rem);
92
92
 
@@ -5,6 +5,7 @@ import { AutoLink, useRoute } from 'vuepress/client'
5
5
  import type { AutoLinkOptions, NavGroup } from '../../shared/index.js'
6
6
 
7
7
  const props = defineProps<{
8
+ /** dropdown items */
8
9
  item: NavGroup<AutoLinkOptions | NavGroup<AutoLinkOptions>>
9
10
  }>()
10
11
 
@@ -17,8 +18,8 @@ const dropdownAriaLabel = computed(
17
18
  () => item.value.ariaLabel || item.value.text,
18
19
  )
19
20
 
20
- const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
21
- arr[arr.length - 1] === item
21
+ const isLastItemOfArray = (arrayItem: unknown, array: unknown[]): boolean =>
22
+ array[array.length - 1] === arrayItem
22
23
 
23
24
  /**
24
25
  * Open the dropdown when user tab and click from keyboard.
@@ -28,7 +29,7 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
28
29
  *
29
30
  * @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
30
31
  */
31
- const handleDropdown = (e): void => {
32
+ const handleDropdown = (e: UIEvent): void => {
32
33
  const isTriggerByTab = e.detail === 0
33
34
 
34
35
  open.value = isTriggerByTab ? !open.value : false
@@ -161,11 +162,10 @@ watch(
161
162
  max-height: calc(100vh - 2.7rem);
162
163
  margin: 0;
163
164
  padding: 0.6rem 0;
164
- border: 1px solid var(--c-border);
165
- border-bottom-color: var(--c-border-dark);
166
- border-radius: 0.25rem;
165
+ border: 1px solid var(--vp-c-gutter);
166
+ border-radius: 0.5rem;
167
167
 
168
- background-color: var(--c-bg-navbar);
168
+ background-color: var(--vp-c-bg-elv);
169
169
 
170
170
  text-align: left;
171
171
  white-space: nowrap;
@@ -179,7 +179,7 @@ watch(
179
179
  border: none;
180
180
 
181
181
  background: transparent;
182
- color: var(--c-text);
182
+ color: var(--vp-c-text);
183
183
 
184
184
  font-weight: 500;
185
185
  font-size: 0.9rem;
@@ -204,7 +204,7 @@ watch(
204
204
  border: none;
205
205
 
206
206
  background: transparent;
207
- color: var(--c-text);
207
+ color: var(--vp-c-text);
208
208
 
209
209
  font-weight: 600;
210
210
  font-size: inherit;
@@ -218,7 +218,7 @@ watch(
218
218
  }
219
219
 
220
220
  &:hover {
221
- color: var(--c-text-accent);
221
+ color: var(--vp-c-accent);
222
222
  }
223
223
  }
224
224
 
@@ -239,11 +239,11 @@ watch(
239
239
  line-height: 1.7rem;
240
240
 
241
241
  &:hover {
242
- color: var(--c-text-accent);
242
+ color: var(--vp-c-accent);
243
243
  }
244
244
 
245
245
  &.route-link-active {
246
- color: var(--c-text-accent);
246
+ color: var(--vp-c-accent);
247
247
 
248
248
  &::after {
249
249
  content: '';
@@ -256,7 +256,7 @@ watch(
256
256
  height: 0;
257
257
  border-top: 3px solid transparent;
258
258
  border-bottom: 3px solid transparent;
259
- border-left: 5px solid var(--c-text-accent);
259
+ border-left: 5px solid var(--vp-c-accent);
260
260
  }
261
261
  }
262
262
  }
@@ -270,7 +270,7 @@ watch(
270
270
  .vp-navbar-dropdown-subtitle {
271
271
  margin: 0.45rem 0 0;
272
272
  padding: 1rem 0 0.45rem;
273
- border-top: 1px solid var(--c-border);
273
+ border-top: 1px solid var(--vp-c-gutter);
274
274
  font-size: 0.9rem;
275
275
 
276
276
  .vp-navbar-dropdown-wrapper.mobile & {
@@ -1,10 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import VPNavbarDropdown from '@theme/VPNavbarDropdown.vue'
2
3
  import { useNavbarConfig } from '@theme/useNavbarConfig'
3
4
  import { useNavbarRepo } from '@theme/useNavbarRepo'
4
5
  import { useNavbarSelectLanguage } from '@theme/useNavbarSelectLanguage'
5
6
  import { useThemeLocaleData } from '@theme/useThemeData'
6
7
  import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
7
- import VPNavbarDropdown from '@theme/VPNavbarDropdown.vue'
8
8
  import { computed, ref } from 'vue'
9
9
  import { AutoLink } from 'vuepress/client'
10
10
 
@@ -26,7 +26,7 @@ const navbarLinks = computed(() => [
26
26
  ])
27
27
 
28
28
  useUpdateDeviceStatus(
29
- DeviceType.MOBILE,
29
+ DeviceType.Mobile,
30
30
  (mobileDesktopBreakpoint: number): void => {
31
31
  // avoid overlapping of long title and long navbar links
32
32
  isMobile.value = window.innerWidth < mobileDesktopBreakpoint
@@ -34,6 +34,7 @@ useUpdateDeviceStatus(
34
34
  )
35
35
  </script>
36
36
 
37
+ <!-- eslint-disable-next-line vue/no-root-v-if -->
37
38
  <template>
38
39
  <nav
39
40
  v-if="navbarLinks.length"
@@ -68,7 +69,7 @@ useUpdateDeviceStatus(
68
69
 
69
70
  &:hover,
70
71
  &.route-link-active {
71
- color: var(--c-text);
72
+ color: var(--vp-c-text);
72
73
  }
73
74
  }
74
75
  }
@@ -90,7 +91,7 @@ useUpdateDeviceStatus(
90
91
  a {
91
92
  &:hover,
92
93
  &.route-link-active {
93
- color: var(--c-text-accent);
94
+ color: var(--vp-c-accent);
94
95
  }
95
96
  }
96
97
 
@@ -98,7 +99,7 @@ useUpdateDeviceStatus(
98
99
  &:hover,
99
100
  &.route-link-active {
100
101
  margin-bottom: -2px;
101
- border-bottom: 2px solid var(--c-text-accent);
102
+ border-bottom: 2px solid var(--vp-c-accent);
102
103
 
103
104
  @media (max-width: $MQMobile) {
104
105
  margin-bottom: 0;
@@ -1,14 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import VPPageMeta from '@theme/VPPageMeta.vue'
3
3
  import VPPageNav from '@theme/VPPageNav.vue'
4
+ import type { VNode } from 'vue'
4
5
  import { Content } from 'vuepress/client'
5
6
  import { setupHeaders } from '../composables/index.js'
6
7
 
7
8
  defineSlots<{
8
- 'top'?: (props: Record<never, never>) => any
9
- 'bottom'?: (props: Record<never, never>) => any
10
- 'content-top'?: (props: Record<never, never>) => any
11
- 'content-bottom'?: (props: Record<never, never>) => any
9
+ 'top'?: (props: Record<never, never>) => VNode | VNode[] | null
10
+ 'bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
11
+ 'content-top'?: (props: Record<never, never>) => VNode | VNode[] | null
12
+ 'content-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
12
13
  }>()
13
14
 
14
15
  setupHeaders()
@@ -18,7 +19,7 @@ setupHeaders()
18
19
  <main class="vp-page">
19
20
  <slot name="top" />
20
21
 
21
- <div class="theme-default-content">
22
+ <div class="theme-default-content" vp-content>
22
23
  <slot name="content-top" />
23
24
 
24
25
  <Content />
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
+ import VPEditIcon from '@theme/VPEditIcon.vue'
2
3
  import { useContributors } from '@theme/useContributors'
3
4
  import { useEditLink } from '@theme/useEditLink'
4
5
  import { useLastUpdated } from '@theme/useLastUpdated'
5
6
  import { useThemeLocaleData } from '@theme/useThemeData'
6
- import VPEditIcon from '@theme/VPEditIcon.vue'
7
7
  import { AutoLink } from 'vuepress/client'
8
8
 
9
9
  const themeLocale = useThemeLocaleData()
@@ -83,12 +83,12 @@ const contributors = useContributors()
83
83
  font-weight: 500;
84
84
 
85
85
  &:not(a) {
86
- color: var(--c-text-lighter);
86
+ color: var(--vp-c-text-mute);
87
87
  }
88
88
  }
89
89
 
90
90
  .vp-meta-info {
91
- color: var(--c-text-quote);
91
+ color: var(--vp-c-text-mute);
92
92
  font-weight: 400;
93
93
  }
94
94
  }
@@ -11,10 +11,9 @@ const navigate = useNavigate()
11
11
 
12
12
  const { prevLink, nextLink } = useRelatedLinks()
13
13
 
14
- const navbarLabel = computed(() => {
15
- const themeLocale = useThemeLocaleData()
16
- return themeLocale.value.pageNavbarLabel ?? 'page navigation'
17
- })
14
+ const navbarLabel = computed(
15
+ () => themeLocale.value.pageNavbarLabel ?? 'page navigation',
16
+ )
18
17
 
19
18
  useEventListener('keydown', (event): void => {
20
19
  if (event.altKey) {
@@ -33,6 +32,7 @@ useEventListener('keydown', (event): void => {
33
32
  })
34
33
  </script>
35
34
 
35
+ <!-- eslint-disable-next-line vue/no-root-v-if -->
36
36
  <template>
37
37
  <nav
38
38
  v-if="prevLink || nextLink"
@@ -74,9 +74,9 @@ useEventListener('keydown', (event): void => {
74
74
  margin-right: auto;
75
75
  margin-left: auto;
76
76
  padding: 1rem 2rem 0;
77
- border-top: 1px solid var(--c-border);
77
+ border-top: 1px solid var(--vp-c-gutter);
78
78
 
79
- transition: border-top var(--t-color);
79
+ transition: border-top var(--vp-t-color);
80
80
 
81
81
  @media (max-width: $MQNarrow) {
82
82
  padding-right: 1rem;
@@ -93,15 +93,15 @@ useEventListener('keydown', (event): void => {
93
93
 
94
94
  margin: 0.25rem;
95
95
  padding: 0.25rem 0.5rem;
96
- border: 1px solid var(--c-border);
96
+ border: 1px solid var(--vp-c-gutter);
97
97
  border-radius: 0.25rem;
98
98
 
99
99
  &:hover {
100
- background: var(--c-bg-light);
100
+ background: var(--c-bg-soft);
101
101
  }
102
102
 
103
103
  .hint {
104
- color: var(--c-text-quote);
104
+ color: var(--vp-c-text-mute);
105
105
  font-size: 0.875rem;
106
106
  line-height: 2;
107
107
  }
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
2
  import VPNavbarItems from '@theme/VPNavbarItems.vue'
3
3
  import VPSidebarItems from '@theme/VPSidebarItems.vue'
4
+ import type { VNode } from 'vue'
4
5
 
5
6
  defineSlots<{
6
- top?: (props: Record<never, never>) => any
7
- bottom?: (props: Record<never, never>) => any
7
+ top?: (props: Record<never, never>) => VNode | VNode[] | null
8
+ bottom?: (props: Record<never, never>) => VNode | VNode[] | null
8
9
  }>()
9
10
  </script>
10
11
 
11
12
  <template>
12
- <aside class="vp-sidebar">
13
+ <aside class="vp-sidebar" vp-sidebar>
13
14
  <VPNavbarItems />
14
15
  <slot name="top" />
15
16
  <VPSidebarItems />
@@ -34,18 +35,18 @@ defineSlots<{
34
35
  box-sizing: border-box;
35
36
  width: var(--sidebar-width);
36
37
  margin: 0;
37
- border-right: 1px solid var(--c-border);
38
+ border-right: 1px solid var(--vp-c-border);
38
39
 
39
- background-color: var(--c-bg-sidebar);
40
+ background-color: var(--vp-sidebar-c-bg);
40
41
 
41
42
  font-size: 16px;
42
43
 
43
44
  transition:
44
- transform var(--t-transform),
45
- background-color var(--t-color),
46
- border-color var(--t-color);
45
+ transform var(--vp-t-transform),
46
+ background-color var(--vp-t-color),
47
+ border-color var(--vp-t-color);
47
48
 
48
- scrollbar-color: var(--c-brand) var(--c-border);
49
+ scrollbar-color: var(--vp-c-accent-bg) var(--vp-c-gutter);
49
50
  scrollbar-width: thin;
50
51
 
51
52
  // narrow desktop / iPad
@@ -68,19 +69,19 @@ defineSlots<{
68
69
  }
69
70
 
70
71
  &::-webkit-scrollbar-track {
71
- background-color: var(--c-border);
72
+ background-color: var(--vp-c-gutter);
72
73
  }
73
74
 
74
75
  &::-webkit-scrollbar-thumb {
75
- background-color: var(--c-brand);
76
+ background-color: var(--vp-c-accent-bg);
76
77
  }
77
78
 
78
79
  // override styles
79
80
  .vp-navbar-items {
80
81
  display: none;
81
82
  padding: 0.5rem 0 0.75rem;
82
- border-bottom: 1px solid var(--c-border);
83
- transition: border-color var(--t-color);
83
+ border-bottom: 1px solid var(--vp-c-gutter);
84
+ transition: border-color var(--vp-t-color);
84
85
 
85
86
  @media (max-width: $MQMobile) {
86
87
  display: block;