@vuepress/theme-default 2.0.0-beta.6 → 2.0.0-beta.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.
- package/lib/client/components/AutoLink.vue +114 -0
- package/lib/client/components/DropdownTransition.vue +21 -0
- package/lib/client/components/Home.vue +15 -0
- package/lib/client/components/HomeContent.vue +5 -0
- package/lib/client/components/HomeFeatures.vue +23 -0
- package/lib/client/components/HomeFooter.vue +17 -0
- package/lib/client/components/HomeHero.vue +98 -0
- package/lib/client/components/Navbar.vue +75 -0
- package/lib/client/components/NavbarBrand.vue +55 -0
- package/lib/client/components/NavbarDropdown.vue +126 -0
- package/lib/{components/NavbarLinks.vue → client/components/NavbarItems.vue} +61 -50
- package/lib/{components → client/components}/Page.vue +9 -15
- package/lib/{components → client/components}/PageMeta.vue +51 -66
- package/lib/{components → client/components}/PageNav.vue +44 -57
- package/lib/client/components/Sidebar.vue +13 -0
- package/lib/client/components/SidebarItem.vue +87 -0
- package/lib/client/components/SidebarItems.vue +57 -0
- package/lib/client/components/ToggleColorModeButton.vue +57 -0
- package/lib/client/components/ToggleSidebarButton.vue +24 -0
- package/lib/client/components/global/Badge.vue +31 -0
- package/lib/client/components/global/CodeGroup.d.ts +4 -0
- package/lib/client/components/global/CodeGroup.js +106 -0
- package/lib/client/components/global/CodeGroupItem.vue +31 -0
- package/lib/client/components/global/index.d.ts +4 -0
- package/lib/client/components/global/index.js +4 -0
- package/lib/client/composables/index.d.ts +6 -0
- package/lib/client/composables/index.js +6 -0
- package/lib/client/composables/useDarkMode.d.ts +12 -0
- package/lib/client/composables/useDarkMode.js +57 -0
- package/lib/{composables → client/composables}/useNavLink.d.ts +6 -1
- package/lib/{composables → client/composables}/useNavLink.js +5 -2
- package/lib/{composables → client/composables}/useResolveRouteWithRedirect.d.ts +1 -1
- package/lib/{composables → client/composables}/useResolveRouteWithRedirect.js +2 -2
- package/lib/{composables → client/composables}/useScrollPromise.d.ts +0 -0
- package/lib/{composables → client/composables}/useScrollPromise.js +1 -1
- package/lib/client/composables/useSidebarItems.d.ts +36 -0
- package/lib/client/composables/useSidebarItems.js +118 -0
- package/lib/{composables → client/composables}/useThemeData.d.ts +2 -2
- package/lib/{composables → client/composables}/useThemeData.js +1 -1
- package/lib/client/config.d.ts +3 -0
- package/lib/client/config.js +44 -0
- package/lib/client/index.d.ts +3 -0
- package/lib/client/index.js +3 -0
- package/lib/client/layouts/Layout.vue +134 -0
- package/lib/client/layouts/NotFound.vue +27 -0
- package/lib/{shim.d.ts → client/shim.d.ts} +0 -0
- package/lib/{styles/_wrapper.scss → client/styles/_mixins.scss} +7 -2
- package/lib/client/styles/_variables.scss +6 -0
- package/lib/{styles → client/styles}/arrow.scss +4 -6
- package/lib/client/styles/badge.scss +34 -0
- package/lib/{styles → client/styles}/code-group.scss +9 -2
- package/lib/{styles → client/styles}/code.scss +35 -49
- package/lib/client/styles/custom-container.scss +140 -0
- package/lib/{styles → client/styles}/home.scss +32 -24
- package/lib/{styles → client/styles}/index.scss +4 -4
- package/lib/client/styles/layout.scss +199 -0
- package/lib/{styles/dropdown.scss → client/styles/navbar-dropdown.scss} +36 -50
- package/lib/client/styles/navbar.scss +193 -0
- package/lib/client/styles/normalize.scss +200 -0
- package/lib/{styles → client/styles}/page.scss +24 -8
- package/lib/client/styles/sidebar.scss +134 -0
- package/lib/{styles → client/styles}/toc.scss +0 -0
- package/lib/client/styles/transitions.scss +22 -0
- package/lib/client/styles/vars-dark.scss +68 -0
- package/lib/client/styles/vars.scss +149 -0
- package/lib/client/utils/index.d.ts +3 -0
- package/lib/client/utils/index.js +3 -0
- package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
- package/lib/client/utils/isActiveSidebarItem.js +20 -0
- package/lib/{utils → client/utils}/resolveEditLink.d.ts +2 -2
- package/lib/{utils → client/utils}/resolveEditLink.js +15 -9
- package/lib/client/utils/resolveRepoType.d.ts +2 -0
- package/lib/{utils → client/utils}/resolveRepoType.js +3 -1
- package/lib/node/defaultTheme.d.ts +10 -0
- package/lib/node/defaultTheme.js +117 -0
- package/lib/node/index.d.ts +5 -5
- package/lib/node/index.js +5 -17
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +7 -0
- package/lib/node/{assignDefaultLocaleOptions.js → utils/assignDefaultLocaleOptions.js} +13 -13
- package/lib/node/utils/index.d.ts +2 -0
- package/lib/node/utils/index.js +2 -0
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +8 -0
- package/lib/node/utils/resolveContainerPluginOptions.js +17 -0
- package/lib/shared/index.d.ts +3 -0
- package/lib/shared/index.js +3 -0
- package/lib/shared/nav.d.ts +42 -0
- package/lib/shared/nav.js +1 -0
- package/lib/{types → shared}/options.d.ts +51 -13
- package/lib/shared/options.js +1 -0
- package/lib/{types → shared}/page.d.ts +15 -6
- package/lib/shared/page.js +1 -0
- package/package.json +49 -29
- package/templates/build.html +33 -0
- package/CHANGELOG.md +0 -376
- package/lib/clientAppEnhance.d.ts +0 -3
- package/lib/clientAppEnhance.js +0 -30
- package/lib/clientAppSetup.d.ts +0 -2
- package/lib/clientAppSetup.js +0 -11
- package/lib/components/DropdownLink.vue +0 -141
- package/lib/components/DropdownTransition.vue +0 -34
- package/lib/components/Home.vue +0 -133
- package/lib/components/NavLink.vue +0 -115
- package/lib/components/Navbar.vue +0 -114
- package/lib/components/Sidebar.vue +0 -38
- package/lib/components/SidebarChild.d.ts +0 -6
- package/lib/components/SidebarChild.js +0 -91
- package/lib/components/ToggleSidebarButton.vue +0 -27
- package/lib/components/global/Badge.vue +0 -37
- package/lib/components/global/CodeGroup.d.ts +0 -5
- package/lib/components/global/CodeGroup.js +0 -52
- package/lib/components/global/CodeGroupItem.vue +0 -25
- package/lib/components/global/OutboundLink.vue +0 -30
- package/lib/composables/index.d.ts +0 -5
- package/lib/composables/index.js +0 -5
- package/lib/composables/useSidebarItems.d.ts +0 -31
- package/lib/composables/useSidebarItems.js +0 -114
- package/lib/index.d.ts +0 -6
- package/lib/index.js +0 -67
- package/lib/layouts/404.vue +0 -38
- package/lib/layouts/Layout.vue +0 -152
- package/lib/node/assignDefaultLocaleOptions.d.ts +0 -5
- package/lib/node/resolveActiveHeaderLinksPluginOptions.d.ts +0 -6
- package/lib/node/resolveActiveHeaderLinksPluginOptions.js +0 -16
- package/lib/node/resolveContainerPluginOptions.d.ts +0 -26
- package/lib/node/resolveContainerPluginOptions.js +0 -79
- package/lib/node/resolveGitPluginOptions.d.ts +0 -6
- package/lib/node/resolveGitPluginOptions.js +0 -22
- package/lib/node/resolveMediumZoomPluginOptions.d.ts +0 -6
- package/lib/node/resolveMediumZoomPluginOptions.js +0 -17
- package/lib/styles/_normalize.scss +0 -148
- package/lib/styles/_variables.scss +0 -34
- package/lib/styles/badge.scss +0 -33
- package/lib/styles/custom-container.scss +0 -78
- package/lib/styles/layout.scss +0 -194
- package/lib/styles/navbar.scss +0 -141
- package/lib/styles/plugins.scss +0 -18
- package/lib/styles/sidebar.scss +0 -152
- package/lib/styles/sr-only.scss +0 -12
- package/lib/styles/transitions.scss +0 -13
- package/lib/types/index.d.ts +0 -3
- package/lib/types/index.js +0 -15
- package/lib/types/nav.d.ts +0 -44
- package/lib/types/nav.js +0 -2
- package/lib/types/options.js +0 -2
- package/lib/types/page.js +0 -2
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -2
- package/lib/utils/resolveRepoType.d.ts +0 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Home from '@theme/Home.vue'
|
|
3
|
+
import Navbar from '@theme/Navbar.vue'
|
|
4
|
+
import Page from '@theme/Page.vue'
|
|
5
|
+
import Sidebar from '@theme/Sidebar.vue'
|
|
6
|
+
import { usePageData, usePageFrontmatter } from '@vuepress/client'
|
|
7
|
+
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
8
|
+
import { useRouter } from 'vue-router'
|
|
9
|
+
import type { DefaultThemePageFrontmatter } from '../../shared/index.js'
|
|
10
|
+
import {
|
|
11
|
+
useScrollPromise,
|
|
12
|
+
useSidebarItems,
|
|
13
|
+
useThemeLocaleData,
|
|
14
|
+
} from '../composables/index.js'
|
|
15
|
+
|
|
16
|
+
const page = usePageData()
|
|
17
|
+
const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
|
|
18
|
+
const themeLocale = useThemeLocaleData()
|
|
19
|
+
|
|
20
|
+
// navbar
|
|
21
|
+
const shouldShowNavbar = computed(
|
|
22
|
+
() => frontmatter.value.navbar !== false && themeLocale.value.navbar !== false
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
// sidebar
|
|
26
|
+
const sidebarItems = useSidebarItems()
|
|
27
|
+
const isSidebarOpen = ref(false)
|
|
28
|
+
const toggleSidebar = (to?: boolean): void => {
|
|
29
|
+
isSidebarOpen.value = typeof to === 'boolean' ? to : !isSidebarOpen.value
|
|
30
|
+
}
|
|
31
|
+
const touchStart = { x: 0, y: 0 }
|
|
32
|
+
const onTouchStart = (e): void => {
|
|
33
|
+
touchStart.x = e.changedTouches[0].clientX
|
|
34
|
+
touchStart.y = e.changedTouches[0].clientY
|
|
35
|
+
}
|
|
36
|
+
const onTouchEnd = (e): void => {
|
|
37
|
+
const dx = e.changedTouches[0].clientX - touchStart.x
|
|
38
|
+
const dy = e.changedTouches[0].clientY - touchStart.y
|
|
39
|
+
if (Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 40) {
|
|
40
|
+
if (dx > 0 && touchStart.x <= 80) {
|
|
41
|
+
toggleSidebar(true)
|
|
42
|
+
} else {
|
|
43
|
+
toggleSidebar(false)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// classes
|
|
49
|
+
const containerClass = computed(() => [
|
|
50
|
+
{
|
|
51
|
+
'no-navbar': !shouldShowNavbar.value,
|
|
52
|
+
'no-sidebar': !sidebarItems.value.length,
|
|
53
|
+
'sidebar-open': isSidebarOpen.value,
|
|
54
|
+
},
|
|
55
|
+
frontmatter.value.pageClass,
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
// close sidebar after navigation
|
|
59
|
+
let unregisterRouterHook
|
|
60
|
+
onMounted(() => {
|
|
61
|
+
const router = useRouter()
|
|
62
|
+
unregisterRouterHook = router.afterEach(() => {
|
|
63
|
+
toggleSidebar(false)
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
onUnmounted(() => {
|
|
67
|
+
unregisterRouterHook()
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// handle scrollBehavior with transition
|
|
71
|
+
const scrollPromise = useScrollPromise()
|
|
72
|
+
const onBeforeEnter = scrollPromise.resolve
|
|
73
|
+
const onBeforeLeave = scrollPromise.pending
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<div
|
|
78
|
+
class="theme-container"
|
|
79
|
+
:class="containerClass"
|
|
80
|
+
@touchstart="onTouchStart"
|
|
81
|
+
@touchend="onTouchEnd"
|
|
82
|
+
>
|
|
83
|
+
<slot name="navbar">
|
|
84
|
+
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
|
|
85
|
+
<template #before>
|
|
86
|
+
<slot name="navbar-before" />
|
|
87
|
+
</template>
|
|
88
|
+
<template #after>
|
|
89
|
+
<slot name="navbar-after" />
|
|
90
|
+
</template>
|
|
91
|
+
</Navbar>
|
|
92
|
+
</slot>
|
|
93
|
+
|
|
94
|
+
<div class="sidebar-mask" @click="toggleSidebar(false)" />
|
|
95
|
+
|
|
96
|
+
<slot name="sidebar">
|
|
97
|
+
<Sidebar>
|
|
98
|
+
<template #top>
|
|
99
|
+
<slot name="sidebar-top" />
|
|
100
|
+
</template>
|
|
101
|
+
<template #bottom>
|
|
102
|
+
<slot name="sidebar-bottom" />
|
|
103
|
+
</template>
|
|
104
|
+
</Sidebar>
|
|
105
|
+
</slot>
|
|
106
|
+
|
|
107
|
+
<slot name="page">
|
|
108
|
+
<Home v-if="frontmatter.home" />
|
|
109
|
+
|
|
110
|
+
<Transition
|
|
111
|
+
v-else
|
|
112
|
+
name="fade-slide-y"
|
|
113
|
+
mode="out-in"
|
|
114
|
+
@before-enter="onBeforeEnter"
|
|
115
|
+
@before-leave="onBeforeLeave"
|
|
116
|
+
>
|
|
117
|
+
<Page :key="page.path">
|
|
118
|
+
<template #top>
|
|
119
|
+
<slot name="page-top" />
|
|
120
|
+
</template>
|
|
121
|
+
<template #content-top>
|
|
122
|
+
<slot name="page-content-top" />
|
|
123
|
+
</template>
|
|
124
|
+
<template #content-bottom>
|
|
125
|
+
<slot name="page-content-bottom" />
|
|
126
|
+
</template>
|
|
127
|
+
<template #bottom>
|
|
128
|
+
<slot name="page-bottom" />
|
|
129
|
+
</template>
|
|
130
|
+
</Page>
|
|
131
|
+
</Transition>
|
|
132
|
+
</slot>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRouteLocale } from '@vuepress/client'
|
|
3
|
+
import { useThemeLocaleData } from '../composables/index.js'
|
|
4
|
+
|
|
5
|
+
const routeLocale = useRouteLocale()
|
|
6
|
+
const themeLocale = useThemeLocaleData()
|
|
7
|
+
|
|
8
|
+
const messages = themeLocale.value.notFound ?? ['Not Found']
|
|
9
|
+
const getMsg = (): string =>
|
|
10
|
+
messages[Math.floor(Math.random() * messages.length)]
|
|
11
|
+
const homeLink = themeLocale.value.home ?? routeLocale.value
|
|
12
|
+
const homeText = themeLocale.value.backToHome ?? 'Back to home'
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="theme-container">
|
|
17
|
+
<main class="page">
|
|
18
|
+
<div class="theme-default-content">
|
|
19
|
+
<h1>404</h1>
|
|
20
|
+
|
|
21
|
+
<blockquote>{{ getMsg() }}</blockquote>
|
|
22
|
+
|
|
23
|
+
<RouterLink :to="homeLink">{{ homeText }}</RouterLink>
|
|
24
|
+
</div>
|
|
25
|
+
</main>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '_variables';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
max-width:
|
|
3
|
+
@mixin content_wrapper {
|
|
4
|
+
max-width: var(--content-width);
|
|
5
5
|
margin: 0 auto;
|
|
6
6
|
padding: 2rem 2.5rem;
|
|
7
7
|
|
|
@@ -13,3 +13,8 @@
|
|
|
13
13
|
padding: 1.5rem;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
@mixin dropdown_wrapper {
|
|
18
|
+
transition: height 0.1s ease-out;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import '_variables';
|
|
2
|
-
|
|
3
1
|
.arrow {
|
|
4
2
|
display: inline-block;
|
|
5
3
|
width: 0;
|
|
@@ -9,7 +7,7 @@
|
|
|
9
7
|
border: {
|
|
10
8
|
left: 4px solid transparent;
|
|
11
9
|
right: 4px solid transparent;
|
|
12
|
-
bottom: 6px solid
|
|
10
|
+
bottom: 6px solid var(--c-bg-arrow);
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
13
|
|
|
@@ -17,7 +15,7 @@
|
|
|
17
15
|
border: {
|
|
18
16
|
left: 4px solid transparent;
|
|
19
17
|
right: 4px solid transparent;
|
|
20
|
-
top: 6px solid
|
|
18
|
+
top: 6px solid var(--c-bg-arrow);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
|
|
@@ -25,7 +23,7 @@
|
|
|
25
23
|
border: {
|
|
26
24
|
top: 4px solid transparent;
|
|
27
25
|
bottom: 4px solid transparent;
|
|
28
|
-
left: 6px solid
|
|
26
|
+
left: 6px solid var(--c-bg-arrow);
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
border: {
|
|
34
32
|
top: 4px solid transparent;
|
|
35
33
|
bottom: 4px solid transparent;
|
|
36
|
-
right: 6px solid
|
|
34
|
+
right: 6px solid var(--c-bg-arrow);
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.badge {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
height: 18px;
|
|
6
|
+
line-height: 18px;
|
|
7
|
+
border-radius: 3px;
|
|
8
|
+
padding: 0 6px;
|
|
9
|
+
color: var(--c-bg);
|
|
10
|
+
vertical-align: top;
|
|
11
|
+
transition: color var(--t-color), background-color var(--t-color);
|
|
12
|
+
|
|
13
|
+
&.tip {
|
|
14
|
+
background-color: var(--c-badge-tip);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.warning {
|
|
18
|
+
background-color: var(--c-badge-warning);
|
|
19
|
+
color: var(--c-badge-warning-text);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.danger {
|
|
23
|
+
background-color: var(--c-badge-danger);
|
|
24
|
+
color: var(--c-badge-danger-text);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.table-of-contents & {
|
|
28
|
+
vertical-align: middle;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
& + & {
|
|
32
|
+
margin-left: 5px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
@import '_variables';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* code-group
|
|
5
|
+
*/
|
|
3
6
|
.code-group__nav {
|
|
4
7
|
margin-top: 0.85rem;
|
|
5
8
|
// 2 * margin + border-radius of <pre> tag
|
|
@@ -9,7 +12,7 @@
|
|
|
9
12
|
padding-top: 10px;
|
|
10
13
|
border-top-left-radius: 6px;
|
|
11
14
|
border-top-right-radius: 6px;
|
|
12
|
-
background-color:
|
|
15
|
+
background-color: var(--code-bg-color);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.code-group__ul {
|
|
@@ -34,8 +37,12 @@
|
|
|
34
37
|
outline: none;
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
.code-group__nav-tab:focus-visible {
|
|
41
|
+
outline: 1px solid rgba(255, 255, 255, 0.9);
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
.code-group__nav-tab-active {
|
|
38
|
-
border-bottom:
|
|
45
|
+
border-bottom: var(--c-brand) 1px solid;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
@media (max-width: $MQMobileNarrow) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
@use 'sass:color';
|
|
2
|
-
|
|
3
1
|
@import '_variables';
|
|
4
2
|
|
|
3
|
+
// Safari only support integer pixel value for line-height
|
|
4
|
+
// the original font-size is 16px, 1.375 will make line-height be 22px
|
|
5
|
+
$line-height: 1.375;
|
|
6
|
+
|
|
5
7
|
// ===============================
|
|
6
8
|
// Forked and modified from prismjs/themes/prism-tomorrow.css
|
|
7
9
|
|
|
@@ -9,7 +11,7 @@ code[class*='language-'],
|
|
|
9
11
|
pre[class*='language-'] {
|
|
10
12
|
color: #ccc;
|
|
11
13
|
background: none;
|
|
12
|
-
font-family:
|
|
14
|
+
font-family: var(--font-family-code);
|
|
13
15
|
font-size: 1em;
|
|
14
16
|
text-align: left;
|
|
15
17
|
white-space: pre;
|
|
@@ -118,58 +120,49 @@ pre[class*='language-'] {
|
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
.token.inserted {
|
|
121
|
-
color:
|
|
123
|
+
color: #3eaf7c;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
// ===============================
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
code {
|
|
128
|
-
color: color.scale($textColor, $lightness: 20%);
|
|
129
|
-
padding: 0.25rem 0.5rem;
|
|
130
|
-
margin: 0;
|
|
131
|
-
font-size: 0.85em;
|
|
132
|
-
background-color: rgba(27, 31, 35, 0.05);
|
|
133
|
-
border-radius: 3px;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
#{$contentClass} {
|
|
128
|
+
.theme-default-content {
|
|
138
129
|
pre,
|
|
139
130
|
pre[class*='language-'] {
|
|
140
|
-
line-height:
|
|
141
|
-
padding: 1.
|
|
131
|
+
line-height: $line-height;
|
|
132
|
+
padding: 1.3rem 1.5rem;
|
|
142
133
|
margin: 0.85rem 0;
|
|
143
|
-
background-color: $codeBgColor;
|
|
144
134
|
border-radius: 6px;
|
|
145
135
|
overflow: auto;
|
|
146
136
|
|
|
147
137
|
code {
|
|
148
138
|
color: #fff;
|
|
149
139
|
padding: 0;
|
|
150
|
-
background-color: transparent;
|
|
140
|
+
background-color: transparent !important;
|
|
151
141
|
border-radius: 0;
|
|
142
|
+
overflow-wrap: unset;
|
|
143
|
+
-webkit-font-smoothing: auto;
|
|
144
|
+
-moz-osx-font-smoothing: auto;
|
|
152
145
|
}
|
|
153
146
|
}
|
|
154
147
|
|
|
155
148
|
.line-number {
|
|
156
|
-
font-family:
|
|
157
|
-
monospace;
|
|
149
|
+
font-family: var(--font-family-code);
|
|
158
150
|
}
|
|
159
151
|
}
|
|
160
152
|
|
|
161
153
|
div[class*='language-'] {
|
|
162
154
|
position: relative;
|
|
163
|
-
background-color:
|
|
155
|
+
background-color: var(--code-bg-color);
|
|
164
156
|
border-radius: 6px;
|
|
165
157
|
|
|
166
158
|
&::before {
|
|
159
|
+
content: attr(data-ext);
|
|
167
160
|
position: absolute;
|
|
168
161
|
z-index: 3;
|
|
169
162
|
top: 0.8em;
|
|
170
163
|
right: 1em;
|
|
171
164
|
font-size: 0.75rem;
|
|
172
|
-
color:
|
|
165
|
+
color: var(--code-ln-color);
|
|
173
166
|
}
|
|
174
167
|
|
|
175
168
|
pre,
|
|
@@ -187,10 +180,10 @@ div[class*='language-'] {
|
|
|
187
180
|
top: 0;
|
|
188
181
|
left: 0;
|
|
189
182
|
width: 100%;
|
|
190
|
-
line-height:
|
|
183
|
+
line-height: $line-height;
|
|
191
184
|
|
|
192
185
|
.highlight-line {
|
|
193
|
-
background-color:
|
|
186
|
+
background-color: var(--code-hl-bg-color);
|
|
194
187
|
}
|
|
195
188
|
}
|
|
196
189
|
|
|
@@ -211,14 +204,13 @@ div[class*='language-'] {
|
|
|
211
204
|
left: 0;
|
|
212
205
|
top: 0;
|
|
213
206
|
display: block;
|
|
214
|
-
width:
|
|
207
|
+
width: var(--code-ln-wrapper-width);
|
|
215
208
|
height: 100%;
|
|
216
|
-
background-color: rgba(0, 0, 0, 66%);
|
|
217
209
|
}
|
|
218
210
|
}
|
|
219
211
|
|
|
220
212
|
pre {
|
|
221
|
-
margin-left:
|
|
213
|
+
margin-left: var(--code-ln-wrapper-width);
|
|
222
214
|
padding-left: 1rem;
|
|
223
215
|
vertical-align: middle;
|
|
224
216
|
}
|
|
@@ -226,21 +218,24 @@ div[class*='language-'] {
|
|
|
226
218
|
.line-numbers {
|
|
227
219
|
position: absolute;
|
|
228
220
|
top: 0;
|
|
229
|
-
width:
|
|
221
|
+
width: var(--code-ln-wrapper-width);
|
|
230
222
|
text-align: center;
|
|
231
|
-
color:
|
|
223
|
+
color: var(--code-ln-color);
|
|
232
224
|
padding-top: 1.25rem;
|
|
233
|
-
line-height:
|
|
234
|
-
|
|
235
|
-
br {
|
|
236
|
-
user-select: none;
|
|
237
|
-
}
|
|
225
|
+
line-height: $line-height;
|
|
226
|
+
counter-reset: line-number;
|
|
238
227
|
|
|
239
228
|
.line-number {
|
|
240
229
|
position: relative;
|
|
241
230
|
z-index: 3;
|
|
242
231
|
user-select: none;
|
|
243
|
-
|
|
232
|
+
height: #{$line-height}em;
|
|
233
|
+
|
|
234
|
+
&::before {
|
|
235
|
+
counter-increment: line-number;
|
|
236
|
+
content: counter(line-number);
|
|
237
|
+
font-size: 0.85em;
|
|
238
|
+
}
|
|
244
239
|
}
|
|
245
240
|
}
|
|
246
241
|
|
|
@@ -249,26 +244,17 @@ div[class*='language-'] {
|
|
|
249
244
|
position: absolute;
|
|
250
245
|
top: 0;
|
|
251
246
|
left: 0;
|
|
252
|
-
width:
|
|
247
|
+
width: var(--code-ln-wrapper-width);
|
|
253
248
|
height: 100%;
|
|
254
249
|
border-radius: 6px 0 0 6px;
|
|
255
|
-
border-right: 1px solid
|
|
256
|
-
background-color: $codeBgColor;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@each $lang in $codeLang {
|
|
262
|
-
div[class*='language-'].ext-#{$lang} {
|
|
263
|
-
&:before {
|
|
264
|
-
content: '' + $lang;
|
|
250
|
+
border-right: 1px solid var(--code-hl-bg-color);
|
|
265
251
|
}
|
|
266
252
|
}
|
|
267
253
|
}
|
|
268
254
|
|
|
269
255
|
// narrow mobile
|
|
270
256
|
@media (max-width: $MQMobileNarrow) {
|
|
271
|
-
|
|
257
|
+
.theme-default-content {
|
|
272
258
|
div[class*='language-'] {
|
|
273
259
|
margin: 0.85rem -1.5rem;
|
|
274
260
|
border-radius: 0;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
.custom-container {
|
|
2
|
+
transition: color var(--t-color), border-color var(--t-color),
|
|
3
|
+
background-color var(--t-color);
|
|
4
|
+
|
|
5
|
+
.custom-container-title {
|
|
6
|
+
font-weight: 600;
|
|
7
|
+
&:not(:only-child) {
|
|
8
|
+
margin-bottom: -0.4rem;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.tip,
|
|
13
|
+
&.warning,
|
|
14
|
+
&.danger {
|
|
15
|
+
padding: 0.1rem 1.5rem;
|
|
16
|
+
border-left-width: 0.5rem;
|
|
17
|
+
border-left-style: solid;
|
|
18
|
+
margin: 1rem 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.tip {
|
|
22
|
+
border-color: var(--c-tip);
|
|
23
|
+
background-color: var(--c-tip-bg);
|
|
24
|
+
color: var(--c-tip-text);
|
|
25
|
+
|
|
26
|
+
.custom-container-title {
|
|
27
|
+
color: var(--c-tip-title);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a {
|
|
31
|
+
color: var(--c-tip-text-accent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
code {
|
|
35
|
+
background-color: var(--c-bg-dark);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.warning {
|
|
40
|
+
border-color: var(--c-warning);
|
|
41
|
+
background-color: var(--c-warning-bg);
|
|
42
|
+
color: var(--c-warning-text);
|
|
43
|
+
|
|
44
|
+
.custom-container-title {
|
|
45
|
+
color: var(--c-warning-title);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
a {
|
|
49
|
+
color: var(--c-warning-text-accent);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
blockquote {
|
|
53
|
+
border-left-color: var(--c-warning-border-dark);
|
|
54
|
+
color: var(--c-warning-text-quote);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
code {
|
|
58
|
+
color: var(--c-warning-text-light);
|
|
59
|
+
background-color: var(--c-warning-bg-light);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
details {
|
|
63
|
+
background-color: var(--c-warning-details-bg);
|
|
64
|
+
|
|
65
|
+
code {
|
|
66
|
+
background-color: var(--c-warning-bg-lighter);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.external-link-icon {
|
|
71
|
+
--external-link-icon-color: var(--c-warning-text-quote);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.danger {
|
|
76
|
+
border-color: var(--c-danger);
|
|
77
|
+
background-color: var(--c-danger-bg);
|
|
78
|
+
color: var(--c-danger-text);
|
|
79
|
+
|
|
80
|
+
.custom-container-title {
|
|
81
|
+
color: var(--c-danger-title);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
a {
|
|
85
|
+
color: var(--c-danger-text-accent);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
blockquote {
|
|
89
|
+
border-left-color: var(--c-danger-border-dark);
|
|
90
|
+
color: var(--c-danger-text-quote);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
code {
|
|
94
|
+
color: var(--c-danger-text-light);
|
|
95
|
+
background-color: var(--c-danger-bg-light);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
details {
|
|
99
|
+
background-color: var(--c-danger-details-bg);
|
|
100
|
+
|
|
101
|
+
code {
|
|
102
|
+
background-color: var(--c-danger-bg-lighter);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.external-link-icon {
|
|
107
|
+
--external-link-icon-color: var(--c-danger-text-quote);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.details {
|
|
112
|
+
display: block;
|
|
113
|
+
position: relative;
|
|
114
|
+
border-radius: 2px;
|
|
115
|
+
margin: 1.6em 0;
|
|
116
|
+
padding: 1.6em;
|
|
117
|
+
background-color: var(--c-details-bg);
|
|
118
|
+
|
|
119
|
+
code {
|
|
120
|
+
background-color: var(--c-bg-darker);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
h4 {
|
|
124
|
+
margin-top: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
figure,
|
|
128
|
+
p {
|
|
129
|
+
&:last-child {
|
|
130
|
+
margin-bottom: 0;
|
|
131
|
+
padding-bottom: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
summary {
|
|
136
|
+
outline: none;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|