vitepress 1.0.0-draft.4 → 1.0.0-draft.7
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/index.js +1 -5
- package/dist/client/index.d.ts +123 -137
- package/dist/client/index.js +1 -2
- 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 +11 -1
- package/dist/client/theme-default/components/VPDoc.vue +29 -35
- package/dist/client/theme-default/components/VPDocAside.vue +46 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
- package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +39 -34
- 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 +19 -7
- 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 +10 -4
- 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 +3 -3
- package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
- package/dist/client/theme-default/index.js +1 -0
- package/dist/client/theme-default/styles/base.css +13 -1
- package/dist/client/theme-default/styles/components/custom-block.css +2 -2
- package/dist/client/theme-default/styles/components/vp-doc.css +98 -107
- package/dist/client/theme-default/styles/components/vp-sponsor.css +51 -7
- package/dist/client/theme-default/styles/vars.css +42 -27
- package/dist/node/cli.js +32 -31
- package/dist/node/index.d.ts +371 -364
- 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-b3182d88.js → node-cjs/serve-a73b4871.cjs} +27419 -28634
- package/package.json +46 -38
- package/theme.d.ts +7 -2
- package/types/default-theme.d.ts +15 -2
|
@@ -31,25 +31,18 @@ const closeSideBar = inject('close-sidebar') as () => void
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.link:hover .link-text {
|
|
34
|
-
color: var(--vp-c-
|
|
34
|
+
color: var(--vp-c-text-1);
|
|
35
35
|
transition: color 0.25s;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.link.active .link-text {
|
|
39
|
-
font-weight: 600;
|
|
40
39
|
color: var(--vp-c-brand);
|
|
41
40
|
transition: color 0.25s;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
@media (min-width: 960px) {
|
|
45
|
-
.link {
|
|
46
|
-
padding: 4px 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
43
|
.link-text {
|
|
51
44
|
line-height: 20px;
|
|
52
|
-
font-size:
|
|
45
|
+
font-size: 14px;
|
|
53
46
|
font-weight: 500;
|
|
54
47
|
color: var(--vp-c-text-2);
|
|
55
48
|
transition: color 0.5s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { DefaultTheme } from '
|
|
2
|
+
import { DefaultTheme } from '../config'
|
|
3
3
|
import VPIconDiscord from './icons/VPIconDiscord.vue'
|
|
4
4
|
import VPIconFacebook from './icons/VPIconFacebook.vue'
|
|
5
5
|
import VPIconGitHub from './icons/VPIconGitHub.vue'
|
|
@@ -9,7 +9,7 @@ import VPIconSlack from './icons/VPIconSlack.vue'
|
|
|
9
9
|
import VPIconTwitter from './icons/VPIconTwitter.vue'
|
|
10
10
|
import VPIconYouTube from './icons/VPIconYouTube.vue'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
defineProps<{
|
|
13
13
|
icon: DefaultTheme.SocialLinkIcon
|
|
14
14
|
link: string
|
|
15
15
|
}>()
|
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import VPSponsorsGrid from './VPSponsorsGrid.vue'
|
|
4
4
|
|
|
5
|
-
interface Sponsors {
|
|
5
|
+
export interface Sponsors {
|
|
6
6
|
tier?: string
|
|
7
7
|
size?: 'small' | 'medium' | 'big'
|
|
8
8
|
items: Sponsor[]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
interface Sponsor {
|
|
11
|
+
export interface Sponsor {
|
|
12
12
|
name: string
|
|
13
13
|
img: string
|
|
14
14
|
url: string
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const props = defineProps<{
|
|
18
|
+
mode?: 'normal' | 'aside'
|
|
18
19
|
tier?: string
|
|
19
|
-
size?: 'small' | 'medium' | 'big'
|
|
20
|
-
data:
|
|
20
|
+
size?: 'xmini' | 'small' | 'medium' | 'big'
|
|
21
|
+
data: Sponsors[] | Sponsor[]
|
|
21
22
|
}>()
|
|
22
23
|
|
|
23
24
|
const sponsors = computed(() => {
|
|
24
|
-
const isSponsors = props.data.some((s
|
|
25
|
+
const isSponsors = props.data.some((s) => {
|
|
26
|
+
return !!(s as Sponsors).items
|
|
27
|
+
})
|
|
25
28
|
|
|
26
29
|
if (isSponsors) {
|
|
27
30
|
return props.data
|
|
@@ -36,42 +39,14 @@ const sponsors = computed(() => {
|
|
|
36
39
|
</script>
|
|
37
40
|
|
|
38
41
|
<template>
|
|
39
|
-
<div class="VPSponsors">
|
|
40
|
-
<section
|
|
41
|
-
|
|
42
|
+
<div class="VPSponsors vp-sponsor" :class="[mode ?? 'normal']">
|
|
43
|
+
<section
|
|
44
|
+
v-for="(sponsor, index) in sponsors"
|
|
45
|
+
:key="index"
|
|
46
|
+
class="vp-sponsor-section"
|
|
47
|
+
>
|
|
48
|
+
<h3 v-if="sponsor.tier" class="vp-sponsor-tier">{{ sponsor.tier }}</h3>
|
|
42
49
|
<VPSponsorsGrid :size="sponsor.size" :data="sponsor.items" />
|
|
43
50
|
</section>
|
|
44
51
|
</div>
|
|
45
52
|
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped>
|
|
48
|
-
.VPSponsors {
|
|
49
|
-
border-radius: 16px;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.section + .section {
|
|
54
|
-
margin-top: 4px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.tier {
|
|
58
|
-
margin-bottom: 4px;
|
|
59
|
-
padding: 13px 0 11px;
|
|
60
|
-
text-align: center;
|
|
61
|
-
letter-spacing: 1px;
|
|
62
|
-
line-height: 24px;
|
|
63
|
-
width: 100%;
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
font-weight: 600;
|
|
66
|
-
color: var(--vp-c-text-2);
|
|
67
|
-
background-color: var(--vp-c-white-soft);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.dark .tier {
|
|
71
|
-
background-color: var(--vp-c-black-mute);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.VPSponsorsGrid + .tier {
|
|
75
|
-
margin-top: 4px;
|
|
76
|
-
}
|
|
77
|
-
</style>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { useSponsorsGrid } from '../composables/sponsor-grid'
|
|
4
4
|
|
|
5
|
-
interface Sponsor {
|
|
5
|
+
export interface Sponsor {
|
|
6
6
|
name: string
|
|
7
7
|
img: string
|
|
8
8
|
url: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const props = defineProps<{
|
|
12
|
-
size?: 'small' | 'medium' | 'big'
|
|
12
|
+
size?: 'xmini' | 'mini' | 'small' | 'medium' | 'big'
|
|
13
13
|
data: Sponsor[]
|
|
14
14
|
}>()
|
|
15
15
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
|
|
3
|
+
<path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z" />
|
|
4
|
+
<path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z" />
|
|
5
|
+
</svg>
|
|
6
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
+
<path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z" />
|
|
4
|
+
<path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z" />
|
|
5
|
+
</svg>
|
|
6
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { useMediaQuery } from '@vueuse/core';
|
|
3
|
+
import { useSidebar } from './sidebar';
|
|
4
|
+
export function useAside() {
|
|
5
|
+
const { hasSidebar } = useSidebar();
|
|
6
|
+
const is960 = useMediaQuery('(min-width: 960px)');
|
|
7
|
+
const is1280 = useMediaQuery('(min-width: 1280px)');
|
|
8
|
+
const isAsideEnabled = computed(() => {
|
|
9
|
+
if (!is1280.value && !is960.value) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return hasSidebar.value ? is1280.value : is960.value;
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
isAsideEnabled
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { nextTick, watch } from 'vue';
|
|
2
|
+
import { inBrowser, useData } from 'vitepress';
|
|
3
|
+
export function useCopyCode() {
|
|
4
|
+
const { page } = useData();
|
|
5
|
+
if (inBrowser)
|
|
6
|
+
watch(() => page.value.relativePath, () => {
|
|
7
|
+
nextTick(() => {
|
|
8
|
+
document
|
|
9
|
+
.querySelectorAll('.vp-doc div[class*="language-"]>span.copy')
|
|
10
|
+
.forEach(handleElement);
|
|
11
|
+
});
|
|
12
|
+
}, { immediate: true, flush: 'post' });
|
|
13
|
+
}
|
|
14
|
+
function handleElement(el) {
|
|
15
|
+
el.onclick = () => {
|
|
16
|
+
const parent = el.parentElement;
|
|
17
|
+
if (!parent) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const isShell = parent.classList.contains('language-sh') ||
|
|
21
|
+
parent.classList.contains('language-bash');
|
|
22
|
+
let { innerText: text = '' } = parent;
|
|
23
|
+
if (isShell) {
|
|
24
|
+
text = text.replace(/^ *\$ /gm, '');
|
|
25
|
+
}
|
|
26
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
27
|
+
el.classList.add('copied');
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
el.classList.remove('copied');
|
|
30
|
+
}, 3000);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, onMounted, onUpdated, onUnmounted } from 'vue';
|
|
2
2
|
import { useData } from 'vitepress';
|
|
3
|
-
import {
|
|
3
|
+
import { useAside } from '../composables/aside';
|
|
4
4
|
import { throttleAndDebounce } from '../support/utils';
|
|
5
5
|
// magic number to avoid repeated retrieval
|
|
6
6
|
const PAGE_OFFSET = 56;
|
|
@@ -39,7 +39,7 @@ function mapHeaders(headers) {
|
|
|
39
39
|
}));
|
|
40
40
|
}
|
|
41
41
|
export function useActiveAnchor(container, marker) {
|
|
42
|
-
const
|
|
42
|
+
const { isAsideEnabled } = useAside();
|
|
43
43
|
const onScroll = throttleAndDebounce(setActiveLink, 100);
|
|
44
44
|
let prevActiveLink = null;
|
|
45
45
|
onMounted(() => {
|
|
@@ -54,7 +54,7 @@ export function useActiveAnchor(container, marker) {
|
|
|
54
54
|
window.removeEventListener('scroll', onScroll);
|
|
55
55
|
});
|
|
56
56
|
function setActiveLink() {
|
|
57
|
-
if (!
|
|
57
|
+
if (!isAsideEnabled.value) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
const links = [].slice.call(container.value.querySelectorAll('.outline-link'));
|
|
@@ -5,14 +5,16 @@ import { throttleAndDebounce } from '../support/utils';
|
|
|
5
5
|
*
|
|
6
6
|
* [Screen widh, Column size]
|
|
7
7
|
*
|
|
8
|
-
* It sets grid size on matching screen size. For example, `[768, 5]` will
|
|
9
|
-
* 5 columns when screen size is bigger or equal to 768px.
|
|
8
|
+
* It sets grid size on matching screen size. For example, `[768, 5]` will
|
|
9
|
+
* set 5 columns when screen size is bigger or equal to 768px.
|
|
10
10
|
*
|
|
11
11
|
* Column will set only when item size is bigger than the column size. For
|
|
12
|
-
* example, even we
|
|
13
|
-
* like to show it in 1 column.
|
|
12
|
+
* example, even we define 5 columns, if we only have 1 sponsor yet, we would
|
|
13
|
+
* like to show it in 1 column to make it stand out.
|
|
14
14
|
*/
|
|
15
15
|
const GridSettings = {
|
|
16
|
+
xmini: [[0, 2]],
|
|
17
|
+
mini: [],
|
|
16
18
|
small: [
|
|
17
19
|
[920, 6],
|
|
18
20
|
[768, 5],
|
|
@@ -31,7 +33,7 @@ const GridSettings = {
|
|
|
31
33
|
[640, 2]
|
|
32
34
|
]
|
|
33
35
|
};
|
|
34
|
-
export function useSponsorsGrid(
|
|
36
|
+
export function useSponsorsGrid({ el, size = 'medium' }) {
|
|
35
37
|
const onResize = throttleAndDebounce(manage, 100);
|
|
36
38
|
onMounted(() => {
|
|
37
39
|
manage();
|
|
@@ -41,7 +43,7 @@ export function useSponsorsGrid(options) {
|
|
|
41
43
|
window.removeEventListener('resize', onResize);
|
|
42
44
|
});
|
|
43
45
|
function manage() {
|
|
44
|
-
adjustSlots(
|
|
46
|
+
adjustSlots(el.value, size);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
function adjustSlots(el, size) {
|
|
@@ -10,6 +10,7 @@ import NotFound from './NotFound.vue';
|
|
|
10
10
|
export { default as VPHomeHero } from './components/VPHomeHero.vue';
|
|
11
11
|
export { default as VPHomeFeatures } from './components/VPHomeFeatures.vue';
|
|
12
12
|
export { default as VPHomeSponsors } from './components/VPHomeSponsors.vue';
|
|
13
|
+
export { default as VPDocAsideSponsors } from './components/VPDocAsideSponsors.vue';
|
|
13
14
|
const theme = {
|
|
14
15
|
Layout,
|
|
15
16
|
NotFound
|
|
@@ -10,6 +10,10 @@ html {
|
|
|
10
10
|
-webkit-text-size-adjust: 100%;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
html.dark {
|
|
14
|
+
color-scheme: dark;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
body {
|
|
14
18
|
margin: 0;
|
|
15
19
|
width: 100%;
|
|
@@ -20,7 +24,7 @@ body {
|
|
|
20
24
|
font-size: 16px;
|
|
21
25
|
font-weight: 400;
|
|
22
26
|
color: var(--vp-c-text-1);
|
|
23
|
-
background-color: var(--vp-c-bg
|
|
27
|
+
background-color: var(--vp-c-bg);
|
|
24
28
|
direction: ltr;
|
|
25
29
|
font-synthesis: none;
|
|
26
30
|
text-rendering: optimizeLegibility;
|
|
@@ -92,6 +96,10 @@ ul {
|
|
|
92
96
|
padding: 0;
|
|
93
97
|
}
|
|
94
98
|
|
|
99
|
+
blockquote {
|
|
100
|
+
margin: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
95
103
|
pre,
|
|
96
104
|
code,
|
|
97
105
|
kbd,
|
|
@@ -111,6 +119,10 @@ object {
|
|
|
111
119
|
vertical-align: middle;
|
|
112
120
|
}
|
|
113
121
|
|
|
122
|
+
figure {
|
|
123
|
+
margin: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
114
126
|
img,
|
|
115
127
|
video {
|
|
116
128
|
max-width: 100%;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
border: 1px solid transparent;
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
padding: 16px 16px 8px;
|
|
5
|
-
line-height:
|
|
5
|
+
line-height: 24px;
|
|
6
6
|
font-size: 14px;
|
|
7
7
|
color: var(--vp-c-text-2);
|
|
8
8
|
}
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
color: inherit;
|
|
79
79
|
font-weight: 600;
|
|
80
80
|
text-decoration: underline;
|
|
81
|
-
transition: opacity .25s;
|
|
81
|
+
transition: opacity 0.25s;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.custom-block a:hover {
|
|
@@ -156,10 +156,6 @@
|
|
|
156
156
|
background-color: var(--vp-c-bg-soft);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
.dark .vp-doc tr:nth-child(2n) {
|
|
160
|
-
background-color: var(--vp-c-bg-mute);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
159
|
.vp-doc th,
|
|
164
160
|
.vp-doc td {
|
|
165
161
|
border: 1px solid var(--vp-c-divider);
|
|
@@ -216,7 +212,7 @@
|
|
|
216
212
|
|
|
217
213
|
.vp-doc .custom-block code {
|
|
218
214
|
font-size: var(--vp-custom-block-code-font-size);
|
|
219
|
-
font-weight:
|
|
215
|
+
font-weight: 700;
|
|
220
216
|
color: inherit;
|
|
221
217
|
}
|
|
222
218
|
|
|
@@ -253,6 +249,11 @@
|
|
|
253
249
|
}
|
|
254
250
|
|
|
255
251
|
.vp-doc a > code {
|
|
252
|
+
color: var(--vp-c-brand);
|
|
253
|
+
transition: color 0.25s;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.vp-doc a:hover > code {
|
|
256
257
|
color: var(--vp-c-brand-dark);
|
|
257
258
|
}
|
|
258
259
|
|
|
@@ -322,150 +323,140 @@
|
|
|
322
323
|
top: 0;
|
|
323
324
|
bottom: 0;
|
|
324
325
|
left: 0;
|
|
325
|
-
padding:
|
|
326
|
+
padding-top: 16px;
|
|
326
327
|
width: 100%;
|
|
327
|
-
font-family: var(--vp-font-family-mono);
|
|
328
328
|
line-height: var(--vp-code-line-height);
|
|
329
|
+
font-family: var(--vp-font-family-mono);
|
|
329
330
|
font-size: var(--vp-code-font-size);
|
|
330
331
|
user-select: none;
|
|
331
332
|
overflow: hidden;
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
.vp-doc .highlight-lines .highlighted {
|
|
335
|
-
background-color:
|
|
336
|
+
background-color: var(--vp-code-line-highlight-color);
|
|
336
337
|
transition: background-color 0.5s;
|
|
337
338
|
}
|
|
338
339
|
|
|
339
|
-
.dark .vp-doc .highlight-lines .highlighted {
|
|
340
|
-
background-color: rgba(255, 255, 255, 0.05);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
340
|
.vp-doc div[class*='language-'].line-numbers-mode {
|
|
344
341
|
padding-left: 32px;
|
|
345
342
|
}
|
|
346
343
|
|
|
344
|
+
.vp-doc div[class*='language-'].line-numbers-mode pre {
|
|
345
|
+
padding-left: 16px;
|
|
346
|
+
}
|
|
347
|
+
|
|
347
348
|
.vp-doc .line-numbers-wrapper {
|
|
348
349
|
position: absolute;
|
|
349
350
|
top: 0;
|
|
350
351
|
bottom: 0;
|
|
351
352
|
left: 0;
|
|
352
353
|
z-index: 3;
|
|
353
|
-
border-right: 1px solid var(--vp-c-divider-
|
|
354
|
-
padding:
|
|
354
|
+
border-right: 1px solid var(--vp-c-divider-dark-2);
|
|
355
|
+
padding-top: 16px;
|
|
355
356
|
width: 32px;
|
|
356
357
|
text-align: center;
|
|
357
358
|
font-family: var(--vp-font-family-mono);
|
|
358
359
|
line-height: var(--vp-code-line-height);
|
|
359
360
|
font-size: var(--vp-code-font-size);
|
|
360
|
-
color: var(--vp-
|
|
361
|
+
color: var(--vp-code-line-number-color);
|
|
361
362
|
transition: border-color 0.5s, color 0.5s;
|
|
362
363
|
}
|
|
363
364
|
|
|
364
|
-
.vp-doc [class*='language-']
|
|
365
|
+
.vp-doc [class*='language-'] > span.copy {
|
|
365
366
|
position: absolute;
|
|
366
|
-
top:
|
|
367
|
-
right:
|
|
367
|
+
top: 8px;
|
|
368
|
+
right: 8px;
|
|
368
369
|
z-index: 2;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
.
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
.vp-doc [class~='language-json']:before { content: 'json'; }
|
|
384
|
-
.vp-doc [class~='language-yaml']:before { content: 'yaml'; }
|
|
385
|
-
.vp-doc [class~='language-yml']:before { content: 'yaml'; }
|
|
386
|
-
.vp-doc [class~='language-sh']:before { content: 'sh'; }
|
|
387
|
-
.vp-doc [class~='language-bash']:before { content: 'sh'; }
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Code: Highlight
|
|
391
|
-
*
|
|
392
|
-
* prism.js tomorrow night eighties theme.
|
|
393
|
-
* https://github.com/chriskempson/tomorrow-theme
|
|
394
|
-
*
|
|
395
|
-
* @author Rose Pritchard
|
|
396
|
-
* -------------------------------------------------------------------------- */
|
|
397
|
-
|
|
398
|
-
.token.comment,
|
|
399
|
-
.token.block-comment,
|
|
400
|
-
.token.prolog,
|
|
401
|
-
.token.doctype,
|
|
402
|
-
.token.cdata {
|
|
403
|
-
color: #999;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.token.punctuation {
|
|
407
|
-
color: #ccc;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
.token.tag,
|
|
411
|
-
.token.attr-name,
|
|
412
|
-
.token.namespace,
|
|
413
|
-
.token.deleted {
|
|
414
|
-
color: #e2777a;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.token.function-name {
|
|
418
|
-
color: #6196cc;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.token.boolean,
|
|
422
|
-
.token.number,
|
|
423
|
-
.token.function {
|
|
424
|
-
color: #f08d49;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.token.property,
|
|
428
|
-
.token.class-name,
|
|
429
|
-
.token.constant,
|
|
430
|
-
.token.symbol {
|
|
431
|
-
color: #f8c555;
|
|
370
|
+
display: block;
|
|
371
|
+
justify-content: center;
|
|
372
|
+
align-items: center;
|
|
373
|
+
border-radius: 4px;
|
|
374
|
+
width: 40px;
|
|
375
|
+
height: 40px;
|
|
376
|
+
background-color: var(--vp-code-block-bg);
|
|
377
|
+
opacity: 0;
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(235,235,235,0.38)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
|
|
380
|
+
background-position: 50%;
|
|
381
|
+
background-size: 20px;
|
|
382
|
+
background-repeat: no-repeat;
|
|
383
|
+
transition: opacity 0.25s;
|
|
432
384
|
}
|
|
433
385
|
|
|
434
|
-
.
|
|
435
|
-
|
|
436
|
-
.token.atrule,
|
|
437
|
-
.token.keyword,
|
|
438
|
-
.token.builtin {
|
|
439
|
-
color: #cc99cd;
|
|
386
|
+
.vp-doc [class*='language-']:hover > span.copy {
|
|
387
|
+
opacity: 1;
|
|
440
388
|
}
|
|
441
389
|
|
|
442
|
-
.
|
|
443
|
-
|
|
444
|
-
.token.attr-value,
|
|
445
|
-
.token.regex,
|
|
446
|
-
.token.variable {
|
|
447
|
-
color: #7ec699;
|
|
390
|
+
.vp-doc [class*='language-'] > span.copy:hover {
|
|
391
|
+
background-color: var(--vp-code-copy-code-hover-bg);
|
|
448
392
|
}
|
|
449
393
|
|
|
450
|
-
.
|
|
451
|
-
.
|
|
452
|
-
|
|
453
|
-
color:
|
|
394
|
+
.vp-doc [class*='language-'] > span.copy.copied,
|
|
395
|
+
.vp-doc [class*='language-'] > span.copy:hover.copied {
|
|
396
|
+
border-radius: 0 4px 4px 0;
|
|
397
|
+
background-color: var(--vp-code-copy-code-hover-bg);
|
|
398
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(235,235,235,0.5)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");
|
|
454
399
|
}
|
|
455
400
|
|
|
456
|
-
.
|
|
457
|
-
.
|
|
458
|
-
|
|
401
|
+
.vp-doc [class*='language-'] > span.copy.copied::before,
|
|
402
|
+
.vp-doc [class*='language-'] > span.copy:hover.copied::before {
|
|
403
|
+
position: relative;
|
|
404
|
+
left: -65px;
|
|
405
|
+
display: block;
|
|
406
|
+
border-radius: 4px 0 0 4px;
|
|
407
|
+
padding-top: 8px;
|
|
408
|
+
width: 64px;
|
|
409
|
+
height: 40px;
|
|
410
|
+
text-align: center;
|
|
411
|
+
font-size: 12px;
|
|
412
|
+
font-weight: 500;
|
|
413
|
+
color: var(--vp-c-text-dark-2);
|
|
414
|
+
background-color: var(--vp-code-copy-code-hover-bg);
|
|
415
|
+
white-space: nowrap;
|
|
416
|
+
content: "Copied";
|
|
459
417
|
}
|
|
460
418
|
|
|
461
|
-
.
|
|
462
|
-
|
|
419
|
+
.vp-doc [class*='language-']:before {
|
|
420
|
+
position: absolute;
|
|
421
|
+
top: 6px;
|
|
422
|
+
right: 12px;
|
|
423
|
+
z-index: 2;
|
|
424
|
+
font-size: 12px;
|
|
425
|
+
font-weight: 500;
|
|
426
|
+
color: var(--vp-c-text-dark-3);
|
|
427
|
+
transition: color 0.5s, opacity 0.5s;
|
|
463
428
|
}
|
|
464
429
|
|
|
465
|
-
.
|
|
466
|
-
|
|
430
|
+
.vp-doc [class*='language-']:hover:before {
|
|
431
|
+
opacity: 0;
|
|
467
432
|
}
|
|
468
433
|
|
|
469
|
-
.
|
|
470
|
-
|
|
471
|
-
}
|
|
434
|
+
.vp-doc [class~='language-c']:before { content: 'c'; }
|
|
435
|
+
.vp-doc [class~='language-css']:before { content: 'css'; }
|
|
436
|
+
.vp-doc [class~='language-go']:before { content: 'go'; }
|
|
437
|
+
.vp-doc [class~='language-html']:before { content: 'html'; }
|
|
438
|
+
.vp-doc [class~='language-java']:before { content: 'java'; }
|
|
439
|
+
.vp-doc [class~='language-javascript']:before { content: 'js'; }
|
|
440
|
+
.vp-doc [class~='language-js']:before { content: 'js'; }
|
|
441
|
+
.vp-doc [class~='language-json']:before { content: 'json'; }
|
|
442
|
+
.vp-doc [class~='language-jsx']:before { content: 'jsx'; }
|
|
443
|
+
.vp-doc [class~='language-less']:before { content: 'less'; }
|
|
444
|
+
.vp-doc [class~='language-markdown']:before { content: 'md'; }
|
|
445
|
+
.vp-doc [class~='language-md']:before { content: 'md' }
|
|
446
|
+
.vp-doc [class~='language-php']:before { content: 'php'; }
|
|
447
|
+
.vp-doc [class~='language-python']:before { content: 'py'; }
|
|
448
|
+
.vp-doc [class~='language-py']:before { content: 'py'; }
|
|
449
|
+
.vp-doc [class~='language-rb']:before { content: 'rb'; }
|
|
450
|
+
.vp-doc [class~='language-ruby']:before { content: 'rb'; }
|
|
451
|
+
.vp-doc [class~='language-rust']:before { content: 'rust'; }
|
|
452
|
+
.vp-doc [class~='language-sass']:before { content: 'sass'; }
|
|
453
|
+
.vp-doc [class~='language-scss']:before { content: 'scss'; }
|
|
454
|
+
.vp-doc [class~='language-sh']:before { content: 'sh'; }
|
|
455
|
+
.vp-doc [class~='language-bash']:before { content: 'sh'; }
|
|
456
|
+
.vp-doc [class~='language-stylus']:before { content: 'styl'; }
|
|
457
|
+
.vp-doc [class~='language-vue-html']:before { content: 'template'; }
|
|
458
|
+
.vp-doc [class~='language-typescript']:before { content: 'ts'; }
|
|
459
|
+
.vp-doc [class~='language-ts']:before { content: 'ts'; }
|
|
460
|
+
.vp-doc [class~='language-tsx']:before { content: 'tsx'; }
|
|
461
|
+
.vp-doc [class~='language-vue']:before { content: 'vue'; }
|
|
462
|
+
.vp-doc [class~='language-yaml']:before { content: 'yaml'; }
|