vitepress 1.0.0-draft.3 → 1.0.0-draft.6
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.
- package/README.md +3 -1
- package/bin/vitepress.js +1 -1
- package/dist/client/app/composables/head.js +2 -2
- package/dist/client/app/data.js +2 -4
- package/dist/client/app/index.js +1 -5
- package/dist/client/index.d.ts +123 -134
- package/dist/client/index.js +1 -2
- package/dist/client/shared.js +21 -0
- package/dist/client/theme-default/Layout.vue +7 -0
- package/dist/client/theme-default/NotFound.vue +74 -14
- package/dist/client/theme-default/components/VPBox.vue +2 -6
- package/dist/client/theme-default/components/VPButton.vue +0 -1
- package/dist/client/theme-default/components/VPCarbonAds.vue +90 -0
- package/dist/client/theme-default/components/VPContent.vue +14 -10
- package/dist/client/theme-default/components/VPDoc.vue +73 -58
- package/dist/client/theme-default/components/VPDocAside.vue +34 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
- package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +14 -3
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +32 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +1 -1
- package/dist/client/theme-default/components/VPFlyout.vue +2 -3
- package/dist/client/theme-default/components/VPFooter.vue +1 -1
- package/dist/client/theme-default/components/VPHero.vue +170 -29
- package/dist/client/theme-default/components/VPHomeFeatures.vue +1 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +1 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +3 -3
- package/dist/client/theme-default/components/VPLink.vue +2 -1
- package/dist/client/theme-default/components/VPLocalNav.vue +1 -1
- package/dist/client/theme-default/components/VPMenu.vue +9 -14
- package/dist/client/theme-default/components/VPMenuLink.vue +10 -4
- package/dist/client/theme-default/components/VPNav.vue +18 -1
- package/dist/client/theme-default/components/VPNavBar.vue +20 -8
- package/dist/client/theme-default/components/VPNavBarExtra.vue +20 -45
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +2 -8
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +3 -3
- package/dist/client/theme-default/components/VPNavBarSearch.vue +6 -6
- package/dist/client/theme-default/components/VPNavBarTitle.vue +4 -2
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +10 -39
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +1 -2
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +1 -1
- package/dist/client/theme-default/components/VPSidebar.vue +12 -6
- package/dist/client/theme-default/components/VPSidebarGroup.vue +80 -17
- package/dist/client/theme-default/components/VPSidebarLink.vue +2 -9
- package/dist/client/theme-default/components/VPSocialLink.vue +2 -2
- package/dist/client/theme-default/components/VPSocialLinks.vue +1 -1
- package/dist/client/theme-default/components/VPSponsors.vue +15 -40
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +2 -2
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
- package/dist/client/theme-default/composables/aside.js +17 -0
- package/dist/client/theme-default/composables/copy-code.js +33 -0
- package/dist/client/theme-default/composables/outline.js +14 -4
- package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
- package/dist/client/theme-default/index.js +4 -2
- package/dist/client/theme-default/styles/base.css +13 -1
- package/dist/client/theme-default/styles/components/custom-block.css +90 -0
- package/dist/client/theme-default/styles/{vp-doc.css → components/vp-doc.css} +152 -115
- package/dist/client/theme-default/styles/{vp-sponsor.css → components/vp-sponsor.css} +51 -7
- package/dist/client/theme-default/styles/vars.css +109 -58
- package/dist/node/cli.js +32 -31
- package/dist/node/index.d.ts +371 -361
- package/dist/node/index.js +22 -37
- package/dist/node/serve-9c85885c.js +64795 -0
- package/dist/node-cjs/cli.cjs +304 -0
- package/dist/node-cjs/index.cjs +38 -0
- package/dist/{node/serve-b5dc02b2.js → node-cjs/serve-a73b4871.cjs} +27405 -28602
- package/package.json +47 -40
- package/theme.d.ts +7 -2
- package/types/default-theme.d.ts +15 -2
- package/types/shared.d.ts +3 -0
|
@@ -1,36 +1,51 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import VPButton from './VPButton.vue'
|
|
3
3
|
|
|
4
|
-
interface HeroAction {
|
|
4
|
+
export interface HeroAction {
|
|
5
5
|
theme?: 'brand' | 'alt'
|
|
6
6
|
text: string
|
|
7
7
|
link: string
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export interface Image {
|
|
11
|
+
light: string
|
|
12
|
+
dark: string
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
defineProps<{
|
|
11
16
|
name?: string
|
|
12
17
|
text: string
|
|
13
18
|
tagline?: string
|
|
19
|
+
image?: Image
|
|
14
20
|
actions?: HeroAction[]
|
|
15
21
|
}>()
|
|
16
22
|
</script>
|
|
17
23
|
|
|
18
24
|
<template>
|
|
19
|
-
<div class="VPHero">
|
|
25
|
+
<div class="VPHero" :class="{ 'has-image': image }">
|
|
20
26
|
<div class="container">
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<div v-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
<div class="main">
|
|
28
|
+
<p v-if="name" class="name"><span class="clip">{{ name }}</span></p>
|
|
29
|
+
<h1 v-if="text" class="text">{{ text }}</h1>
|
|
30
|
+
<p v-if="tagline" class="tagline">{{ tagline }}</p>
|
|
31
|
+
|
|
32
|
+
<div v-if="actions" class="actions">
|
|
33
|
+
<div v-for="action in actions" :key="action.link" class="action">
|
|
34
|
+
<VPButton
|
|
35
|
+
tag="a"
|
|
36
|
+
size="medium"
|
|
37
|
+
:theme="action.theme"
|
|
38
|
+
:text="action.text"
|
|
39
|
+
:href="action.link"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div v-if="image" class="image">
|
|
46
|
+
<div class="image-container">
|
|
47
|
+
<img class="image-src light" :src="image.light">
|
|
48
|
+
<img class="image-src dark" :src="image.dark">
|
|
34
49
|
</div>
|
|
35
50
|
</div>
|
|
36
51
|
</div>
|
|
@@ -41,6 +56,7 @@ defineProps<{
|
|
|
41
56
|
.VPHero {
|
|
42
57
|
margin-top: calc(var(--vp-nav-height) * -1);
|
|
43
58
|
padding: calc(var(--vp-nav-height) + 48px) 24px 48px;
|
|
59
|
+
overflow: hidden;
|
|
44
60
|
}
|
|
45
61
|
|
|
46
62
|
@media (min-width: 640px) {
|
|
@@ -50,66 +66,113 @@ defineProps<{
|
|
|
50
66
|
}
|
|
51
67
|
|
|
52
68
|
.container {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
53
71
|
margin: 0 auto;
|
|
54
72
|
max-width: 960px;
|
|
55
73
|
}
|
|
56
74
|
|
|
75
|
+
@media (min-width: 960px) {
|
|
76
|
+
.container {
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.main {
|
|
82
|
+
position: relative;
|
|
83
|
+
z-index: 10;
|
|
84
|
+
order: 2;
|
|
85
|
+
flex-grow: 1;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.VPHero.has-image .container {
|
|
90
|
+
text-align: center;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (min-width: 960px) {
|
|
94
|
+
.VPHero.has-image .container {
|
|
95
|
+
text-align: left;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (min-width: 960px) {
|
|
100
|
+
.main {
|
|
101
|
+
order: 1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (min-width: 960px) {
|
|
106
|
+
.main {
|
|
107
|
+
width: 100%;
|
|
108
|
+
max-width: calc((100% / 3) * 2);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
57
112
|
.name,
|
|
58
113
|
.text {
|
|
114
|
+
max-width: 392px;
|
|
115
|
+
letter-spacing: -0.4px;
|
|
59
116
|
line-height: 40px;
|
|
60
117
|
font-size: 32px;
|
|
61
118
|
font-weight: 700;
|
|
62
119
|
}
|
|
63
120
|
|
|
121
|
+
.VPHero.has-image .name,
|
|
122
|
+
.VPHero.has-image .text {
|
|
123
|
+
margin: 0 auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
64
126
|
.name {
|
|
65
|
-
padding-bottom: 4px;
|
|
66
127
|
color: var(--vp-home-hero-name-color);
|
|
67
128
|
}
|
|
68
129
|
|
|
69
130
|
.clip {
|
|
70
131
|
background: var(--vp-home-hero-name-background);
|
|
71
|
-
-webkit-text-fill-color: var(--vp-home-hero-name-color);
|
|
72
132
|
-webkit-background-clip: text;
|
|
133
|
+
background-clip: text;
|
|
134
|
+
-webkit-text-fill-color: var(--vp-home-hero-name-color);
|
|
73
135
|
}
|
|
74
136
|
|
|
75
137
|
@media (min-width: 640px) {
|
|
76
138
|
.name,
|
|
77
139
|
.text {
|
|
78
|
-
max-width:
|
|
140
|
+
max-width: 576px;
|
|
79
141
|
line-height: 56px;
|
|
80
142
|
font-size: 48px;
|
|
81
143
|
}
|
|
82
|
-
|
|
83
|
-
.name {
|
|
84
|
-
padding-bottom: 6px;
|
|
85
|
-
}
|
|
86
144
|
}
|
|
87
145
|
|
|
88
146
|
@media (min-width: 960px) {
|
|
89
147
|
.name,
|
|
90
148
|
.text {
|
|
91
|
-
max-width: 720px;
|
|
92
149
|
line-height: 64px;
|
|
93
150
|
font-size: 56px;
|
|
94
151
|
}
|
|
95
152
|
|
|
96
|
-
.name
|
|
97
|
-
|
|
153
|
+
.VPHero.has-image .name,
|
|
154
|
+
.VPHero.has-image .text {
|
|
155
|
+
margin: 0;
|
|
98
156
|
}
|
|
99
157
|
}
|
|
100
158
|
|
|
101
159
|
.tagline {
|
|
102
160
|
padding-top: 16px;
|
|
161
|
+
max-width: 392px;
|
|
103
162
|
line-height: 28px;
|
|
104
163
|
font-size: 18px;
|
|
105
164
|
font-weight: 500;
|
|
106
165
|
color: var(--vp-c-text-2);
|
|
107
166
|
}
|
|
108
167
|
|
|
168
|
+
.VPHero.has-image .tagline {
|
|
169
|
+
margin: 0 auto;
|
|
170
|
+
}
|
|
171
|
+
|
|
109
172
|
@media (min-width: 640px) {
|
|
110
173
|
.tagline {
|
|
111
174
|
padding-top: 24px;
|
|
112
|
-
max-width:
|
|
175
|
+
max-width: 576px;
|
|
113
176
|
line-height: 32px;
|
|
114
177
|
font-size: 20px;
|
|
115
178
|
}
|
|
@@ -118,27 +181,105 @@ defineProps<{
|
|
|
118
181
|
@media (min-width: 960px) {
|
|
119
182
|
.tagline {
|
|
120
183
|
padding-top: 24px;
|
|
121
|
-
max-width: 640px;
|
|
122
184
|
line-height: 36px;
|
|
123
185
|
font-size: 24px;
|
|
124
186
|
}
|
|
187
|
+
|
|
188
|
+
.VPHero.has-image .tagline {
|
|
189
|
+
margin: 0;
|
|
190
|
+
}
|
|
125
191
|
}
|
|
126
192
|
|
|
127
193
|
.actions {
|
|
128
194
|
display: flex;
|
|
129
195
|
flex-wrap: wrap;
|
|
130
|
-
margin: -
|
|
196
|
+
margin: -6px;
|
|
131
197
|
padding-top: 24px;
|
|
132
198
|
}
|
|
133
199
|
|
|
200
|
+
.VPHero.has-image .actions {
|
|
201
|
+
justify-content: center;
|
|
202
|
+
}
|
|
203
|
+
|
|
134
204
|
@media (min-width: 640px) {
|
|
135
205
|
.actions {
|
|
136
206
|
padding-top: 32px;
|
|
137
207
|
}
|
|
138
208
|
}
|
|
139
209
|
|
|
210
|
+
@media (min-width: 960px) {
|
|
211
|
+
.VPHero.has-image .actions {
|
|
212
|
+
justify-content: flex-start;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
140
216
|
.action {
|
|
141
217
|
flex-shrink: 0;
|
|
142
|
-
padding:
|
|
218
|
+
padding: 6px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.image {
|
|
222
|
+
order: 1;
|
|
223
|
+
margin: -76px -24px -48px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media (min-width: 640px) {
|
|
227
|
+
.image {
|
|
228
|
+
margin: -108px -24px -48px;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.image-container {
|
|
233
|
+
position: relative;
|
|
234
|
+
margin: 0 auto;
|
|
235
|
+
width: 320px;
|
|
236
|
+
height: 320px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@media (min-width: 640px) {
|
|
240
|
+
.image-container {
|
|
241
|
+
width: 392px;
|
|
242
|
+
height: 392px;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.image-src {
|
|
247
|
+
position: absolute;
|
|
248
|
+
top: 50%;
|
|
249
|
+
left: 50%;
|
|
250
|
+
max-width: 392px;
|
|
251
|
+
transform: translate(-50%, -50%);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.image-src.light { opacity: 1; }
|
|
255
|
+
.image-src.dark { opacity: 0; }
|
|
256
|
+
|
|
257
|
+
.dark .image-src.light { opacity: 0; }
|
|
258
|
+
.dark .image-src.dark { opacity: 1; }
|
|
259
|
+
|
|
260
|
+
@media (min-width: 640px) {
|
|
261
|
+
.image-src {
|
|
262
|
+
max-width: 512px;
|
|
263
|
+
transform: translate(-50%, -50%);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@media (min-width: 960px) {
|
|
268
|
+
.image {
|
|
269
|
+
order: 2;
|
|
270
|
+
margin: -8px 0;
|
|
271
|
+
width: calc(100% / 3);
|
|
272
|
+
min-height: 100%;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.image-container {
|
|
276
|
+
width: 100%;
|
|
277
|
+
height: 100%;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.image-src {
|
|
281
|
+
max-width: 640px;
|
|
282
|
+
transform: translate(calc(-50% - 32px), calc(-50% - 32px));
|
|
283
|
+
}
|
|
143
284
|
}
|
|
144
285
|
</style>
|
|
@@ -3,13 +3,13 @@ import VPIconHeart from './icons/VPIconHeart.vue'
|
|
|
3
3
|
import VPButton from './VPButton.vue'
|
|
4
4
|
import VPSponsors from './VPSponsors.vue'
|
|
5
5
|
|
|
6
|
-
interface Sponsors {
|
|
6
|
+
export interface Sponsors {
|
|
7
7
|
tier: string
|
|
8
8
|
size?: 'medium' | 'big'
|
|
9
9
|
items: Sponsor[]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
interface Sponsor {
|
|
12
|
+
export interface Sponsor {
|
|
13
13
|
name: string
|
|
14
14
|
img: string
|
|
15
15
|
url: string
|
|
@@ -50,7 +50,7 @@ defineProps<{
|
|
|
50
50
|
.VPHomeSponsors {
|
|
51
51
|
border-top: 1px solid var(--vp-c-divider-light);
|
|
52
52
|
padding: 88px 24px 96px;
|
|
53
|
-
background-color: var(--vp-c-bg
|
|
53
|
+
background-color: var(--vp-c-bg);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.container {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import { normalizeLink } from '../support/utils'
|
|
3
4
|
import VPIconExternalLink from './icons/VPIconExternalLink.vue'
|
|
4
5
|
|
|
5
6
|
const props = defineProps<{
|
|
@@ -15,7 +16,7 @@ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
|
|
|
15
16
|
:is="href ? 'a' : 'span'"
|
|
16
17
|
class="VPLink"
|
|
17
18
|
:class="{ link: href }"
|
|
18
|
-
:href="href"
|
|
19
|
+
:href="href ? normalizeLink(href) : undefined"
|
|
19
20
|
:target="isExternal ? '_blank' : undefined"
|
|
20
21
|
:rel="isExternal ? 'noopener noreferrer' : undefined"
|
|
21
22
|
>
|
|
@@ -45,7 +45,7 @@ function scrollToTop() {
|
|
|
45
45
|
justify-content: space-between;
|
|
46
46
|
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
47
47
|
width: 100%;
|
|
48
|
-
background-color: var(--vp-c-bg
|
|
48
|
+
background-color: var(--vp-c-bg);
|
|
49
49
|
transition: border-color 0.5s, background-color 0.5s;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -22,32 +22,27 @@ defineProps<{
|
|
|
22
22
|
|
|
23
23
|
<style scoped>
|
|
24
24
|
.VPMenu {
|
|
25
|
-
border-radius:
|
|
26
|
-
padding: 12px
|
|
27
|
-
min-width:
|
|
28
|
-
border: 1px solid
|
|
29
|
-
background: var(--vp-c-bg);
|
|
25
|
+
border-radius: 12px;
|
|
26
|
+
padding: 12px;
|
|
27
|
+
min-width: 128px;
|
|
28
|
+
border: 1px solid var(--vp-c-divider-light);
|
|
29
|
+
background-color: var(--vp-c-bg);
|
|
30
30
|
box-shadow: var(--vp-shadow-3);
|
|
31
31
|
transition: background-color 0.5s;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.dark .VPMenu {
|
|
35
|
-
|
|
36
|
-
box-shadow: var(--vp-shadow-1);
|
|
37
|
-
border: 1px solid var(--vp-c-divider-light);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.VPMenu :deep(.items) {
|
|
41
|
-
transition: border-color .5s;
|
|
35
|
+
box-shadow: var(--vp-shadow-2);
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
.VPMenu :deep(.group) {
|
|
45
|
-
|
|
39
|
+
margin: 0 -12px;
|
|
40
|
+
padding: 0 12px 12px;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
.VPMenu :deep(.group + .group) {
|
|
49
44
|
border-top: 1px solid var(--vp-c-divider-light);
|
|
50
|
-
padding: 11px
|
|
45
|
+
padding: 11px 12px 12px;
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
.VPMenu :deep(.group:last-child) {
|
|
@@ -15,16 +15,22 @@ defineProps<{
|
|
|
15
15
|
<style scoped>
|
|
16
16
|
.VPMenuLink {
|
|
17
17
|
display: block;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
padding: 0 12px;
|
|
20
|
+
line-height: 32px;
|
|
21
|
+
font-size: 14px;
|
|
21
22
|
font-weight: 500;
|
|
22
23
|
color: var(--vp-c-text-1);
|
|
23
24
|
white-space: nowrap;
|
|
24
|
-
transition: color 0.25s;
|
|
25
|
+
transition: background-color 0.25s, color 0.25s;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.VPMenuLink:hover {
|
|
28
29
|
color: var(--vp-c-brand);
|
|
30
|
+
background-color: var(--vp-c-bg-mute);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dark .VPMenuLink:hover {
|
|
34
|
+
background-color: var(--vp-c-bg-soft);
|
|
29
35
|
}
|
|
30
36
|
</style>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { provide } from 'vue'
|
|
3
3
|
import { useNav } from '../composables/nav'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
4
5
|
import VPNavBar from './VPNavBar.vue'
|
|
5
6
|
import VPNavScreen from './VPNavScreen.vue'
|
|
6
7
|
|
|
7
8
|
const { isScreenOpen, closeScreen, toggleScreen } = useNav()
|
|
9
|
+
const { hasSidebar } = useSidebar()
|
|
8
10
|
|
|
9
11
|
provide('close-screen', closeScreen)
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<template>
|
|
13
|
-
<header class="VPNav">
|
|
15
|
+
<header class="VPNav" :class="{ 'no-sidebar' : !hasSidebar }">
|
|
14
16
|
<VPNavBar :is-screen-open="isScreenOpen" @toggle-screen="toggleScreen" />
|
|
15
17
|
<VPNavScreen :open="isScreenOpen" />
|
|
16
18
|
</header>
|
|
@@ -29,5 +31,20 @@ provide('close-screen', closeScreen)
|
|
|
29
31
|
.VPNav {
|
|
30
32
|
position: fixed;
|
|
31
33
|
}
|
|
34
|
+
|
|
35
|
+
.VPNav.no-sidebar {
|
|
36
|
+
backdrop-filter: saturate(50%) blur(8px);
|
|
37
|
+
-webkit-backdrop-filter: saturate(50%) blur(8px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
|
|
41
|
+
.VPNav.no-sidebar {
|
|
42
|
+
background: rgba(255, 255, 255, 0.95);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dark .VPNav.no-sidebar {
|
|
46
|
+
background: rgba(36, 36, 36, 0.95);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
32
49
|
}
|
|
33
50
|
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
+
import { useSidebar } from '../composables/sidebar'
|
|
2
3
|
import VPNavBarTitle from './VPNavBarTitle.vue'
|
|
3
4
|
import VPNavBarSearch from './VPNavBarSearch.vue'
|
|
4
5
|
import VPNavBarMenu from './VPNavBarMenu.vue'
|
|
@@ -15,10 +16,12 @@ defineProps<{
|
|
|
15
16
|
defineEmits<{
|
|
16
17
|
(e: 'toggle-screen'): void
|
|
17
18
|
}>()
|
|
19
|
+
|
|
20
|
+
const { hasSidebar } = useSidebar()
|
|
18
21
|
</script>
|
|
19
22
|
|
|
20
23
|
<template>
|
|
21
|
-
<div class="VPNavBar">
|
|
24
|
+
<div class="VPNavBar" :class="{ 'has-sidebar' : hasSidebar }">
|
|
22
25
|
<div class="container">
|
|
23
26
|
<VPNavBarTitle />
|
|
24
27
|
|
|
@@ -60,13 +63,28 @@ defineEmits<{
|
|
|
60
63
|
height: var(--vp-nav-height-desktop);
|
|
61
64
|
border-bottom: 0;
|
|
62
65
|
}
|
|
66
|
+
|
|
67
|
+
.VPNavBar.has-sidebar .content {
|
|
68
|
+
backdrop-filter: saturate(50%) blur(8px);
|
|
69
|
+
-webkit-backdrop-filter: saturate(50%) blur(8px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
|
|
73
|
+
.VPNavBar.has-sidebar.content {
|
|
74
|
+
background: rgba(255, 255, 255, 0.95);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dark .VPNavBar.has-sidebar .content {
|
|
78
|
+
background: rgba(36, 36, 36, 0.95);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
.container {
|
|
66
84
|
display: flex;
|
|
67
85
|
justify-content: space-between;
|
|
68
86
|
margin: 0 auto;
|
|
69
|
-
max-width: var(--vp-layout-max-width);
|
|
87
|
+
max-width: calc(var(--vp-layout-max-width) - 64px);
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
.content {
|
|
@@ -76,12 +94,6 @@ defineEmits<{
|
|
|
76
94
|
flex-grow: 1;
|
|
77
95
|
}
|
|
78
96
|
|
|
79
|
-
@media (min-width: 960px) {
|
|
80
|
-
.content {
|
|
81
|
-
backdrop-filter: saturate(50%) blur(8px);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
97
|
.menu + .translations::before,
|
|
86
98
|
.menu + .appearance::before,
|
|
87
99
|
.menu + .social-links::before,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { useData } from 'vitepress'
|
|
3
3
|
import VPFlyout from './VPFlyout.vue'
|
|
4
|
+
import VPMenuLink from './VPMenuLink.vue'
|
|
4
5
|
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
5
6
|
import VPSocialLinks from './VPSocialLinks.vue'
|
|
6
7
|
|
|
@@ -10,21 +11,15 @@ const { site, theme } = useData()
|
|
|
10
11
|
<template>
|
|
11
12
|
<VPFlyout class="VPNavBarExtra" label="extra navigation">
|
|
12
13
|
<div v-if="theme.localeLinks" class="group">
|
|
13
|
-
<
|
|
14
|
-
<p class="trans-title">
|
|
15
|
-
{{ theme.localeLinks.text }}
|
|
16
|
-
</p>
|
|
14
|
+
<p class="trans-title">{{ theme.localeLinks.text }}</p>
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</li>
|
|
22
|
-
</ul>
|
|
23
|
-
</div>
|
|
16
|
+
<template v-for="locale in theme.localeLinks.items" :key="locale.link">
|
|
17
|
+
<VPMenuLink :item="locale" />
|
|
18
|
+
</template>
|
|
24
19
|
</div>
|
|
25
20
|
|
|
26
21
|
<div v-if="site.appearance" class="group">
|
|
27
|
-
<div class="item">
|
|
22
|
+
<div class="item appearance">
|
|
28
23
|
<p class="label">Appearance</p>
|
|
29
24
|
<div class="appearance-action">
|
|
30
25
|
<VPSwitchAppearance />
|
|
@@ -33,8 +28,8 @@ const { site, theme } = useData()
|
|
|
33
28
|
</div>
|
|
34
29
|
|
|
35
30
|
<div v-if="theme.socialLinks" class="group">
|
|
36
|
-
<div class="item">
|
|
37
|
-
<VPSocialLinks class="social-links" :links="theme.socialLinks" />
|
|
31
|
+
<div class="item social-links">
|
|
32
|
+
<VPSocialLinks class="social-links-list" :links="theme.socialLinks" />
|
|
38
33
|
</div>
|
|
39
34
|
</div>
|
|
40
35
|
</VPFlyout>
|
|
@@ -58,50 +53,30 @@ const { site, theme } = useData()
|
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
|
|
61
|
-
.trans {
|
|
62
|
-
padding: 2px 16px 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
56
|
.trans-title {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
font-size:
|
|
69
|
-
font-weight:
|
|
70
|
-
color: var(--vp-c-text-1);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.trans-icon {
|
|
74
|
-
margin-right: 12px;
|
|
75
|
-
width: 16px;
|
|
76
|
-
height: 16px;
|
|
77
|
-
fill: currentColor;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.trans-list {
|
|
81
|
-
padding: 2px 0 0 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.trans-link {
|
|
85
|
-
line-height: 28px;
|
|
86
|
-
font-size: 13px;
|
|
57
|
+
padding: 0 24px 0 12px;
|
|
58
|
+
line-height: 32px;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
font-weight: 700;
|
|
87
61
|
color: var(--vp-c-text-1);
|
|
88
|
-
transition: color 0.25s;
|
|
89
62
|
}
|
|
90
63
|
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.item {
|
|
64
|
+
.item.appearance,
|
|
65
|
+
.item.social-links {
|
|
96
66
|
display: flex;
|
|
97
67
|
align-items: center;
|
|
68
|
+
padding: 0 12px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.item.appearance {
|
|
72
|
+
min-width: 176px;
|
|
98
73
|
}
|
|
99
74
|
|
|
100
75
|
.appearance-action {
|
|
101
76
|
margin-right: -2px;
|
|
102
77
|
}
|
|
103
78
|
|
|
104
|
-
.social-links {
|
|
79
|
+
.social-links-list {
|
|
105
80
|
margin: -4px -8px;
|
|
106
81
|
}
|
|
107
82
|
</style>
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { DefaultTheme
|
|
3
|
-
import { isActive } from '../support/utils'
|
|
2
|
+
import { DefaultTheme } from '../config'
|
|
4
3
|
import VPFlyout from './VPFlyout.vue'
|
|
5
4
|
|
|
6
5
|
defineProps<{
|
|
7
6
|
item: DefaultTheme.NavItemWithChildren
|
|
8
7
|
}>()
|
|
9
|
-
|
|
10
|
-
const { page } = useData()
|
|
11
8
|
</script>
|
|
12
9
|
|
|
13
10
|
<template>
|
|
14
|
-
<VPFlyout
|
|
15
|
-
:button="item.text"
|
|
16
|
-
:items="item.items"
|
|
17
|
-
/>
|
|
11
|
+
<VPFlyout :button="item.text" :items="item.items" />
|
|
18
12
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
3
|
import { isActive } from '../support/utils'
|
|
4
|
-
import {
|
|
4
|
+
import { DefaultTheme } from '../config'
|
|
5
5
|
import VPLink from './VPLink.vue'
|
|
6
6
|
|
|
7
7
|
defineProps<{
|
|
@@ -34,7 +34,7 @@ const { page } = useData()
|
|
|
34
34
|
align-items: center;
|
|
35
35
|
padding: 0 12px;
|
|
36
36
|
line-height: var(--vp-nav-height-mobile);
|
|
37
|
-
font-size:
|
|
37
|
+
font-size: 14px;
|
|
38
38
|
font-weight: 500;
|
|
39
39
|
color: var(--vp-c-text-1);
|
|
40
40
|
transition: color 0.25s;
|