@vuepress/theme-default 2.0.0-rc.33 → 2.0.0-rc.35
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/lib/client/components/VPDarkIcon.vue +8 -0
- package/lib/client/components/{DropdownTransition.vue → VPDropdownTransition.vue} +10 -1
- package/lib/client/components/VPEditIcon.vue +12 -0
- package/lib/client/components/VPHome.vue +38 -0
- package/lib/client/components/VPHomeFeatures.vue +68 -0
- package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +16 -2
- package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +107 -5
- package/lib/client/components/VPLightIcon.vue +28 -0
- package/lib/client/components/VPNavbar.vue +127 -0
- package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +36 -4
- package/lib/client/components/VPNavbarDropdown.vue +319 -0
- package/lib/client/components/VPNavbarItems.vue +110 -0
- package/lib/client/components/VPPage.vue +66 -0
- package/lib/client/components/VPPageMeta.vue +132 -0
- package/lib/client/components/VPPageNav.vue +118 -0
- package/lib/client/components/VPSidebar.vue +112 -0
- package/lib/client/components/VPSidebarItem.vue +169 -0
- package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +30 -6
- package/lib/client/components/VPToggleColorModeButton.vue +54 -0
- package/lib/client/components/VPToggleSidebarButton.vue +92 -0
- package/lib/client/components/global/Badge.vue +60 -18
- package/lib/client/components/global/CodeGroup.d.ts +1 -0
- package/lib/client/components/global/CodeGroup.js +4 -3
- package/lib/client/components/global/CodeGroupItem.vue +5 -16
- package/lib/client/composables/index.d.ts +4 -0
- package/lib/client/composables/index.js +4 -0
- package/lib/client/composables/useContributors.d.ts +3 -0
- package/lib/client/composables/useContributors.js +14 -0
- package/lib/client/composables/useDarkMode.js +1 -1
- package/lib/client/composables/useEditLink.d.ts +3 -0
- package/lib/client/composables/useEditLink.js +31 -0
- package/lib/client/composables/useLastUpdated.d.ts +2 -0
- package/lib/client/composables/useLastUpdated.js +17 -0
- package/lib/client/composables/useNavbarConfig.d.ts +2 -2
- package/lib/client/composables/useNavbarConfig.js +1 -1
- package/lib/client/composables/useNavbarRepo.d.ts +2 -2
- package/lib/client/composables/useNavbarRepo.js +1 -1
- package/lib/client/composables/useNavbarSelectLanguage.d.ts +2 -2
- package/lib/client/composables/useNavbarSelectLanguage.js +2 -2
- package/lib/client/composables/useNavigate.js +4 -7
- package/lib/client/composables/useRelatedLinks.d.ts +8 -0
- package/lib/client/composables/useRelatedLinks.js +91 -0
- package/lib/client/composables/useSidebarItems.d.ts +10 -9
- package/lib/client/composables/useSidebarItems.js +14 -14
- package/lib/client/config.js +4 -2
- package/lib/client/index.d.ts +1 -0
- package/lib/client/index.js +1 -0
- package/lib/client/layouts/Layout.vue +111 -18
- package/lib/client/layouts/NotFound.vue +1 -1
- package/lib/client/styles/_mixins.scss +4 -4
- package/lib/client/styles/_variables.module.scss +1 -1
- package/lib/client/styles/_variables.scss +1 -0
- package/lib/client/styles/code-group.scss +32 -29
- package/lib/client/styles/{code.scss → content/code.scss} +55 -31
- package/lib/client/styles/{custom-container.scss → content/custom-container.scss} +9 -5
- package/lib/client/styles/content/index.scss +4 -0
- package/lib/client/styles/content/normalize.scss +39 -0
- package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
- package/lib/client/styles/external-link-icon.scss +7 -3
- package/lib/client/styles/index.scss +2 -13
- package/lib/client/styles/layout.scss +3 -203
- package/lib/client/styles/normalize.scss +4 -3
- package/lib/client/styles/plugins.scss +20 -0
- package/lib/client/styles/vars-dark.scss +17 -16
- package/lib/client/styles/vars.scss +19 -23
- package/lib/client/typings.d.ts +13 -0
- package/lib/client/typings.js +1 -0
- package/lib/client/utils/getAutoLink.d.ts +9 -0
- package/lib/client/utils/{getNavLink.js → getAutoLink.js} +2 -2
- package/lib/client/utils/index.d.ts +1 -1
- package/lib/client/utils/index.js +1 -1
- package/lib/client/utils/isActiveSidebarItem.d.ts +2 -2
- package/lib/client/utils/isActiveSidebarItem.js +3 -3
- package/lib/node/defaultTheme.js +9 -1
- package/lib/node/utils/assignDefaultLocaleOptions.js +1 -1
- package/lib/shared/index.d.ts +2 -0
- package/lib/shared/index.js +2 -0
- package/lib/shared/nav.d.ts +21 -30
- package/lib/shared/navbar.d.ts +21 -0
- package/lib/shared/navbar.js +1 -0
- package/lib/shared/options.d.ts +6 -5
- package/lib/shared/page.d.ts +2 -2
- package/lib/shared/sidebar.d.ts +26 -0
- package/lib/shared/sidebar.js +1 -0
- package/package.json +18 -18
- package/templates/build.html +2 -0
- package/lib/client/components/Home.vue +0 -15
- package/lib/client/components/HomeContent.vue +0 -5
- package/lib/client/components/HomeFeatures.vue +0 -22
- package/lib/client/components/Navbar.vue +0 -80
- package/lib/client/components/NavbarDropdown.vue +0 -125
- package/lib/client/components/NavbarItems.vue +0 -51
- package/lib/client/components/Page.vue +0 -31
- package/lib/client/components/PageMeta.vue +0 -220
- package/lib/client/components/PageNav.vue +0 -228
- package/lib/client/components/Sidebar.vue +0 -18
- package/lib/client/components/SidebarItem.vue +0 -86
- package/lib/client/components/ToggleColorModeButton.vue +0 -57
- package/lib/client/components/ToggleSidebarButton.vue +0 -24
- package/lib/client/styles/badge.scss +0 -36
- package/lib/client/styles/home.scss +0 -168
- package/lib/client/styles/navbar-dropdown.scss +0 -177
- package/lib/client/styles/navbar.scss +0 -197
- package/lib/client/styles/page.scss +0 -11
- package/lib/client/styles/sidebar.scss +0 -128
- package/lib/client/styles/transitions.scss +0 -22
- package/lib/client/utils/getNavLink.d.ts +0 -9
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { useScrollPromise } from '@theme/useScrollPromise'
|
|
3
|
+
import { useSidebarItems } from '@theme/useSidebarItems'
|
|
4
|
+
import { useThemeLocaleData } from '@theme/useThemeData'
|
|
5
|
+
import VPHome from '@theme/VPHome.vue'
|
|
6
|
+
import VPNavbar from '@theme/VPNavbar.vue'
|
|
7
|
+
import VPPage from '@theme/VPPage.vue'
|
|
8
|
+
import VPSidebar from '@theme/VPSidebar.vue'
|
|
6
9
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
7
10
|
import { usePageData, usePageFrontmatter, useRouter } from 'vuepress/client'
|
|
8
11
|
import type { DefaultThemePageFrontmatter } from '../../shared/index.js'
|
|
9
|
-
import {
|
|
10
|
-
useScrollPromise,
|
|
11
|
-
useSidebarItems,
|
|
12
|
-
useThemeLocaleData,
|
|
13
|
-
} from '../composables/index.js'
|
|
14
12
|
|
|
15
13
|
defineSlots<{
|
|
16
14
|
'navbar'?: (props: Record<never, never>) => any
|
|
@@ -98,37 +96,37 @@ const onBeforeLeave = scrollPromise.pending
|
|
|
98
96
|
|
|
99
97
|
<template>
|
|
100
98
|
<div
|
|
101
|
-
class="theme-container"
|
|
99
|
+
class="vp-theme-container"
|
|
102
100
|
:class="containerClass"
|
|
103
101
|
@touchstart="onTouchStart"
|
|
104
102
|
@touchend="onTouchEnd"
|
|
105
103
|
>
|
|
106
104
|
<slot name="navbar">
|
|
107
|
-
<
|
|
105
|
+
<VPNavbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
|
|
108
106
|
<template #before>
|
|
109
107
|
<slot name="navbar-before" />
|
|
110
108
|
</template>
|
|
111
109
|
<template #after>
|
|
112
110
|
<slot name="navbar-after" />
|
|
113
111
|
</template>
|
|
114
|
-
</
|
|
112
|
+
</VPNavbar>
|
|
115
113
|
</slot>
|
|
116
114
|
|
|
117
|
-
<div class="sidebar-mask" @click="toggleSidebar(false)" />
|
|
115
|
+
<div class="vp-sidebar-mask" @click="toggleSidebar(false)" />
|
|
118
116
|
|
|
119
117
|
<slot name="sidebar">
|
|
120
|
-
<
|
|
118
|
+
<VPSidebar>
|
|
121
119
|
<template #top>
|
|
122
120
|
<slot name="sidebar-top" />
|
|
123
121
|
</template>
|
|
124
122
|
<template #bottom>
|
|
125
123
|
<slot name="sidebar-bottom" />
|
|
126
124
|
</template>
|
|
127
|
-
</
|
|
125
|
+
</VPSidebar>
|
|
128
126
|
</slot>
|
|
129
127
|
|
|
130
128
|
<slot name="page">
|
|
131
|
-
<
|
|
129
|
+
<VPHome v-if="frontmatter.home" />
|
|
132
130
|
|
|
133
131
|
<Transition
|
|
134
132
|
v-else
|
|
@@ -137,7 +135,7 @@ const onBeforeLeave = scrollPromise.pending
|
|
|
137
135
|
@before-enter="onBeforeEnter"
|
|
138
136
|
@before-leave="onBeforeLeave"
|
|
139
137
|
>
|
|
140
|
-
<
|
|
138
|
+
<VPPage :key="page.path">
|
|
141
139
|
<template #top>
|
|
142
140
|
<slot name="page-top" />
|
|
143
141
|
</template>
|
|
@@ -150,8 +148,103 @@ const onBeforeLeave = scrollPromise.pending
|
|
|
150
148
|
<template #bottom>
|
|
151
149
|
<slot name="page-bottom" />
|
|
152
150
|
</template>
|
|
153
|
-
</
|
|
151
|
+
</VPPage>
|
|
154
152
|
</Transition>
|
|
155
153
|
</slot>
|
|
156
154
|
</div>
|
|
157
155
|
</template>
|
|
156
|
+
|
|
157
|
+
<style lang="scss">
|
|
158
|
+
@import '../styles/variables';
|
|
159
|
+
|
|
160
|
+
.vp-sidebar-mask {
|
|
161
|
+
position: fixed;
|
|
162
|
+
top: 0;
|
|
163
|
+
left: 0;
|
|
164
|
+
z-index: 9;
|
|
165
|
+
|
|
166
|
+
display: none;
|
|
167
|
+
|
|
168
|
+
width: 100vw;
|
|
169
|
+
height: 100vh;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.vp-theme-container {
|
|
173
|
+
// navbar is disabled
|
|
174
|
+
&.no-navbar {
|
|
175
|
+
.vp-sidebar {
|
|
176
|
+
top: 0;
|
|
177
|
+
|
|
178
|
+
@media (max-width: $MQMobile) {
|
|
179
|
+
padding-top: 0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.vp-page {
|
|
184
|
+
padding-top: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// adjust heading margin and padding;
|
|
188
|
+
.theme-default-content {
|
|
189
|
+
h1,
|
|
190
|
+
h2,
|
|
191
|
+
h3,
|
|
192
|
+
h4,
|
|
193
|
+
h5,
|
|
194
|
+
h6 {
|
|
195
|
+
margin-top: 1.5rem;
|
|
196
|
+
padding-top: 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&.no-sidebar {
|
|
202
|
+
// hide sidebar
|
|
203
|
+
.vp-sidebar {
|
|
204
|
+
display: none;
|
|
205
|
+
|
|
206
|
+
// show sidebar on mobile because it has navbar links
|
|
207
|
+
@media (max-width: $MQMobile) {
|
|
208
|
+
display: block;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.vp-page {
|
|
213
|
+
padding-left: 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.sidebar-open {
|
|
218
|
+
@media (max-width: $MQMobile) {
|
|
219
|
+
// show sidebar
|
|
220
|
+
.vp-sidebar {
|
|
221
|
+
transform: translateX(0);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// show sidebar mask
|
|
225
|
+
.vp-sidebar-mask {
|
|
226
|
+
display: block;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* fade-slide-y transition
|
|
234
|
+
*/
|
|
235
|
+
.fade-slide-y {
|
|
236
|
+
&-enter-active {
|
|
237
|
+
transition: all 0.2s ease;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&-leave-active {
|
|
241
|
+
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&-enter-from,
|
|
245
|
+
&-leave-to {
|
|
246
|
+
opacity: 0;
|
|
247
|
+
transform: translateY(10px);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useThemeLocaleData } from '@theme/useThemeData'
|
|
2
3
|
import { RouteLink, useRouteLocale } from 'vuepress/client'
|
|
3
|
-
import { useThemeLocaleData } from '../composables/index.js'
|
|
4
4
|
|
|
5
5
|
const routeLocale = useRouteLocale()
|
|
6
6
|
const themeLocale = useThemeLocaleData()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import 'variables';
|
|
2
2
|
|
|
3
|
-
@mixin
|
|
3
|
+
@mixin content-wrapper {
|
|
4
4
|
max-width: var(--content-width);
|
|
5
5
|
margin: 0 auto;
|
|
6
6
|
padding: 2rem 2.5rem;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@mixin
|
|
18
|
-
transition: height 0.1s ease-out;
|
|
17
|
+
@mixin dropdown-wrapper {
|
|
19
18
|
overflow: hidden;
|
|
19
|
+
transition: height 0.1s ease-out;
|
|
20
20
|
}
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import 'variables';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* code-group
|
|
5
5
|
*/
|
|
6
|
-
.code-
|
|
6
|
+
.code-group-nav {
|
|
7
7
|
margin-top: 0.85rem;
|
|
8
|
+
|
|
8
9
|
// 2 * margin + border-radius of <pre> tag
|
|
9
10
|
margin-bottom: calc(-1.7rem - 6px);
|
|
11
|
+
padding-top: 10px;
|
|
10
12
|
padding-bottom: calc(1.7rem - 6px);
|
|
11
13
|
padding-left: 10px;
|
|
12
|
-
padding-top: 10px;
|
|
13
14
|
border-top-left-radius: 6px;
|
|
14
15
|
border-top-right-radius: 6px;
|
|
16
|
+
|
|
15
17
|
background-color: var(--c-code-group-tab-bg);
|
|
18
|
+
|
|
19
|
+
@media (max-width: $MQMobileNarrow) {
|
|
20
|
+
margin-right: -1.5rem;
|
|
21
|
+
margin-left: -1.5rem;
|
|
22
|
+
border-radius: 0;
|
|
23
|
+
}
|
|
16
24
|
}
|
|
17
25
|
|
|
18
|
-
.code-
|
|
19
|
-
border: 0;
|
|
26
|
+
.code-group-nav-tab {
|
|
20
27
|
padding: 5px;
|
|
21
|
-
|
|
28
|
+
border: 0;
|
|
29
|
+
|
|
22
30
|
background-color: transparent;
|
|
23
|
-
font-size: 0.85em;
|
|
24
|
-
line-height: 1.4;
|
|
25
31
|
color: var(--c-code-group-tab-title);
|
|
32
|
+
|
|
26
33
|
font-weight: 600;
|
|
27
|
-
|
|
34
|
+
font-size: 0.85em;
|
|
35
|
+
line-height: 1.4;
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
outline: none;
|
|
31
|
-
}
|
|
37
|
+
cursor: pointer;
|
|
32
38
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
39
|
+
&:focus {
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
43
|
+
&:focus-visible {
|
|
44
|
+
outline: 1px solid var(--c-code-group-tab-outline);
|
|
45
|
+
}
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
margin-left: -1.5rem;
|
|
44
|
-
margin-right: -1.5rem;
|
|
45
|
-
border-radius: 0;
|
|
47
|
+
&.active {
|
|
48
|
+
border-bottom: var(--c-code-group-tab-active-border) 1px solid;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -51,12 +54,12 @@
|
|
|
51
54
|
*/
|
|
52
55
|
.code-group-item {
|
|
53
56
|
display: none;
|
|
54
|
-
}
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
58
|
+
&.active {
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
> pre {
|
|
63
|
+
background-color: #ffa500;
|
|
64
|
+
}
|
|
62
65
|
}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
2
|
+
/* stylelint-disable scss/comment-no-empty */
|
|
3
|
+
@import '../variables';
|
|
2
4
|
|
|
3
5
|
// the original font-size is 14px, 1.7 will make line-height be 23.8px
|
|
4
6
|
$line-height: 1.7;
|
|
5
7
|
|
|
6
8
|
pre[class*='language-'] {
|
|
7
|
-
|
|
8
|
-
font-size: 1em;
|
|
9
|
-
line-height: 1.5;
|
|
9
|
+
overflow: auto;
|
|
10
10
|
|
|
11
11
|
margin: 0.5em 0;
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
font-size: 1em;
|
|
14
|
+
font-family: var(--font-family-code);
|
|
15
|
+
line-height: 1.5;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
// ===============================
|
|
16
19
|
// Forked and modified from prismjs/themes/prism-tomorrow.css
|
|
17
20
|
|
|
18
21
|
pre[class*='language-'] {
|
|
19
|
-
color: #ccc;
|
|
20
22
|
background: #2d2d2d;
|
|
23
|
+
color: #ccc;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
.token.comment,
|
|
@@ -82,6 +85,7 @@ pre[class*='language-'] {
|
|
|
82
85
|
.token.bold {
|
|
83
86
|
font-weight: bold;
|
|
84
87
|
}
|
|
88
|
+
|
|
85
89
|
.token.italic {
|
|
86
90
|
font-style: italic;
|
|
87
91
|
}
|
|
@@ -99,21 +103,26 @@ pre[class*='language-'] {
|
|
|
99
103
|
.theme-default-content {
|
|
100
104
|
pre,
|
|
101
105
|
pre[class*='language-'] {
|
|
102
|
-
|
|
106
|
+
overflow: auto;
|
|
103
107
|
margin: 0.85rem 0;
|
|
104
108
|
border-radius: 6px;
|
|
105
|
-
|
|
109
|
+
line-height: $line-height;
|
|
106
110
|
|
|
107
111
|
code {
|
|
108
|
-
box-sizing: border-box;
|
|
109
|
-
color: #fff;
|
|
110
|
-
padding: 1.3rem 1.5rem;
|
|
111
112
|
display: block;
|
|
113
|
+
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
|
|
112
116
|
width: fit-content;
|
|
113
117
|
min-width: 100%;
|
|
114
|
-
|
|
118
|
+
padding: 1.3rem 1.5rem;
|
|
115
119
|
border-radius: 0;
|
|
120
|
+
|
|
121
|
+
background-color: transparent !important;
|
|
122
|
+
color: #fff;
|
|
123
|
+
|
|
116
124
|
overflow-wrap: unset;
|
|
125
|
+
|
|
117
126
|
-webkit-font-smoothing: auto;
|
|
118
127
|
-moz-osx-font-smoothing: auto;
|
|
119
128
|
}
|
|
@@ -126,25 +135,29 @@ pre[class*='language-'] {
|
|
|
126
135
|
|
|
127
136
|
div[class*='language-'] {
|
|
128
137
|
position: relative;
|
|
129
|
-
background-color: var(--code-bg-color);
|
|
130
138
|
border-radius: 6px;
|
|
139
|
+
background-color: var(--code-bg-color);
|
|
131
140
|
|
|
132
141
|
&::before {
|
|
133
142
|
content: attr(data-title);
|
|
143
|
+
|
|
134
144
|
position: absolute;
|
|
135
|
-
z-index: 3;
|
|
136
145
|
top: 0.8em;
|
|
137
146
|
right: 1em;
|
|
138
|
-
|
|
147
|
+
z-index: 3;
|
|
148
|
+
|
|
139
149
|
color: var(--code-ln-color);
|
|
150
|
+
|
|
151
|
+
font-size: 0.75rem;
|
|
140
152
|
}
|
|
141
153
|
|
|
142
154
|
pre,
|
|
143
155
|
pre[class*='language-'] {
|
|
144
|
-
// force override the background color to be compatible with shiki
|
|
145
|
-
background: transparent !important;
|
|
146
156
|
position: relative;
|
|
147
157
|
z-index: 1;
|
|
158
|
+
|
|
159
|
+
// force override the background color to be compatible with shiki
|
|
160
|
+
background: transparent !important;
|
|
148
161
|
}
|
|
149
162
|
|
|
150
163
|
&:not(.line-numbers-mode) {
|
|
@@ -155,8 +168,8 @@ div[class*='language-'] {
|
|
|
155
168
|
|
|
156
169
|
&.line-numbers-mode {
|
|
157
170
|
pre {
|
|
158
|
-
margin-left: var(--code-ln-wrapper-width);
|
|
159
171
|
vertical-align: middle;
|
|
172
|
+
margin-left: var(--code-ln-wrapper-width);
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
code {
|
|
@@ -166,35 +179,41 @@ div[class*='language-'] {
|
|
|
166
179
|
.line-numbers {
|
|
167
180
|
position: absolute;
|
|
168
181
|
top: 0;
|
|
182
|
+
|
|
169
183
|
width: var(--code-ln-wrapper-width);
|
|
170
|
-
text-align: center;
|
|
171
|
-
color: var(--code-ln-color);
|
|
172
184
|
padding-top: 1.3rem;
|
|
185
|
+
|
|
186
|
+
color: var(--code-ln-color);
|
|
187
|
+
|
|
173
188
|
font-size: 0.875em;
|
|
174
189
|
line-height: $line-height;
|
|
175
190
|
counter-reset: line-number;
|
|
191
|
+
text-align: center;
|
|
176
192
|
|
|
177
193
|
.line-number {
|
|
178
194
|
position: relative;
|
|
179
195
|
z-index: 3;
|
|
180
196
|
user-select: none;
|
|
181
197
|
|
|
198
|
+
/* stylelint-disable-next-line max-nesting-depth */
|
|
182
199
|
&::before {
|
|
183
|
-
counter-increment: line-number;
|
|
184
200
|
content: counter(line-number);
|
|
201
|
+
counter-increment: line-number;
|
|
185
202
|
}
|
|
186
203
|
}
|
|
187
204
|
}
|
|
188
205
|
|
|
189
206
|
&::after {
|
|
190
207
|
content: '';
|
|
208
|
+
|
|
191
209
|
position: absolute;
|
|
192
210
|
top: 0;
|
|
193
211
|
left: 0;
|
|
212
|
+
|
|
194
213
|
width: var(--code-ln-wrapper-width);
|
|
195
214
|
height: 100%;
|
|
196
|
-
border-radius: 6px 0 0 6px;
|
|
197
215
|
border-right: 1px solid var(--code-hl-bg-color);
|
|
216
|
+
border-radius: 6px 0 0 6px;
|
|
198
217
|
}
|
|
199
218
|
}
|
|
200
219
|
}
|
|
@@ -236,12 +255,15 @@ div[class*='language-'] {
|
|
|
236
255
|
// - `// [\!code warning:3]`
|
|
237
256
|
// - `// [\!code error:3]`
|
|
238
257
|
.line.highlighted {
|
|
239
|
-
|
|
240
|
-
|
|
258
|
+
display: inline-block;
|
|
259
|
+
|
|
260
|
+
width: 100%;
|
|
241
261
|
margin: 0 -24px;
|
|
242
262
|
padding: 0 24px;
|
|
243
|
-
|
|
244
|
-
|
|
263
|
+
|
|
264
|
+
background-color: var(--code-hl-bg-color);
|
|
265
|
+
|
|
266
|
+
transition: background-color 0.5s;
|
|
245
267
|
|
|
246
268
|
&.error {
|
|
247
269
|
background-color: var(--code-hl-error-bg-color);
|
|
@@ -257,11 +279,13 @@ div[class*='language-'] {
|
|
|
257
279
|
// - class="diff add": `// [\!code ++]` or `// [\!code ++:3]`
|
|
258
280
|
// - class="diff remove": `// [\!code --]` or `// [\!code --:3]`
|
|
259
281
|
.line.diff {
|
|
260
|
-
|
|
282
|
+
display: inline-block;
|
|
283
|
+
|
|
284
|
+
width: 100%;
|
|
261
285
|
margin: 0 -24px;
|
|
262
286
|
padding: 0 24px;
|
|
263
|
-
|
|
264
|
-
|
|
287
|
+
|
|
288
|
+
transition: background-color 0.5s;
|
|
265
289
|
|
|
266
290
|
&::before {
|
|
267
291
|
position: absolute;
|
|
@@ -293,16 +317,16 @@ div[class*='language-'] {
|
|
|
293
317
|
// - `// [\!code focus]`
|
|
294
318
|
// - `// [\!code focus:3]`
|
|
295
319
|
.has-focused-lines .line:not(.has-focus) {
|
|
296
|
-
filter: blur(0.095rem);
|
|
297
320
|
opacity: 0.7;
|
|
321
|
+
filter: blur(0.095rem);
|
|
298
322
|
transition:
|
|
299
323
|
filter 0.35s,
|
|
300
324
|
opacity 0.35s;
|
|
301
325
|
}
|
|
302
326
|
|
|
303
327
|
&:hover .has-focused-lines .line:not(.has-focus) {
|
|
304
|
-
filter: blur(0);
|
|
305
328
|
opacity: 1;
|
|
329
|
+
filter: blur(0);
|
|
306
330
|
}
|
|
307
331
|
}
|
|
308
332
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
.custom-container-title {
|
|
8
8
|
font-weight: 600;
|
|
9
|
+
|
|
9
10
|
&:not(:only-child) {
|
|
10
11
|
margin-bottom: -0.4rem;
|
|
11
12
|
}
|
|
@@ -14,10 +15,10 @@
|
|
|
14
15
|
&.tip,
|
|
15
16
|
&.warning,
|
|
16
17
|
&.danger {
|
|
18
|
+
margin: 1rem 0;
|
|
17
19
|
padding: 0.1rem 1.5rem;
|
|
18
20
|
border-left-width: 0.5rem;
|
|
19
21
|
border-left-style: solid;
|
|
20
|
-
margin: 1rem 0;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
&.tip {
|
|
@@ -59,8 +60,8 @@
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
code {
|
|
62
|
-
color: var(--c-warning-text-light);
|
|
63
63
|
background-color: var(--c-warning-bg-light);
|
|
64
|
+
color: var(--c-warning-text-light);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
details {
|
|
@@ -93,8 +94,8 @@
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
code {
|
|
96
|
-
color: var(--c-danger-text-light);
|
|
97
97
|
background-color: var(--c-danger-bg-light);
|
|
98
|
+
color: var(--c-danger-text-light);
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
details {
|
|
@@ -107,11 +108,14 @@
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
&.details {
|
|
110
|
-
display: block;
|
|
111
111
|
position: relative;
|
|
112
|
-
|
|
112
|
+
|
|
113
|
+
display: block;
|
|
114
|
+
|
|
113
115
|
margin: 1.6em 0;
|
|
114
116
|
padding: 1.6em;
|
|
117
|
+
border-radius: 2px;
|
|
118
|
+
|
|
115
119
|
background-color: var(--c-details-bg);
|
|
116
120
|
|
|
117
121
|
code {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@import '../variables';
|
|
2
|
+
|
|
3
|
+
.theme-default-content {
|
|
4
|
+
h1,
|
|
5
|
+
h2,
|
|
6
|
+
h3,
|
|
7
|
+
h4,
|
|
8
|
+
h5,
|
|
9
|
+
h6 {
|
|
10
|
+
margin-top: calc(0.5rem - var(--navbar-height));
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
padding-top: calc(1rem + var(--navbar-height));
|
|
13
|
+
|
|
14
|
+
&:first-child {
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
|
|
17
|
+
+ p,
|
|
18
|
+
+ pre,
|
|
19
|
+
+ .custom-container {
|
|
20
|
+
margin-top: 2rem;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
h1 {
|
|
26
|
+
// narrow mobile
|
|
27
|
+
@media (max-width: $MQMobileNarrow) {
|
|
28
|
+
font-size: 1.9rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
a:not(.header-anchor) {
|
|
33
|
+
text-decoration: underline;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
img {
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
@mixin external-link-icon {
|
|
2
2
|
&::after {
|
|
3
3
|
content: '';
|
|
4
|
+
|
|
4
5
|
display: inline-block;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
|
|
7
8
|
width: 11px;
|
|
8
9
|
height: 11px;
|
|
10
|
+
margin-top: -1px;
|
|
11
|
+
margin-left: 4px;
|
|
12
|
+
|
|
9
13
|
background: var(--external-link-icon-color);
|
|
10
|
-
|
|
14
|
+
|
|
11
15
|
-webkit-mask-image: var(--external-link-icon);
|
|
12
16
|
mask-image: var(--external-link-icon);
|
|
13
17
|
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
@use 'vars';
|
|
2
2
|
@use 'vars-dark';
|
|
3
3
|
@use 'normalize';
|
|
4
|
-
|
|
4
|
+
@use 'content';
|
|
5
5
|
@use 'arrow';
|
|
6
|
-
@use 'badge';
|
|
7
|
-
@use 'code';
|
|
8
|
-
@use 'code-group';
|
|
9
|
-
@use 'custom-container';
|
|
10
6
|
@use 'external-link-icon';
|
|
11
|
-
@use 'home';
|
|
12
7
|
@use 'layout';
|
|
13
|
-
@use '
|
|
14
|
-
@use 'navbar-dropdown';
|
|
15
|
-
@use 'page';
|
|
16
|
-
@use 'sidebar';
|
|
17
|
-
@use 'toc';
|
|
18
|
-
@use 'transitions';
|
|
19
|
-
|
|
8
|
+
@use 'plugins';
|
|
20
9
|
@use '@vuepress/plugin-palette/style';
|