@vuepress/theme-default 2.0.0-rc.6 → 2.0.0-rc.60

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 (141) hide show
  1. package/lib/client/components/VPDarkIcon.vue +8 -0
  2. package/lib/client/components/VPDropdownTransition.vue +36 -0
  3. package/lib/client/components/VPEditIcon.vue +12 -0
  4. package/lib/client/components/VPHome.vue +38 -0
  5. package/lib/client/components/VPHomeFeatures.vue +66 -0
  6. package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +17 -2
  7. package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +113 -19
  8. package/lib/client/components/VPLightIcon.vue +28 -0
  9. package/lib/client/components/VPNavbar.vue +134 -0
  10. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +40 -7
  11. package/lib/client/components/VPNavbarDropdown.vue +334 -0
  12. package/lib/client/components/VPNavbarItems.vue +111 -0
  13. package/lib/client/components/VPPage.vue +72 -0
  14. package/lib/client/components/VPPageMeta.vue +134 -0
  15. package/lib/client/components/VPPageNav.vue +118 -0
  16. package/lib/client/components/VPSidebar.vue +113 -0
  17. package/lib/client/components/VPSidebarItem.vue +174 -0
  18. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +32 -7
  19. package/lib/client/components/VPToggleColorModeButton.vue +55 -0
  20. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  21. package/lib/client/components/global/Badge.vue +84 -18
  22. package/lib/client/components/global/index.d.ts +1 -3
  23. package/lib/client/components/global/index.js +1 -3
  24. package/lib/client/composables/index.d.ts +8 -0
  25. package/lib/client/composables/index.js +8 -0
  26. package/lib/client/composables/useContributors.d.ts +3 -0
  27. package/lib/client/composables/useContributors.js +14 -0
  28. package/lib/client/composables/useDarkMode.d.ts +0 -1
  29. package/lib/client/composables/useDarkMode.js +16 -13
  30. package/lib/client/composables/useEditLink.d.ts +3 -0
  31. package/lib/client/composables/useEditLink.js +31 -0
  32. package/lib/client/composables/useLastUpdated.d.ts +2 -0
  33. package/lib/client/composables/useLastUpdated.js +17 -0
  34. package/lib/client/composables/useNavbarConfig.d.ts +3 -0
  35. package/lib/client/composables/useNavbarConfig.js +27 -0
  36. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  37. package/lib/client/composables/useNavbarRepo.js +38 -0
  38. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  39. package/lib/client/composables/useNavbarSelectLanguage.js +59 -0
  40. package/lib/client/composables/useNavigate.d.ts +1 -0
  41. package/lib/client/composables/useNavigate.js +22 -0
  42. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  43. package/lib/client/composables/useRelatedLinks.js +91 -0
  44. package/lib/client/composables/useScrollPromise.js +3 -1
  45. package/lib/client/composables/useSidebarItems.d.ts +28 -23
  46. package/lib/client/composables/useSidebarItems.js +120 -84
  47. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  48. package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
  49. package/lib/client/config.d.ts +3 -2
  50. package/lib/client/config.js +6 -23
  51. package/lib/client/index.d.ts +2 -1
  52. package/lib/client/index.js +0 -1
  53. package/lib/client/layouts/Layout.vue +139 -34
  54. package/lib/client/layouts/NotFound.vue +17 -5
  55. package/lib/client/shim.d.ts +12 -3
  56. package/lib/client/styles/_mixins.scss +4 -4
  57. package/lib/client/styles/_variables.module.scss +1 -1
  58. package/lib/client/styles/_variables.scss +2 -1
  59. package/lib/client/styles/arrow.scss +18 -24
  60. package/lib/client/styles/code-group.scss +35 -30
  61. package/lib/client/styles/content/code.scss +23 -0
  62. package/lib/client/styles/content/index.scss +3 -0
  63. package/lib/client/styles/content/normalize.scss +39 -0
  64. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  65. package/lib/client/styles/external-link-icon.scss +36 -0
  66. package/lib/client/styles/index.scss +3 -13
  67. package/lib/client/styles/layout.scss +3 -199
  68. package/lib/client/styles/normalize.scss +1 -194
  69. package/lib/client/styles/plugins.scss +28 -0
  70. package/lib/client/styles/vars-dark.scss +20 -58
  71. package/lib/client/styles/vars.scss +53 -129
  72. package/lib/client/typings.d.ts +13 -0
  73. package/lib/client/typings.js +1 -0
  74. package/lib/client/utils/getAutoLink.d.ts +9 -0
  75. package/lib/client/utils/getAutoLink.js +17 -0
  76. package/lib/client/utils/index.d.ts +3 -2
  77. package/lib/client/utils/index.js +3 -2
  78. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
  79. package/lib/client/utils/isActiveSidebarItem.js +3 -3
  80. package/lib/client/utils/isLinkInternal.d.ts +1 -0
  81. package/lib/client/utils/isLinkInternal.js +2 -0
  82. package/lib/client/utils/resolveEditLink.d.ts +1 -1
  83. package/lib/client/utils/resolvePrefix.d.ts +1 -0
  84. package/lib/client/utils/resolvePrefix.js +4 -0
  85. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  86. package/lib/client/utils/resolveRepoType.js +4 -4
  87. package/lib/node/defaultTheme.d.ts +2 -1
  88. package/lib/node/defaultTheme.js +40 -49
  89. package/lib/node/index.d.ts +2 -3
  90. package/lib/node/index.js +0 -3
  91. package/lib/node/typings.d.ts +58 -0
  92. package/lib/node/typings.js +1 -0
  93. package/lib/node/utils/assignDefaultLocaleOptions.js +3 -7
  94. package/lib/node/utils/index.d.ts +1 -1
  95. package/lib/node/utils/index.js +1 -1
  96. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  97. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  98. package/lib/shared/index.d.ts +5 -3
  99. package/lib/shared/index.js +1 -3
  100. package/lib/shared/nav.d.ts +19 -30
  101. package/lib/shared/navbar.d.ts +21 -0
  102. package/lib/shared/navbar.js +1 -0
  103. package/lib/shared/options.d.ts +36 -65
  104. package/lib/shared/page.d.ts +9 -6
  105. package/lib/shared/sidebar.d.ts +26 -0
  106. package/lib/shared/sidebar.js +1 -0
  107. package/package.json +30 -28
  108. package/templates/build.html +14 -8
  109. package/lib/client/components/AutoLink.vue +0 -113
  110. package/lib/client/components/DropdownTransition.vue +0 -25
  111. package/lib/client/components/Home.vue +0 -15
  112. package/lib/client/components/HomeContent.vue +0 -5
  113. package/lib/client/components/HomeFeatures.vue +0 -22
  114. package/lib/client/components/Navbar.vue +0 -79
  115. package/lib/client/components/NavbarDropdown.vue +0 -126
  116. package/lib/client/components/NavbarItems.vue +0 -199
  117. package/lib/client/components/Page.vue +0 -31
  118. package/lib/client/components/PageMeta.vue +0 -124
  119. package/lib/client/components/PageNav.vue +0 -122
  120. package/lib/client/components/Sidebar.vue +0 -18
  121. package/lib/client/components/SidebarItem.vue +0 -87
  122. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  123. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  124. package/lib/client/components/global/CodeGroup.d.ts +0 -6
  125. package/lib/client/components/global/CodeGroup.js +0 -120
  126. package/lib/client/components/global/CodeGroupItem.vue +0 -27
  127. package/lib/client/styles/badge.scss +0 -36
  128. package/lib/client/styles/code.scss +0 -263
  129. package/lib/client/styles/custom-container.scss +0 -142
  130. package/lib/client/styles/home.scss +0 -168
  131. package/lib/client/styles/navbar-dropdown.scss +0 -183
  132. package/lib/client/styles/navbar.scss +0 -197
  133. package/lib/client/styles/page.scss +0 -87
  134. package/lib/client/styles/sidebar.scss +0 -134
  135. package/lib/client/styles/transitions.scss +0 -22
  136. package/lib/client/utils/getNavLink.d.ts +0 -15
  137. package/lib/client/utils/getNavLink.js +0 -18
  138. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  139. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
  140. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  141. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -0,0 +1,334 @@
1
+ <script setup lang="ts">
2
+ import VPDropdownTransition from '@theme/VPDropdownTransition.vue'
3
+ import { useToggle } from '@vueuse/core'
4
+ import { computed, toRefs, watch } from 'vue'
5
+ import { AutoLink, useRoute } from 'vuepress/client'
6
+ import type { AutoLinkOptions, NavGroup } from '../../shared/index.js'
7
+
8
+ const props = defineProps<{
9
+ /** dropdown config */
10
+ config: NavGroup<AutoLinkOptions | NavGroup<AutoLinkOptions>>
11
+ }>()
12
+
13
+ const { config } = toRefs(props)
14
+ const route = useRoute()
15
+
16
+ const [open, toggleOpen] = useToggle(false)
17
+
18
+ const dropdownAriaLabel = computed(
19
+ () => config.value.ariaLabel || config.value.text,
20
+ )
21
+
22
+ const isLastItemOfArray = (arrayItem: unknown, array: unknown[]): boolean =>
23
+ array[array.length - 1] === arrayItem
24
+
25
+ /**
26
+ * Open the dropdown when user tab and click from keyboard.
27
+ *
28
+ * Use event.detail to detect tab and click from keyboard.
29
+ * The Tab + Click is UIEvent > KeyboardEvent, so the detail is 0.
30
+ *
31
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
32
+ */
33
+ const handleDropdown = (e: UIEvent): void => {
34
+ if (e.detail === 0) toggleOpen()
35
+ else toggleOpen(false)
36
+ }
37
+
38
+ watch(
39
+ () => route.path,
40
+ () => {
41
+ toggleOpen(false)
42
+ },
43
+ )
44
+ </script>
45
+
46
+ <template>
47
+ <div class="vp-navbar-dropdown-wrapper" :class="{ open }">
48
+ <button
49
+ class="vp-navbar-dropdown-title"
50
+ type="button"
51
+ :aria-label="dropdownAriaLabel"
52
+ @click="handleDropdown"
53
+ >
54
+ <span class="title">{{ config.text }}</span>
55
+ <span class="arrow down" />
56
+ </button>
57
+
58
+ <button
59
+ class="vp-navbar-dropdown-title-mobile"
60
+ type="button"
61
+ :aria-label="dropdownAriaLabel"
62
+ @click="() => toggleOpen()"
63
+ >
64
+ <span class="title">{{ config.text }}</span>
65
+ <span class="arrow" :class="open ? 'down' : 'right'" />
66
+ </button>
67
+
68
+ <VPDropdownTransition>
69
+ <ul v-show="open" class="vp-navbar-dropdown">
70
+ <li
71
+ v-for="child in config.children"
72
+ :key="child.text"
73
+ class="vp-navbar-dropdown-item"
74
+ >
75
+ <template v-if="'children' in child">
76
+ <h4 class="vp-navbar-dropdown-subtitle">
77
+ <AutoLink
78
+ v-if="child.link"
79
+ :config="child"
80
+ @focusout="
81
+ () => {
82
+ if (
83
+ isLastItemOfArray(child, config.children) &&
84
+ child.children.length === 0
85
+ ) {
86
+ open = false
87
+ }
88
+ }
89
+ "
90
+ />
91
+
92
+ <span v-else>{{ child.text }}</span>
93
+ </h4>
94
+
95
+ <ul class="vp-navbar-dropdown-subitem-wrapper">
96
+ <li
97
+ v-for="grandchild in child.children"
98
+ :key="grandchild.link"
99
+ class="vp-navbar-dropdown-subitem"
100
+ >
101
+ <AutoLink
102
+ :config="grandchild"
103
+ @focusout="
104
+ () => {
105
+ if (
106
+ isLastItemOfArray(grandchild, child.children) &&
107
+ isLastItemOfArray(child, config.children)
108
+ ) {
109
+ toggleOpen(false)
110
+ }
111
+ }
112
+ "
113
+ />
114
+ </li>
115
+ </ul>
116
+ </template>
117
+
118
+ <template v-else>
119
+ <AutoLink
120
+ :config="child"
121
+ @focusout="
122
+ () => {
123
+ if (isLastItemOfArray(child, config.children)) {
124
+ toggleOpen(false)
125
+ }
126
+ }
127
+ "
128
+ />
129
+ </template>
130
+ </li>
131
+ </ul>
132
+ </VPDropdownTransition>
133
+ </div>
134
+ </template>
135
+
136
+ <style lang="scss">
137
+ @use '../styles/mixins';
138
+ @use '../styles/variables' as *;
139
+
140
+ .vp-navbar-dropdown-wrapper {
141
+ cursor: pointer;
142
+
143
+ &:not(.mobile) {
144
+ height: 1.8rem;
145
+
146
+ &:hover,
147
+ &.open {
148
+ .vp-navbar-dropdown {
149
+ // override the inline style.
150
+ display: block !important;
151
+ }
152
+ }
153
+ }
154
+ }
155
+
156
+ .vp-navbar-dropdown {
157
+ .vp-navbar-dropdown-wrapper.mobile & {
158
+ @include mixins.dropdown-wrapper;
159
+
160
+ padding-top: 0.5rem;
161
+ }
162
+
163
+ .vp-navbar-dropdown-wrapper:not(.mobile) & {
164
+ position: absolute;
165
+ top: 100%;
166
+ right: 0;
167
+
168
+ display: none;
169
+
170
+ overflow-y: auto;
171
+
172
+ box-sizing: border-box;
173
+
174
+ // Avoid height shake by clicking
175
+ height: auto !important;
176
+ max-height: calc(100vh - 2.7rem);
177
+ margin: 0;
178
+ padding: 0.6rem 0;
179
+ border: 1px solid var(--vp-c-gutter);
180
+ border-radius: 0.5rem;
181
+
182
+ background-color: var(--vp-c-bg-elv);
183
+
184
+ text-align: left;
185
+ white-space: nowrap;
186
+ }
187
+ }
188
+
189
+ .vp-navbar-dropdown-title {
190
+ display: block;
191
+
192
+ padding: inherit;
193
+ border: none;
194
+
195
+ background: transparent;
196
+ color: var(--vp-c-text);
197
+
198
+ font-weight: 500;
199
+ font-size: 0.9rem;
200
+ font-family: inherit;
201
+ line-height: 1.4rem;
202
+
203
+ cursor: inherit;
204
+
205
+ .vp-navbar-dropdown-wrapper.mobile & {
206
+ display: none;
207
+ }
208
+
209
+ &:hover {
210
+ border-color: transparent;
211
+ }
212
+ }
213
+
214
+ .vp-navbar-dropdown-title-mobile {
215
+ display: none;
216
+
217
+ padding: inherit;
218
+ border: none;
219
+
220
+ background: transparent;
221
+ color: var(--vp-c-text);
222
+
223
+ font-weight: 600;
224
+ font-size: inherit;
225
+ font-family: inherit;
226
+ line-height: 1.4rem;
227
+
228
+ cursor: inherit;
229
+
230
+ .vp-navbar-dropdown-wrapper.mobile & {
231
+ display: block;
232
+ }
233
+
234
+ &:hover {
235
+ color: var(--vp-c-accent);
236
+ }
237
+ }
238
+
239
+ .vp-navbar-dropdown-item {
240
+ color: inherit;
241
+ line-height: 1.7rem;
242
+
243
+ a {
244
+ position: relative;
245
+
246
+ display: block;
247
+
248
+ margin-bottom: 0;
249
+ padding: 0 1.5rem 0 1.25rem;
250
+ border-bottom: none;
251
+
252
+ font-weight: 400;
253
+ line-height: 1.7rem;
254
+
255
+ &:hover {
256
+ color: var(--vp-c-accent);
257
+ }
258
+
259
+ &.route-link-active {
260
+ color: var(--vp-c-accent);
261
+
262
+ &::after {
263
+ content: '';
264
+
265
+ position: absolute;
266
+ top: calc(50% - 2px);
267
+ left: 9px;
268
+
269
+ width: 0;
270
+ height: 0;
271
+ border-top: 3px solid transparent;
272
+ border-bottom: 3px solid transparent;
273
+ border-left: 5px solid var(--vp-c-accent);
274
+ }
275
+ }
276
+ }
277
+
278
+ .vp-navbar-dropdown-wrapper.mobile & > a {
279
+ font-size: 15px;
280
+ line-height: 2rem;
281
+ }
282
+ }
283
+
284
+ .vp-navbar-dropdown-subtitle {
285
+ margin: 0.45rem 0 0;
286
+ padding: 1rem 0 0.45rem;
287
+ border-top: 1px solid var(--vp-c-gutter);
288
+ font-size: 0.9rem;
289
+
290
+ .vp-navbar-dropdown-wrapper.mobile & {
291
+ margin-top: 0;
292
+ padding-top: 0;
293
+ padding-bottom: 0;
294
+ border-top: 0;
295
+
296
+ font-size: 15px;
297
+ line-height: 2rem;
298
+ }
299
+
300
+ .vp-navbar-dropdown-item:first-child & {
301
+ margin-top: 0;
302
+ padding-top: 0;
303
+ border-top: 0;
304
+ }
305
+
306
+ > span {
307
+ padding: 0 1.5rem 0 1.25rem;
308
+ }
309
+
310
+ > a {
311
+ font-weight: inherit;
312
+
313
+ &.route-link-active {
314
+ &::after {
315
+ display: none;
316
+ }
317
+ }
318
+ }
319
+ }
320
+
321
+ .vp-navbar-dropdown-subitem-wrapper {
322
+ padding: 0;
323
+ list-style: none;
324
+ }
325
+
326
+ .vp-navbar-dropdown-subitem {
327
+ font-size: 0.9em;
328
+
329
+ .vp-navbar-dropdown-wrapper.mobile & {
330
+ padding-left: 1rem;
331
+ font-size: 14px;
332
+ }
333
+ }
334
+ </style>
@@ -0,0 +1,111 @@
1
+ <script setup lang="ts">
2
+ import VPNavbarDropdown from '@theme/VPNavbarDropdown.vue'
3
+ import { useNavbarConfig } from '@theme/useNavbarConfig'
4
+ import { useNavbarRepo } from '@theme/useNavbarRepo'
5
+ import { useNavbarSelectLanguage } from '@theme/useNavbarSelectLanguage'
6
+ import { useThemeLocaleData } from '@theme/useThemeData'
7
+ import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
8
+ import { computed, ref } from 'vue'
9
+ import { AutoLink } from 'vuepress/client'
10
+
11
+ const navbarConfig = useNavbarConfig()
12
+ const navbarSelectLanguage = useNavbarSelectLanguage()
13
+ const navbarRepo = useNavbarRepo()
14
+
15
+ const isMobile = ref(false)
16
+
17
+ const navbarLabel = computed(() => {
18
+ const themeLocale = useThemeLocaleData()
19
+ return themeLocale.value.navbarLabel ?? 'site navigation'
20
+ })
21
+
22
+ const navbarLinks = computed(() => [
23
+ ...navbarConfig.value,
24
+ ...navbarSelectLanguage.value,
25
+ ...navbarRepo.value,
26
+ ])
27
+
28
+ useUpdateDeviceStatus(
29
+ DeviceType.Mobile,
30
+ (mobileDesktopBreakpoint: number): void => {
31
+ // avoid overlapping of long title and long navbar links
32
+ isMobile.value = window.innerWidth < mobileDesktopBreakpoint
33
+ },
34
+ )
35
+ </script>
36
+
37
+ <!-- eslint-disable-next-line vue/no-root-v-if -->
38
+ <template>
39
+ <nav
40
+ v-if="navbarLinks.length"
41
+ class="vp-navbar-items"
42
+ :aria-label="navbarLabel"
43
+ >
44
+ <div v-for="item in navbarLinks" :key="item.text" class="vp-navbar-item">
45
+ <VPNavbarDropdown
46
+ v-if="'children' in item"
47
+ :class="{ mobile: isMobile }"
48
+ :config="item"
49
+ />
50
+ <AutoLink v-else :config="item" />
51
+ </div>
52
+ </nav>
53
+ </template>
54
+
55
+ <style lang="scss">
56
+ @use '../styles/variables' as *;
57
+
58
+ .vp-navbar-items {
59
+ display: inline-block;
60
+
61
+ @media print {
62
+ display: none;
63
+ }
64
+
65
+ a {
66
+ display: inline-block;
67
+ color: inherit;
68
+ line-height: 1.4rem;
69
+
70
+ &:hover,
71
+ &.route-link-active {
72
+ color: var(--vp-c-text);
73
+ }
74
+ }
75
+ }
76
+
77
+ .vp-navbar-item {
78
+ position: relative;
79
+ display: inline-block;
80
+ margin-left: 1.5rem;
81
+ line-height: var(--navbar-line-height);
82
+
83
+ @media (max-width: $MQMobile) {
84
+ margin-left: 0;
85
+ }
86
+
87
+ &:first-child {
88
+ margin-left: 0;
89
+ }
90
+
91
+ a {
92
+ &:hover,
93
+ &.route-link-active {
94
+ color: var(--vp-c-accent);
95
+ }
96
+ }
97
+
98
+ > a {
99
+ &:hover,
100
+ &.route-link-active {
101
+ margin-bottom: -2px;
102
+ border-bottom: 2px solid var(--vp-c-accent);
103
+
104
+ @media (max-width: $MQMobile) {
105
+ margin-bottom: 0;
106
+ border-bottom: none;
107
+ }
108
+ }
109
+ }
110
+ }
111
+ </style>
@@ -0,0 +1,72 @@
1
+ <script setup lang="ts">
2
+ import VPPageMeta from '@theme/VPPageMeta.vue'
3
+ import VPPageNav from '@theme/VPPageNav.vue'
4
+ import type { VNode } from 'vue'
5
+ import { Content } from 'vuepress/client'
6
+ import { setupHeaders } from '../composables/index.js'
7
+
8
+ defineSlots<{
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
13
+ }>()
14
+
15
+ setupHeaders()
16
+ </script>
17
+
18
+ <template>
19
+ <main class="vp-page">
20
+ <slot name="top" />
21
+
22
+ <div class="theme-default-content" vp-content>
23
+ <slot name="content-top" />
24
+
25
+ <Content />
26
+
27
+ <slot name="content-bottom" />
28
+ </div>
29
+
30
+ <VPPageMeta />
31
+
32
+ <VPPageNav />
33
+
34
+ <slot name="bottom" />
35
+ </main>
36
+ </template>
37
+
38
+ <style lang="scss">
39
+ @use '../styles/mixins';
40
+ @use '../styles/variables' as *;
41
+
42
+ .vp-page {
43
+ display: block;
44
+
45
+ // leave space for navbar
46
+ padding-top: var(--navbar-height);
47
+ padding-bottom: 2rem;
48
+
49
+ // leave space for sidebar
50
+ padding-left: var(--sidebar-width);
51
+
52
+ // narrow desktop / iPad
53
+ @media (max-width: $MQNarrow) {
54
+ // leave space for sidebar
55
+ padding-left: var(--sidebar-width-mobile);
56
+ }
57
+
58
+ // wide mobile
59
+ @media (max-width: $MQMobile) {
60
+ // sidebar is collapsed
61
+ padding-left: 0;
62
+ }
63
+
64
+ .theme-default-content {
65
+ @include mixins.content-wrapper;
66
+
67
+ & {
68
+ padding-top: 0;
69
+ }
70
+ }
71
+ }
72
+ </style>
@@ -0,0 +1,134 @@
1
+ <script setup lang="ts">
2
+ import VPEditIcon from '@theme/VPEditIcon.vue'
3
+ import { useContributors } from '@theme/useContributors'
4
+ import { useEditLink } from '@theme/useEditLink'
5
+ import { useLastUpdated } from '@theme/useLastUpdated'
6
+ import { useThemeLocaleData } from '@theme/useThemeData'
7
+ import { AutoLink } from 'vuepress/client'
8
+
9
+ const themeLocale = useThemeLocaleData()
10
+ const editLink = useEditLink()
11
+ const lastUpdated = useLastUpdated()
12
+ const contributors = useContributors()
13
+ </script>
14
+
15
+ <template>
16
+ <footer class="vp-page-meta">
17
+ <div v-if="editLink" class="vp-meta-item edit-link">
18
+ <AutoLink class="label" :config="editLink">
19
+ <template #before>
20
+ <VPEditIcon />
21
+ </template>
22
+ </AutoLink>
23
+ </div>
24
+
25
+ <div class="vp-meta-item git-info">
26
+ <div v-if="lastUpdated" class="vp-meta-item last-updated">
27
+ <span class="meta-item-label">{{ themeLocale.lastUpdatedText }}: </span>
28
+ <ClientOnly>
29
+ <span class="meta-item-info">{{ lastUpdated }}</span>
30
+ </ClientOnly>
31
+ </div>
32
+
33
+ <div
34
+ v-if="contributors && contributors.length"
35
+ class="vp-meta-item contributors"
36
+ >
37
+ <span class="meta-item-label"
38
+ >{{ themeLocale.contributorsText }}:
39
+ </span>
40
+ <span class="meta-item-info">
41
+ <template v-for="(contributor, index) in contributors" :key="index">
42
+ <span class="contributor" :title="`email: ${contributor.email}`">
43
+ {{ contributor.name }}
44
+ </span>
45
+ <template v-if="index !== contributors.length - 1">, </template>
46
+ </template>
47
+ </span>
48
+ </div>
49
+ </div>
50
+ </footer>
51
+ </template>
52
+
53
+ <style lang="scss">
54
+ @use '../styles/mixins';
55
+ @use '../styles/variables' as *;
56
+
57
+ .vp-page-meta {
58
+ @include mixins.content-wrapper;
59
+
60
+ & {
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ justify-content: space-between;
64
+
65
+ overflow: auto;
66
+
67
+ padding-top: 0.75rem;
68
+ padding-bottom: 0.75rem;
69
+ }
70
+
71
+ @media print {
72
+ margin: 0 !important;
73
+ padding-right: 0 !important;
74
+ padding-left: 0 !important;
75
+ }
76
+
77
+ @media (max-width: $MQMobile) {
78
+ display: block;
79
+ }
80
+
81
+ .vp-meta-item {
82
+ flex-grow: 1;
83
+
84
+ .vp-meta-label {
85
+ font-weight: 500;
86
+
87
+ &:not(a) {
88
+ color: var(--vp-c-text-mute);
89
+ }
90
+ }
91
+
92
+ .vp-meta-info {
93
+ color: var(--vp-c-text-mute);
94
+ font-weight: 400;
95
+ }
96
+ }
97
+
98
+ .git-info {
99
+ text-align: end;
100
+ }
101
+
102
+ .edit-link {
103
+ margin-top: 0.25rem;
104
+ margin-right: 0.5rem;
105
+ margin-bottom: 0.25rem;
106
+ font-size: 14px;
107
+
108
+ @media print {
109
+ display: none;
110
+ }
111
+
112
+ .edit-icon {
113
+ position: relative;
114
+ bottom: -0.125em;
115
+
116
+ width: 1em;
117
+ height: 1em;
118
+ margin-right: 0.25em;
119
+ }
120
+ }
121
+
122
+ .last-updated,
123
+ .contributors {
124
+ margin-top: 0.25rem;
125
+ margin-bottom: 0.25rem;
126
+ font-size: 14px;
127
+
128
+ @media (max-width: $MQMobile) {
129
+ font-size: 13px;
130
+ text-align: start;
131
+ }
132
+ }
133
+ }
134
+ </style>