vitepress 0.22.4 → 1.0.0-draft.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/client.d.ts +2 -3
  2. package/dist/client/app/components/ClientOnly.js +1 -1
  3. package/dist/client/app/index.js +1 -1
  4. package/dist/client/theme-default/Layout.vue +25 -183
  5. package/dist/client/theme-default/NotFound.vue +9 -8
  6. package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +127 -0
  7. package/dist/client/theme-default/components/VPBackdrop.vue +39 -0
  8. package/dist/client/theme-default/components/VPContent.vue +44 -0
  9. package/dist/client/theme-default/components/VPContentDoc.vue +173 -0
  10. package/dist/client/theme-default/components/VPContentDocFooter.vue +140 -0
  11. package/dist/client/theme-default/components/VPContentDocOutline.vue +108 -0
  12. package/dist/client/theme-default/components/VPFlyout.vue +149 -0
  13. package/dist/client/theme-default/components/VPLink.vue +37 -0
  14. package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
  15. package/dist/client/theme-default/components/VPMenu.vue +79 -0
  16. package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
  17. package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
  18. package/dist/client/theme-default/components/VPNav.vue +33 -0
  19. package/dist/client/theme-default/components/VPNavBar.vue +109 -0
  20. package/dist/client/theme-default/components/VPNavBarAppearance.vue +22 -0
  21. package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
  22. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  23. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  24. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
  25. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
  26. package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
  27. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  28. package/dist/client/theme-default/components/VPNavBarTitle.vue +44 -0
  29. package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
  30. package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
  31. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +30 -0
  32. package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
  33. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
  34. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
  35. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
  36. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
  37. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  38. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  39. package/dist/client/theme-default/components/VPSidebar.vue +118 -0
  40. package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
  41. package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
  42. package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
  43. package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
  44. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  45. package/dist/client/theme-default/components/VPSwitch.vue +66 -0
  46. package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
  47. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  48. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  49. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  50. package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
  51. package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
  52. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  53. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  54. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  55. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  56. package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
  57. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  58. package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
  59. package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
  60. package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
  61. package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
  62. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  63. package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
  64. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  65. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  66. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  67. package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
  68. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  69. package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
  70. package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
  71. package/dist/client/theme-default/composables/edit-link.js +22 -0
  72. package/dist/client/theme-default/composables/flyout.js +40 -0
  73. package/dist/client/theme-default/composables/nav.js +27 -1
  74. package/dist/client/theme-default/composables/outline.js +130 -0
  75. package/dist/client/theme-default/composables/prev-next.js +18 -0
  76. package/dist/client/theme-default/composables/sidebar.js +57 -0
  77. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  78. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  79. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  80. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  81. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  82. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  83. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  84. package/dist/client/theme-default/index.js +4 -4
  85. package/dist/client/theme-default/styles/base.css +200 -0
  86. package/dist/client/theme-default/styles/fonts.css +67 -0
  87. package/dist/client/theme-default/styles/utils.css +9 -0
  88. package/dist/client/theme-default/styles/vars.css +206 -66
  89. package/dist/client/theme-default/styles/vp-doc.css +419 -0
  90. package/dist/client/theme-default/support/sidebar.js +29 -0
  91. package/dist/client/theme-default/support/utils.js +43 -0
  92. package/dist/node/cli.js +3 -8
  93. package/dist/node/index.d.ts +104 -79
  94. package/dist/node/index.js +1 -1
  95. package/dist/node/{serve-3035f99b.js → serve-428d4610.js} +11418 -1415
  96. package/package.json +24 -20
  97. package/types/default-theme.d.ts +104 -79
  98. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
  99. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  100. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  101. package/dist/client/theme-default/components/EditLink.vue +0 -38
  102. package/dist/client/theme-default/components/Home.vue +0 -31
  103. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  104. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  105. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  106. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  107. package/dist/client/theme-default/components/NavBar.vue +0 -60
  108. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  109. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  110. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  111. package/dist/client/theme-default/components/NavLink.vue +0 -61
  112. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  113. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  114. package/dist/client/theme-default/components/Page.vue +0 -53
  115. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  116. package/dist/client/theme-default/components/SideBar.vue +0 -60
  117. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  118. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  119. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  120. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  121. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  122. package/dist/client/theme-default/composables/editLink.js +0 -49
  123. package/dist/client/theme-default/composables/navLink.js +0 -42
  124. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  125. package/dist/client/theme-default/composables/repo.js +0 -38
  126. package/dist/client/theme-default/composables/sideBar.js +0 -57
  127. package/dist/client/theme-default/styles/code.css +0 -299
  128. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  129. package/dist/client/theme-default/styles/layout.css +0 -236
  130. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  131. package/dist/client/theme-default/support/sideBar.js +0 -46
  132. package/dist/client/theme-default/utils.js +0 -63
@@ -1,31 +0,0 @@
1
- <template>
2
- <svg
3
- class="icon outbound"
4
- xmlns="http://www.w3.org/2000/svg"
5
- aria-hidden="true"
6
- x="0px"
7
- y="0px"
8
- viewBox="0 0 100 100"
9
- width="15"
10
- height="15"
11
- >
12
- <path
13
- fill="currentColor"
14
- d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"
15
- />
16
- <polygon
17
- fill="currentColor"
18
- points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"
19
- />
20
- </svg>
21
- </template>
22
-
23
- <style>
24
- .icon.outbound {
25
- position: relative;
26
- top: -1px;
27
- display: inline-block;
28
- vertical-align: middle;
29
- color: var(--c-text-lighter);
30
- }
31
- </style>
@@ -1,99 +0,0 @@
1
- import { onMounted, onUnmounted, onUpdated } from 'vue';
2
- export function useActiveSidebarLinks() {
3
- let rootActiveLink = null;
4
- let activeLink = null;
5
- const onScroll = throttleAndDebounce(setActiveLink, 300);
6
- function setActiveLink() {
7
- const sidebarLinks = getSidebarLinks();
8
- const anchors = getAnchors(sidebarLinks);
9
- for (let i = 0; i < anchors.length; i++) {
10
- const anchor = anchors[i];
11
- const nextAnchor = anchors[i + 1];
12
- const [isActive, hash] = isAnchorActive(i, anchor, nextAnchor);
13
- if (isActive) {
14
- history.replaceState(null, document.title, hash ? hash : ' ');
15
- activateLink(hash);
16
- return;
17
- }
18
- }
19
- }
20
- function activateLink(hash) {
21
- deactiveLink(activeLink);
22
- deactiveLink(rootActiveLink);
23
- activeLink = document.querySelector(`.sidebar a[href="${hash}"]`);
24
- if (!activeLink) {
25
- return;
26
- }
27
- activeLink.classList.add('active');
28
- // also add active class to parent h2 anchors
29
- const rootLi = activeLink.closest('.sidebar-links > ul > li');
30
- if (rootLi && rootLi !== activeLink.parentElement) {
31
- rootActiveLink = rootLi.querySelector('a');
32
- rootActiveLink && rootActiveLink.classList.add('active');
33
- }
34
- else {
35
- rootActiveLink = null;
36
- }
37
- }
38
- function deactiveLink(link) {
39
- link && link.classList.remove('active');
40
- }
41
- onMounted(() => {
42
- setActiveLink();
43
- window.addEventListener('scroll', onScroll);
44
- });
45
- onUpdated(() => {
46
- // sidebar update means a route change
47
- activateLink(decodeURIComponent(location.hash));
48
- });
49
- onUnmounted(() => {
50
- window.removeEventListener('scroll', onScroll);
51
- });
52
- }
53
- function getSidebarLinks() {
54
- return [].slice.call(document.querySelectorAll('.sidebar a.sidebar-link-item'));
55
- }
56
- function getAnchors(sidebarLinks) {
57
- return [].slice
58
- .call(document.querySelectorAll('.header-anchor'))
59
- .filter((anchor) => sidebarLinks.some((sidebarLink) => sidebarLink.hash === anchor.hash));
60
- }
61
- function getPageOffset() {
62
- return document.querySelector('.nav-bar').offsetHeight;
63
- }
64
- function getAnchorTop(anchor) {
65
- const pageOffset = getPageOffset();
66
- return anchor.parentElement.offsetTop - pageOffset - 15;
67
- }
68
- function isAnchorActive(index, anchor, nextAnchor) {
69
- const scrollTop = window.scrollY;
70
- if (index === 0 && scrollTop === 0) {
71
- return [true, null];
72
- }
73
- if (scrollTop < getAnchorTop(anchor)) {
74
- return [false, null];
75
- }
76
- if (!nextAnchor || scrollTop < getAnchorTop(nextAnchor)) {
77
- return [true, decodeURIComponent(anchor.hash)];
78
- }
79
- return [false, null];
80
- }
81
- function throttleAndDebounce(fn, delay) {
82
- let timeout;
83
- let called = false;
84
- return () => {
85
- if (timeout) {
86
- clearTimeout(timeout);
87
- }
88
- if (!called) {
89
- fn();
90
- called = true;
91
- setTimeout(() => {
92
- called = false;
93
- }, delay);
94
- }
95
- else {
96
- timeout = setTimeout(fn, delay);
97
- }
98
- };
99
- }
@@ -1,49 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useData } from 'vitepress';
3
- import { endingSlashRE, isExternal } from '../utils';
4
- const bitbucketRE = /bitbucket.org/;
5
- export function useEditLink() {
6
- const { page, theme, frontmatter } = useData();
7
- const url = computed(() => {
8
- const { repo, docsDir = '', docsBranch = 'master', docsRepo = repo, editLinks } = theme.value;
9
- const showEditLink = frontmatter.value.editLink != null
10
- ? frontmatter.value.editLink
11
- : editLinks;
12
- const { relativePath } = page.value;
13
- if (!showEditLink || !relativePath || !repo) {
14
- return null;
15
- }
16
- return createUrl(repo, docsRepo, docsDir, docsBranch, relativePath);
17
- });
18
- const text = computed(() => {
19
- return theme.value.editLinkText || 'Edit this page';
20
- });
21
- return {
22
- url,
23
- text
24
- };
25
- }
26
- function createUrl(repo, docsRepo, docsDir, docsBranch, path) {
27
- return bitbucketRE.test(repo)
28
- ? createBitbucketUrl(repo, docsRepo, docsDir, docsBranch, path)
29
- : createGitHubUrl(repo, docsRepo, docsDir, docsBranch, path);
30
- }
31
- function createGitHubUrl(repo, docsRepo, docsDir, docsBranch, path) {
32
- const base = isExternal(docsRepo)
33
- ? docsRepo
34
- : `https://github.com/${docsRepo}`;
35
- return (base.replace(endingSlashRE, '') +
36
- `/edit` +
37
- `/${docsBranch}/` +
38
- (docsDir ? docsDir.replace(endingSlashRE, '') + '/' : '') +
39
- path);
40
- }
41
- function createBitbucketUrl(repo, docsRepo, docsDir, docsBranch, path) {
42
- const base = isExternal(docsRepo) ? docsRepo : repo;
43
- return (base.replace(endingSlashRE, '') +
44
- `/src` +
45
- `/${docsBranch}/` +
46
- (docsDir ? docsDir.replace(endingSlashRE, '') + '/' : '') +
47
- path +
48
- `?mode=edit&spa=0&at=${docsBranch}&fileviewer=file-view-default`);
49
- }
@@ -1,42 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useRoute, withBase } from 'vitepress';
3
- import { isExternal as isExternalCheck } from '../utils';
4
- export function useNavLink(item) {
5
- const route = useRoute();
6
- const isExternal = isExternalCheck(item.value.link);
7
- const props = computed(() => {
8
- const routePath = normalizePath(`/${route.data.relativePath}`);
9
- let active = false;
10
- if (item.value.activeMatch) {
11
- active = new RegExp(item.value.activeMatch).test(routePath);
12
- }
13
- else {
14
- const itemPath = normalizePath(item.value.link);
15
- active =
16
- itemPath === '/'
17
- ? itemPath === routePath
18
- : routePath.startsWith(itemPath);
19
- }
20
- return {
21
- class: {
22
- active,
23
- isExternal
24
- },
25
- href: isExternal ? item.value.link : withBase(item.value.link),
26
- target: item.value.target || (isExternal ? `_blank` : null),
27
- rel: item.value.rel || (isExternal ? `noopener noreferrer` : null),
28
- 'aria-label': item.value.ariaLabel
29
- };
30
- });
31
- return {
32
- props,
33
- isExternal
34
- };
35
- }
36
- function normalizePath(path) {
37
- return path
38
- .replace(/#.*$/, '')
39
- .replace(/\?.*$/, '')
40
- .replace(/\.(html|md)$/, '')
41
- .replace(/\/index$/, '/');
42
- }
@@ -1,37 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useData } from 'vitepress';
3
- import { isArray, ensureStartingSlash, removeExtention } from '../utils';
4
- import { getSideBarConfig, getFlatSideBarLinks } from '../support/sideBar';
5
- export function useNextAndPrevLinks() {
6
- const { page, theme } = useData();
7
- const path = computed(() => {
8
- return removeExtention(ensureStartingSlash(page.value.relativePath));
9
- });
10
- const candidates = computed(() => {
11
- const config = getSideBarConfig(theme.value.sidebar, path.value);
12
- return isArray(config) ? getFlatSideBarLinks(config) : [];
13
- });
14
- const index = computed(() => {
15
- return candidates.value.findIndex((item) => {
16
- return item.link === path.value;
17
- });
18
- });
19
- const next = computed(() => {
20
- if (theme.value.nextLinks !== false &&
21
- index.value > -1 &&
22
- index.value < candidates.value.length - 1) {
23
- return candidates.value[index.value + 1];
24
- }
25
- });
26
- const prev = computed(() => {
27
- if (theme.value.prevLinks !== false && index.value > 0) {
28
- return candidates.value[index.value - 1];
29
- }
30
- });
31
- const hasLinks = computed(() => !!next.value || !!prev.value);
32
- return {
33
- next,
34
- prev,
35
- hasLinks
36
- };
37
- }
@@ -1,38 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useData } from 'vitepress';
3
- import { EXTERNAL_URL_RE } from '../../shared';
4
- export const platforms = ['GitHub', 'GitLab', 'Bitbucket'].map((platform) => {
5
- return [platform, new RegExp(platform, 'i')];
6
- });
7
- export function useRepo() {
8
- const { site } = useData();
9
- return computed(() => {
10
- const theme = site.value.themeConfig;
11
- const name = theme.docsRepo || theme.repo;
12
- if (!name) {
13
- return null;
14
- }
15
- const link = getRepoUrl(name);
16
- const text = getRepoText(link, theme.repoLabel);
17
- return { text, link };
18
- });
19
- }
20
- function getRepoUrl(repo) {
21
- // if the full url is not provided, default to GitHub repo
22
- return EXTERNAL_URL_RE.test(repo) ? repo : `https://github.com/${repo}`;
23
- }
24
- function getRepoText(url, text) {
25
- if (text) {
26
- return text;
27
- }
28
- // if no label is provided, deduce it from the repo url
29
- const hosts = url.match(/^https?:\/\/[^/]+/);
30
- if (!hosts) {
31
- return 'Source';
32
- }
33
- const platform = platforms.find(([_p, re]) => re.test(hosts[0]));
34
- if (platform && platform[0]) {
35
- return platform[0];
36
- }
37
- return 'Source';
38
- }
@@ -1,57 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useRoute, useData } from 'vitepress';
3
- import { useActiveSidebarLinks } from '../composables/activeSidebarLink';
4
- import { getSideBarConfig } from '../support/sideBar';
5
- export function useSideBar() {
6
- const route = useRoute();
7
- const { site } = useData();
8
- useActiveSidebarLinks();
9
- return computed(() => {
10
- // at first, we'll check if we can find the sidebar setting in frontmatter.
11
- const headers = route.data.headers;
12
- const frontSidebar = route.data.frontmatter.sidebar;
13
- const sidebarDepth = route.data.frontmatter.sidebarDepth;
14
- // if it's `false`, we'll just return an empty array here.
15
- if (frontSidebar === false) {
16
- return [];
17
- }
18
- // if it's `auto`, render headers of the current page
19
- if (frontSidebar === 'auto') {
20
- return resolveAutoSidebar(headers, sidebarDepth);
21
- }
22
- // now, there's no sidebar setting at frontmatter; let's see the configs
23
- const themeSidebar = getSideBarConfig(site.value.themeConfig.sidebar, route.data.relativePath);
24
- if (themeSidebar === false) {
25
- return [];
26
- }
27
- if (themeSidebar === 'auto') {
28
- return resolveAutoSidebar(headers, sidebarDepth);
29
- }
30
- return themeSidebar;
31
- });
32
- }
33
- function resolveAutoSidebar(headers, depth) {
34
- const ret = [];
35
- if (headers === undefined) {
36
- return [];
37
- }
38
- let lastH2 = undefined;
39
- headers.forEach(({ level, title, slug }) => {
40
- if (level - 1 > depth) {
41
- return;
42
- }
43
- const item = {
44
- text: title,
45
- link: `#${slug}`
46
- };
47
- if (level === 2) {
48
- lastH2 = item;
49
- ret.push(item);
50
- }
51
- else if (lastH2) {
52
- ;
53
- (lastH2.children || (lastH2.children = [])).push(item);
54
- }
55
- });
56
- return ret;
57
- }
@@ -1,299 +0,0 @@
1
- code {
2
- margin: 0;
3
- border-radius: 3px;
4
- padding: 0.25rem 0.5rem;
5
- font-family: var(--code-font-family);
6
- font-size: 0.85em;
7
- color: var(--c-text-light);
8
- background-color: var(--code-inline-bg-color);
9
- }
10
-
11
- code .token.deleted {
12
- color: #ec5975;
13
- }
14
-
15
- code .token.inserted {
16
- color: var(--c-brand);
17
- }
18
-
19
- div[class*='language-'] {
20
- position: relative;
21
- margin: 1rem -1.5rem;
22
- background-color: var(--code-bg-color);
23
- overflow-x: auto;
24
- }
25
-
26
- li > div[class*='language-'] {
27
- border-radius: 6px 0 0 6px;
28
- margin: 1rem -1.5rem 1rem -1.25rem;
29
- line-height: initial;
30
- }
31
-
32
- @media (min-width: 420px) {
33
- div[class*='language-'] {
34
- margin: 1rem 0;
35
- border-radius: 6px;
36
- }
37
-
38
- li > div[class*='language-'] {
39
- margin: 1rem 0 1rem 0rem;
40
- border-radius: 6px;
41
- }
42
- }
43
-
44
- [class*='language-'] pre,
45
- [class*='language-'] code {
46
- text-align: left;
47
- white-space: pre;
48
- word-spacing: normal;
49
- word-break: normal;
50
- word-wrap: normal;
51
- -moz-tab-size: 4;
52
- -o-tab-size: 4;
53
- tab-size: 4;
54
- -webkit-hyphens: none;
55
- -moz-hyphens: none;
56
- -ms-hyphens: none;
57
- hyphens: none;
58
- background: transparent;
59
- }
60
-
61
- [class*='language-'] pre {
62
- position: relative;
63
- z-index: 1;
64
- margin: 0;
65
- padding: 1.25rem 1.5rem;
66
- overflow-x: auto;
67
- }
68
-
69
- [class*='language-'] code {
70
- padding: 0;
71
- line-height: var(--code-line-height);
72
- font-size: var(--code-font-size);
73
- color: #eee;
74
- }
75
-
76
- /* Line highlighting */
77
-
78
- .highlight-lines {
79
- position: absolute;
80
- top: 0;
81
- bottom: 0;
82
- left: 0;
83
- padding: 1.25rem 0;
84
- width: 100%;
85
- line-height: var(--code-line-height);
86
- font-family: var(--code-font-family);
87
- font-size: var(--code-font-size);
88
- user-select: none;
89
- overflow: hidden;
90
- }
91
-
92
- .highlight-lines .highlighted {
93
- background-color: rgba(0, 0, 0, 0.66);
94
- }
95
-
96
- /* Line numbers mode */
97
-
98
- div[class*='language-'].line-numbers-mode {
99
- padding-left: 3.5rem;
100
- }
101
-
102
- .line-numbers-wrapper {
103
- position: absolute;
104
- top: 0;
105
- bottom: 0;
106
- left: 0;
107
- z-index: 3;
108
- border-right: 1px solid rgba(0, 0, 0, 0.5);
109
- padding: 1.25rem 0;
110
- width: 3.5rem;
111
- text-align: center;
112
- line-height: var(--code-line-height);
113
- font-family: var(--code-font-family);
114
- font-size: var(--code-font-size);
115
- color: #888;
116
- }
117
-
118
- /* Language marker */
119
-
120
- div[class*='language-']:before {
121
- position: absolute;
122
- top: 0.6em;
123
- right: 1em;
124
- z-index: 2;
125
- font-size: 0.8rem;
126
- color: #888;
127
- }
128
-
129
- div[class~='language-html']:before,
130
- div[class~='language-markup']:before {
131
- content: 'html';
132
- }
133
-
134
- div[class~='language-md']:before,
135
- div[class~='language-markdown']:before {
136
- content: 'md';
137
- }
138
-
139
- div[class~='language-css']:before {
140
- content: 'css';
141
- }
142
-
143
- div[class~='language-sass']:before {
144
- content: 'sass';
145
- }
146
-
147
- div[class~='language-scss']:before {
148
- content: 'scss';
149
- }
150
-
151
- div[class~='language-less']:before {
152
- content: 'less';
153
- }
154
-
155
- div[class~='language-stylus']:before {
156
- content: 'styl';
157
- }
158
-
159
- div[class~='language-js']:before,
160
- div[class~='language-javascript']:before {
161
- content: 'js';
162
- }
163
-
164
- div[class~='language-ts']:before,
165
- div[class~='language-typescript']:before {
166
- content: 'ts';
167
- }
168
-
169
- div[class~='language-json']:before {
170
- content: 'json';
171
- }
172
-
173
- div[class~='language-rb']:before,
174
- div[class~='language-ruby']:before {
175
- content: 'rb';
176
- }
177
-
178
- div[class~='language-py']:before,
179
- div[class~='language-python']:before {
180
- content: 'py';
181
- }
182
-
183
- div[class~='language-sh']:before,
184
- div[class~='language-bash']:before {
185
- content: 'sh';
186
- }
187
-
188
- div[class~='language-php']:before {
189
- content: 'php';
190
- }
191
-
192
- div[class~='language-go']:before {
193
- content: 'go';
194
- }
195
-
196
- div[class~='language-rust']:before {
197
- content: 'rust';
198
- }
199
-
200
- div[class~='language-java']:before {
201
- content: 'java';
202
- }
203
-
204
- div[class~='language-c']:before {
205
- content: 'c';
206
- }
207
-
208
- div[class~='language-yaml']:before {
209
- content: 'yaml';
210
- }
211
-
212
- div[class~='language-dockerfile']:before {
213
- content: 'dockerfile';
214
- }
215
-
216
- div[class~='language-vue']:before {
217
- content: 'vue';
218
- }
219
-
220
- /**
221
- * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML.
222
- * Based on https://github.com/chriskempson/tomorrow-theme
223
- *
224
- * @author Rose Pritchard
225
- */
226
- .token.comment,
227
- .token.block-comment,
228
- .token.prolog,
229
- .token.doctype,
230
- .token.cdata {
231
- color: #999;
232
- }
233
-
234
- .token.punctuation {
235
- color: #ccc;
236
- }
237
-
238
- .token.tag,
239
- .token.attr-name,
240
- .token.namespace,
241
- .token.deleted {
242
- color: #e2777a;
243
- }
244
-
245
- .token.function-name {
246
- color: #6196cc;
247
- }
248
-
249
- .token.boolean,
250
- .token.number,
251
- .token.function {
252
- color: #f08d49;
253
- }
254
-
255
- .token.property,
256
- .token.class-name,
257
- .token.constant,
258
- .token.symbol {
259
- color: #f8c555;
260
- }
261
-
262
- .token.selector,
263
- .token.important,
264
- .token.atrule,
265
- .token.keyword,
266
- .token.builtin {
267
- color: #cc99cd;
268
- }
269
-
270
- .token.string,
271
- .token.char,
272
- .token.attr-value,
273
- .token.regex,
274
- .token.variable {
275
- color: #7ec699;
276
- }
277
-
278
- .token.operator,
279
- .token.entity,
280
- .token.url {
281
- color: #67cdcc;
282
- }
283
-
284
- .token.important,
285
- .token.bold {
286
- font-weight: bold;
287
- }
288
-
289
- .token.italic {
290
- font-style: italic;
291
- }
292
-
293
- .token.entity {
294
- cursor: help;
295
- }
296
-
297
- .token.inserted {
298
- color: green;
299
- }