vitepress 1.0.0-draft.4 → 1.0.0-draft.5

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 (64) hide show
  1. package/README.md +3 -1
  2. package/bin/vitepress.js +1 -1
  3. package/dist/client/app/index.js +1 -5
  4. package/dist/client/index.d.ts +123 -137
  5. package/dist/client/index.js +1 -2
  6. package/dist/client/theme-default/Layout.vue +7 -0
  7. package/dist/client/theme-default/NotFound.vue +74 -14
  8. package/dist/client/theme-default/components/VPBox.vue +1 -5
  9. package/dist/client/theme-default/components/VPCarbonAds.vue +90 -0
  10. package/dist/client/theme-default/components/VPContent.vue +11 -1
  11. package/dist/client/theme-default/components/VPDoc.vue +25 -34
  12. package/dist/client/theme-default/components/VPDocAside.vue +34 -0
  13. package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
  14. package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +3 -3
  15. package/dist/client/theme-default/components/VPDocAsideSponsors.vue +32 -0
  16. package/dist/client/theme-default/components/VPDocFooter.vue +1 -1
  17. package/dist/client/theme-default/components/VPFlyout.vue +2 -3
  18. package/dist/client/theme-default/components/VPFooter.vue +1 -1
  19. package/dist/client/theme-default/components/VPHero.vue +3 -3
  20. package/dist/client/theme-default/components/VPHomeSponsors.vue +3 -3
  21. package/dist/client/theme-default/components/VPLink.vue +2 -1
  22. package/dist/client/theme-default/components/VPLocalNav.vue +1 -1
  23. package/dist/client/theme-default/components/VPMenu.vue +8 -13
  24. package/dist/client/theme-default/components/VPMenuLink.vue +10 -4
  25. package/dist/client/theme-default/components/VPNav.vue +18 -1
  26. package/dist/client/theme-default/components/VPNavBar.vue +19 -7
  27. package/dist/client/theme-default/components/VPNavBarExtra.vue +20 -41
  28. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +2 -8
  29. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +3 -3
  30. package/dist/client/theme-default/components/VPNavBarSearch.vue +6 -6
  31. package/dist/client/theme-default/components/VPNavBarTitle.vue +4 -2
  32. package/dist/client/theme-default/components/VPNavBarTranslations.vue +10 -39
  33. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +1 -2
  34. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +1 -1
  35. package/dist/client/theme-default/components/VPSidebar.vue +10 -4
  36. package/dist/client/theme-default/components/VPSidebarGroup.vue +80 -17
  37. package/dist/client/theme-default/components/VPSidebarLink.vue +2 -9
  38. package/dist/client/theme-default/components/VPSocialLink.vue +2 -2
  39. package/dist/client/theme-default/components/VPSocialLinks.vue +1 -1
  40. package/dist/client/theme-default/components/VPSponsors.vue +15 -40
  41. package/dist/client/theme-default/components/VPSponsorsGrid.vue +2 -2
  42. package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
  43. package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
  44. package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
  45. package/dist/client/theme-default/composables/aside.js +17 -0
  46. package/dist/client/theme-default/composables/copy-code.js +33 -0
  47. package/dist/client/theme-default/composables/outline.js +3 -3
  48. package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
  49. package/dist/client/theme-default/index.js +1 -0
  50. package/dist/client/theme-default/styles/base.css +9 -1
  51. package/dist/client/theme-default/styles/components/custom-block.css +2 -2
  52. package/dist/client/theme-default/styles/components/vp-doc.css +98 -107
  53. package/dist/client/theme-default/styles/components/vp-sponsor.css +51 -7
  54. package/dist/client/theme-default/styles/vars.css +42 -27
  55. package/dist/node/cli.js +32 -31
  56. package/dist/node/index.d.ts +371 -364
  57. package/dist/node/index.js +22 -37
  58. package/dist/node/serve-f7c10936.js +64795 -0
  59. package/dist/node-cjs/cli.cjs +304 -0
  60. package/dist/node-cjs/index.cjs +38 -0
  61. package/dist/{node/serve-b3182d88.js → node-cjs/serve-c220f0a8.cjs} +27417 -28632
  62. package/package.json +46 -38
  63. package/theme.d.ts +7 -2
  64. package/types/default-theme.d.ts +15 -2
@@ -18,14 +18,16 @@ const { hasSidebar } = useSidebar()
18
18
  <style scoped>
19
19
  .VPNavBarTitle {
20
20
  flex-shrink: 0;
21
+ border-bottom: 1px solid transparent;
22
+ transition: background-color 0.5s;
21
23
  }
22
24
 
23
25
  @media (min-width: 960px) {
24
26
  .VPNavBarTitle.has-sidebar {
25
27
  margin-right: 32px;
26
28
  width: calc(var(--vp-sidebar-width) - 64px);
27
- border-bottom: 1px solid var(--vp-c-divider-light);
28
- background-color: var(--vp-c-bg-sidebar);
29
+ border-bottom-color: var(--vp-c-divider-light);
30
+ background-color: var(--vp-c-bg-alt);
29
31
  }
30
32
  }
31
33
 
@@ -1,16 +1,10 @@
1
1
  <script lang="ts" setup>
2
- import { ref } from 'vue'
3
2
  import { useData } from 'vitepress'
4
3
  import VPIconLanguages from './icons/VPIconLanguages.vue'
5
4
  import VPFlyout from './VPFlyout.vue'
5
+ import VPMenuLink from './VPMenuLink.vue'
6
6
 
7
7
  const { theme } = useData()
8
-
9
- const isOpen = ref(false)
10
-
11
- function toggle() {
12
- isOpen.value = !isOpen.value
13
- }
14
8
  </script>
15
9
 
16
10
  <template>
@@ -19,16 +13,12 @@ function toggle() {
19
13
  class="VPNavBarTranslations"
20
14
  :icon="VPIconLanguages"
21
15
  >
22
- <div class="container">
23
- <p class="title">
24
- {{ theme.localeLinks.text }}
25
- </p>
16
+ <div class="items">
17
+ <p class="title">{{ theme.localeLinks.text }}</p>
26
18
 
27
- <ul class="list">
28
- <li v-for="locale in theme.localeLinks.items" :key="locale.link" class="lang">
29
- <a class="link" :href="locale.link">{{ locale.text }}</a>
30
- </li>
31
- </ul>
19
+ <template v-for="locale in theme.localeLinks.items" :key="locale.link">
20
+ <VPMenuLink :item="locale" />
21
+ </template>
32
22
  </div>
33
23
  </VPFlyout>
34
24
  </template>
@@ -45,30 +35,11 @@ function toggle() {
45
35
  }
46
36
  }
47
37
 
48
- .container {
49
- padding: 0 16px;
50
- }
51
-
52
38
  .title {
53
- display: flex;
54
- align-items: center;
55
- font-size: 13px;
56
- font-weight: 600;
57
- color: var(--vp-c-text-1);
58
- }
59
-
60
- .lang {
61
- padding: 4px 0 0 0;
62
- }
63
-
64
- .link {
65
- line-height: 28px;
66
- font-size: 13px;
39
+ padding: 0 24px 0 12px;
40
+ line-height: 32px;
41
+ font-size: 14px;
42
+ font-weight: 700;
67
43
  color: var(--vp-c-text-1);
68
- transition: color 0.25s;
69
- }
70
-
71
- .link:hover {
72
- color: var(--vp-c-brand);
73
44
  }
74
45
  </style>
@@ -1,13 +1,12 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed, ref } from 'vue'
3
- import { DefaultTheme } from 'vitepress'
4
3
  import VPIconPlus from './icons/VPIconPlus.vue'
5
4
  import VPNavScreenMenuGroupLink from './VPNavScreenMenuGroupLink.vue'
6
5
  import VPNavScreenMenuGroupSection from './VPNavScreenMenuGroupSection.vue'
7
6
 
8
7
  const props = defineProps<{
9
8
  text: string
10
- items: DefaultTheme.NavItemChild[]
9
+ items: any[]
11
10
  }>()
12
11
 
13
12
  const isOpen = ref(false)
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { DefaultTheme } from 'vitepress'
2
+ import { DefaultTheme } from '../config'
3
3
  import VPNavScreenMenuGroupLink from './VPNavScreenMenuGroupLink.vue'
4
4
 
5
5
  defineProps<{
@@ -34,7 +34,12 @@ watchPostEffect(async () => {
34
34
  </span>
35
35
 
36
36
  <div v-for="group in sidebar" :key="group.text" class="group">
37
- <VPSidebarGroup :text="group.text" :items="group.items" />
37
+ <VPSidebarGroup
38
+ :text="group.text"
39
+ :items="group.items"
40
+ :collapsible="group.collapsible"
41
+ :collapsed="group.collapsed"
42
+ />
38
43
  </div>
39
44
  </nav>
40
45
  </aside>
@@ -80,7 +85,7 @@ watchPostEffect(async () => {
80
85
  width: var(--vp-sidebar-width);
81
86
  max-width: 100%;
82
87
  width: var(--vp-sidebar-width);
83
- background-color: var(--vp-c-bg-sidebar);
88
+ background-color: var(--vp-c-bg-alt);
84
89
  opacity: 1;
85
90
  visibility: visible;
86
91
  box-shadow: none;
@@ -103,12 +108,13 @@ watchPostEffect(async () => {
103
108
  .group + .group {
104
109
  margin-top: 32px;
105
110
  border-top: 1px solid var(--vp-c-divider-light);
106
- padding-top: 8px;
111
+ padding-top: 10px;
107
112
  }
108
113
 
109
114
  @media (min-width: 960px) {
110
115
  .group {
111
- padding-top: 8px;
116
+ padding-top: 10px;
117
+ width: calc(var(--vp-sidebar-width) - 64px);
112
118
  }
113
119
 
114
120
  .group + .group {
@@ -1,44 +1,107 @@
1
1
  <script lang="ts" setup>
2
- import { useData } from 'vitepress'
2
+ import { ref } from 'vue'
3
3
  import { DefaultTheme } from '../config'
4
+ import VPIconPlusSquare from './icons/VPIconPlusSquare.vue'
5
+ import VPIconMinusSquare from './icons/VPIconMinusSquare.vue'
4
6
  import VPSidebarLink from './VPSidebarLink.vue'
5
7
 
6
8
  const props = defineProps<{
7
9
  text: string
8
10
  items: DefaultTheme.SidebarItem[]
11
+ collapsible?: boolean
12
+ collapsed?: boolean
9
13
  }>()
10
14
 
11
- const { page } = useData()
15
+ const collapsed = ref(props.collapsible && props.collapsed)
16
+
17
+ function toggle() {
18
+ if (props.collapsible) {
19
+ collapsed.value = !collapsed.value
20
+ }
21
+ }
12
22
  </script>
13
23
 
14
24
  <template>
15
- <section class="VPSidebarGroup">
16
- <div class="title">
25
+ <section class="VPSidebarGroup" :class="{ collapsible, collapsed }">
26
+ <div class="title" :role="collapsible ? 'button' : undefined" @click="toggle">
17
27
  <h2 class="title-text">{{ text }}</h2>
28
+ <div class="action">
29
+ <VPIconMinusSquare class="icon minus" />
30
+ <VPIconPlusSquare class="icon plus" />
31
+ </div>
18
32
  </div>
19
33
 
20
- <template v-for="item in items" :key="item.link">
21
- <VPSidebarLink :item="item" />
22
- </template>
34
+ <div class="items">
35
+ <template v-for="item in items" :key="item.link">
36
+ <VPSidebarLink :item="item" />
37
+ </template>
38
+ </div>
23
39
  </section>
24
40
  </template>
25
41
 
26
42
  <style scoped>
27
43
  .title {
28
- padding: 6px 0;
29
- }
30
-
31
- @media (min-width: 960px) {
32
- .title {
33
- padding: 4px 0;
34
- }
44
+ display: flex;
45
+ justify-content: space-between;
46
+ align-items: flex-start;
47
+ z-index: 2;
35
48
  }
36
49
 
37
50
  .title-text {
51
+ padding-top: 6px;
52
+ padding-bottom: 6px;
38
53
  line-height: 20px;
39
- font-size: 13px;
40
- font-weight: 600;
54
+ font-size: 14px;
55
+ font-weight: 700;
41
56
  color: var(--vp-c-text-1);
42
- transition: color 0.5s;
57
+ }
58
+
59
+ .action {
60
+ display: none;
61
+ position: relative;
62
+ margin-right: -8px;
63
+ border-radius: 4px;
64
+ width: 32px;
65
+ height: 32px;
66
+ color: var(--vp-c-text-3);
67
+ transition: color 0.25s;
68
+ }
69
+
70
+ .VPSidebarGroup.collapsible .action {
71
+ display: block;
72
+ }
73
+
74
+ .title:hover .action {
75
+ color: var(--vp-c-text-2);
76
+ }
77
+
78
+ .icon {
79
+ position: absolute;
80
+ top: 8px;
81
+ left: 8px;
82
+ width: 16px;
83
+ height: 16px;
84
+ fill: currentColor;
85
+ }
86
+
87
+ .icon.minus { opacity: 1; }
88
+ .icon.plus { opacity: 0; }
89
+
90
+ .VPSidebarGroup.collapsed .icon.minus { opacity: 0; }
91
+ .VPSidebarGroup.collapsed .icon.plus { opacity: 1; }
92
+
93
+ .items {
94
+ overflow: hidden;
95
+ }
96
+
97
+ .VPSidebarGroup.collapsed .items {
98
+ margin-bottom: -22px;
99
+ max-height: 0;
100
+ }
101
+
102
+ @media (min-width: 960px) {
103
+ .VPSidebarGroup.collapsed .items {
104
+ margin-bottom: -14px;
105
+ }
43
106
  }
44
107
  </style>
@@ -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-brand);
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: 13px;
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 'vitepress'
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
- const props = defineProps<{
12
+ defineProps<{
13
13
  icon: DefaultTheme.SocialLinkIcon
14
14
  link: string
15
15
  }>()
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { DefaultTheme } from 'vitepress'
2
+ import { DefaultTheme } from '../config'
3
3
  import VPSocialLink from './VPSocialLink.vue'
4
4
 
5
5
  defineProps<{
@@ -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: Sposors[] | Sponsor[]
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: any) => s.items)
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 v-for="(sponsor, index) in sponsors" :key="index" class="section">
41
- <h3 v-if="sponsor.tier" class="tier">{{ sponsor.tier }}</h3>
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,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
+ <path d="M22,13H2a1,1,0,0,1,0-2H22a1,1,0,0,1,0,2Z" />
4
+ </svg>
5
+ </template>
@@ -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 { useMediaQuery } from '@vueuse/core';
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 isOutlineEnabled = useMediaQuery('(min-width: 1280px)');
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 (!isOutlineEnabled.value) {
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 set
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 want 5 columns, if we only have 1 sponsor yet, we would
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(options) {
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(options.el.value, options.size);
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-content);
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,
@@ -2,7 +2,7 @@
2
2
  border: 1px solid transparent;
3
3
  border-radius: 8px;
4
4
  padding: 16px 16px 8px;
5
- line-height: 20px;
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 {