vitepress 1.0.0-draft.1 → 1.0.0-draft.2

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 (101) hide show
  1. package/dist/client/index.d.ts +5 -0
  2. package/dist/client/shared.js +1 -0
  3. package/dist/client/theme-default/Layout.vue +18 -1
  4. package/dist/client/theme-default/components/VPBackdrop.vue +1 -1
  5. package/dist/client/theme-default/components/VPBox.vue +59 -0
  6. package/dist/client/theme-default/components/VPButton.vue +123 -0
  7. package/dist/client/theme-default/components/VPContent.vue +35 -5
  8. package/dist/client/theme-default/components/{VPContentDoc.vue → VPDoc.vue} +13 -13
  9. package/dist/client/theme-default/components/{VPContentDocFooter.vue → VPDocFooter.vue} +3 -2
  10. package/dist/client/theme-default/components/{VPContentDocOutline.vue → VPDocOutline.vue} +2 -2
  11. package/dist/client/theme-default/components/VPFooter.vue +53 -0
  12. package/dist/client/theme-default/components/VPHero.vue +144 -0
  13. package/dist/client/theme-default/components/VPHome.vue +33 -0
  14. package/dist/client/theme-default/components/VPHomeFeatures.vue +96 -0
  15. package/dist/client/theme-default/components/VPHomeHero.vue +17 -0
  16. package/dist/client/theme-default/components/VPHomeSponsors.vue +97 -0
  17. package/dist/client/theme-default/components/VPNavBar.vue +1 -0
  18. package/dist/client/theme-default/components/VPNavBarAppearance.vue +4 -1
  19. package/dist/client/theme-default/components/VPNavBarExtra.vue +2 -2
  20. package/dist/client/theme-default/components/VPNavBarSearch.vue +3 -3
  21. package/dist/client/theme-default/components/VPNavBarTitle.vue +26 -13
  22. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +4 -1
  23. package/dist/client/theme-default/components/VPPage.vue +5 -0
  24. package/dist/client/theme-default/components/VPSponsors.vue +77 -0
  25. package/dist/client/theme-default/components/VPSponsorsGrid.vue +32 -0
  26. package/dist/client/theme-default/components/VPSwitchAppearance.vue +3 -3
  27. package/dist/client/theme-default/components/icons/VPIconHeart.vue +5 -0
  28. package/dist/client/theme-default/composables/outline.js +1 -19
  29. package/dist/client/theme-default/composables/sponsor-grid.js +92 -0
  30. package/dist/client/theme-default/composables/sponsor.js +87 -0
  31. package/dist/client/theme-default/index.js +4 -0
  32. package/dist/client/theme-default/styles/base.css +3 -0
  33. package/dist/client/theme-default/styles/vars.css +86 -1
  34. package/dist/client/theme-default/styles/vp-doc.css +8 -2
  35. package/dist/client/theme-default/styles/vp-sponsor.css +86 -0
  36. package/dist/client/theme-default/support/utils.js +19 -0
  37. package/dist/node/alias.js +60 -0
  38. package/dist/node/alias.js.map +1 -0
  39. package/dist/node/build/build.js +57 -0
  40. package/dist/node/build/build.js.map +1 -0
  41. package/dist/node/build/buildMPAClient.js +44 -0
  42. package/dist/node/build/buildMPAClient.js.map +1 -0
  43. package/dist/node/build/bundle.js +163 -0
  44. package/dist/node/build/bundle.js.map +1 -0
  45. package/dist/node/build/render.js +185 -0
  46. package/dist/node/build/render.js.map +1 -0
  47. package/dist/node/cli.js +37 -294
  48. package/dist/node/cli.js.map +1 -0
  49. package/dist/node/config.js +176 -0
  50. package/dist/node/config.js.map +1 -0
  51. package/dist/node/index.d.ts +19 -1
  52. package/dist/node/index.js +22 -37
  53. package/dist/node/index.js.map +1 -0
  54. package/dist/node/markdown/markdown.js +75 -0
  55. package/dist/node/markdown/markdown.js.map +1 -0
  56. package/dist/node/markdown/plugins/component.js +86 -0
  57. package/dist/node/markdown/plugins/component.js.map +1 -0
  58. package/dist/node/markdown/plugins/containers.js +41 -0
  59. package/dist/node/markdown/plugins/containers.js.map +1 -0
  60. package/dist/node/markdown/plugins/headings.js +25 -0
  61. package/dist/node/markdown/plugins/headings.js.map +1 -0
  62. package/dist/node/markdown/plugins/highlight.js +53 -0
  63. package/dist/node/markdown/plugins/highlight.js.map +1 -0
  64. package/dist/node/markdown/plugins/highlightLines.js +48 -0
  65. package/dist/node/markdown/plugins/highlightLines.js.map +1 -0
  66. package/dist/node/markdown/plugins/hoist.js +22 -0
  67. package/dist/node/markdown/plugins/hoist.js.map +1 -0
  68. package/dist/node/markdown/plugins/image.js +17 -0
  69. package/dist/node/markdown/plugins/image.js.map +1 -0
  70. package/dist/node/markdown/plugins/lineNumbers.js +23 -0
  71. package/dist/node/markdown/plugins/lineNumbers.js.map +1 -0
  72. package/dist/node/markdown/plugins/link.js +85 -0
  73. package/dist/node/markdown/plugins/link.js.map +1 -0
  74. package/dist/node/markdown/plugins/preWrapper.js +22 -0
  75. package/dist/node/markdown/plugins/preWrapper.js.map +1 -0
  76. package/dist/node/markdown/plugins/slugify.js +26 -0
  77. package/dist/node/markdown/plugins/slugify.js.map +1 -0
  78. package/dist/node/markdown/plugins/snippet.js +146 -0
  79. package/dist/node/markdown/plugins/snippet.js.map +1 -0
  80. package/dist/node/markdownToVue.js +166 -0
  81. package/dist/node/markdownToVue.js.map +1 -0
  82. package/dist/node/plugin.js +227 -0
  83. package/dist/node/plugin.js.map +1 -0
  84. package/dist/node/serve/serve.js +59 -0
  85. package/dist/node/serve/serve.js.map +1 -0
  86. package/dist/node/{serve-428d4610.js → serve-b5dc02b2.js} +26 -2
  87. package/dist/node/server.js +18 -0
  88. package/dist/node/server.js.map +1 -0
  89. package/dist/node/shared.js +72 -0
  90. package/dist/node/shared.js.map +1 -0
  91. package/dist/node/staticDataPlugin.js +99 -0
  92. package/dist/node/staticDataPlugin.js.map +1 -0
  93. package/dist/node/utils/getGitTimestamp.js +17 -0
  94. package/dist/node/utils/getGitTimestamp.js.map +1 -0
  95. package/dist/node/utils/parseHeader.js +57 -0
  96. package/dist/node/utils/parseHeader.js.map +1 -0
  97. package/dist/node/utils/slash.js +8 -0
  98. package/dist/node/utils/slash.js.map +1 -0
  99. package/package.json +4 -2
  100. package/types/default-theme.d.ts +12 -0
  101. package/types/shared.d.ts +11 -6
@@ -68,17 +68,22 @@ export declare interface Router {
68
68
 
69
69
  export declare interface SiteData<ThemeConfig = any> {
70
70
  base: string
71
+
71
72
  /**
72
73
  * Language of the site as it should be set on the `html` element.
74
+ *
73
75
  * @example `en-US`, `zh-CN`
74
76
  */
75
77
  lang: string
78
+
76
79
  title: string
77
80
  description: string
78
81
  head: HeadConfig[]
82
+ appearance: boolean
79
83
  themeConfig: ThemeConfig
80
84
  scrollOffset: number | string
81
85
  locales: Record<string, LocaleConfig>
86
+
82
87
  /**
83
88
  * Available locales for the site when it has defined `locales` in its
84
89
  * `themeConfig`. This object is otherwise empty. Keys are paths like `/` or
@@ -1,4 +1,5 @@
1
1
  export const EXTERNAL_URL_RE = /^https?:/i;
2
+ export const APPEARANCE_KEY = 'vitepress-theme-appearance';
2
3
  // @ts-ignore
3
4
  export const inBrowser = typeof window !== 'undefined';
4
5
  function findMatchRoot(route, roots) {
@@ -7,6 +7,7 @@ import VPNav from './components/VPNav.vue'
7
7
  import VPLocalNav from './components/VPLocalNav.vue'
8
8
  import VPSidebar from './components/VPSidebar.vue'
9
9
  import VPContent from './components/VPContent.vue'
10
+ import VPFooter from './components/VPFooter.vue'
10
11
 
11
12
  const {
12
13
  isOpen: isSidebarOpen,
@@ -26,6 +27,22 @@ provide('close-sidebar', closeSidebar)
26
27
  <VPNav />
27
28
  <VPLocalNav :open="isSidebarOpen" @open-menu="openSidebar" />
28
29
  <VPSidebar :open="isSidebarOpen" />
29
- <VPContent />
30
+
31
+ <VPContent>
32
+ <template #home-hero-before><slot name="home-hero-before" /></template>
33
+ <template #home-hero-after><slot name="home-hero-after" /></template>
34
+ <template #home-features-before><slot name="home-features-before" /></template>
35
+ <template #home-features-after><slot name="home-features-after" /></template>
36
+ </VPContent>
37
+
38
+ <VPFooter />
30
39
  </div>
31
40
  </template>
41
+
42
+ <style scoped>
43
+ .Layout {
44
+ display: flex;
45
+ flex-direction: column;
46
+ min-height: 100vh;
47
+ }
48
+ </style>
@@ -17,7 +17,7 @@ defineProps<{
17
17
  right: 0;
18
18
  bottom: 0;
19
19
  left: 0;
20
- z-index: var(--vp-z-backdrop);
20
+ z-index: var(--vp-z-index-backdrop);
21
21
  background: rgba(0, 0, 0, .6);
22
22
  transition: opacity 0.5s;
23
23
  }
@@ -0,0 +1,59 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ icon?: string
4
+ title: string
5
+ details: string
6
+ }>()
7
+ </script>
8
+
9
+ <template>
10
+ <article class="VPBox">
11
+ <div v-if="icon" class="icon">{{ icon }}</div>
12
+ <h1 class="title">{{ title }}</h1>
13
+ <p class="details">{{ details }}</p>
14
+ </article>
15
+ </template>
16
+
17
+ <style scoped>
18
+ .VPBox {
19
+ border: 1px solid var(--vp-c-divider-light);
20
+ border-radius: 8px;
21
+ padding: 24px;
22
+ height: 100%;
23
+ background-color: var(--vp-c-bg-soft);
24
+ }
25
+
26
+ .dark .VPBox {
27
+ background-color: var(--vp-c-bg-mute);
28
+ }
29
+
30
+ .icon {
31
+ display: flex;
32
+ justify-content: center;
33
+ align-items: center;
34
+ margin-bottom: 20px;
35
+ border-radius: 6px;
36
+ background-color: var(--vp-c-gray-light-4);
37
+ width: 48px;
38
+ height: 48px;
39
+ font-size: 24px;
40
+ }
41
+
42
+ .dark .icon {
43
+ background-color: var(--vp-c-bg-soft);
44
+ }
45
+
46
+ .title {
47
+ line-height: 24px;
48
+ font-size: 16px;
49
+ font-weight: 600;
50
+ }
51
+
52
+ .details {
53
+ padding-top: 8px;
54
+ line-height: 24px;
55
+ font-size: 14px;
56
+ font-weight: 500;
57
+ color: var(--vp-c-text-2);
58
+ }
59
+ </style>
@@ -0,0 +1,123 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+
4
+ const props = defineProps<{
5
+ tag?: string
6
+ size?: 'medium' | 'big'
7
+ theme?: 'brand' | 'alt' | 'sponsor'
8
+ text: string
9
+ href?: string
10
+ }>()
11
+
12
+ const classes = computed(() => [
13
+ props.size ?? 'medium',
14
+ props.theme ?? 'brand'
15
+ ])
16
+
17
+ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
18
+
19
+ const component = computed(() => {
20
+ if (props.tag) {
21
+ return props.tag
22
+ }
23
+
24
+ return props.href ? 'a' : 'button'
25
+ })
26
+ </script>
27
+
28
+ <template>
29
+ <component
30
+ :is="component"
31
+ class="VPButton"
32
+ :class="classes"
33
+ :href="href"
34
+ :target="isExternal ? '_blank' : undefined"
35
+ :rel="isExternal ? 'noopener noreferrer' : undefined"
36
+ >
37
+ {{ text }}
38
+ </component>
39
+ </template>
40
+
41
+ <style scoped>
42
+ .VPButton {
43
+ display: inline-block;
44
+ border: 1px solid transparent;
45
+
46
+ text-align: center;
47
+ font-weight: 500;
48
+ white-space: nowrap;
49
+ transition: color 0.25s, border-color 0.25s, background-color 0.25s;
50
+ }
51
+
52
+ .VPButton:active {
53
+ transition: color 0.1s, border-color 0.1s, background-color 0.1s;
54
+ }
55
+
56
+ .VPButton.medium {
57
+ border-radius: 20px;
58
+ padding: 0 20px;
59
+ line-height: 38px;
60
+ font-size: 14px;
61
+ }
62
+
63
+ .VPButton.big {
64
+ border-radius: 24px;
65
+ padding: 0 24px;
66
+ line-height: 46px;
67
+ font-size: 16px;
68
+ }
69
+
70
+ .VPButton.brand {
71
+ border-color: var(--vp-button-brand-border);
72
+ color: var(--vp-button-brand-text);
73
+ background-color: var(--vp-button-brand-bg);
74
+ }
75
+
76
+ .VPButton.brand:hover {
77
+ border-color: var(--vp-button-brand-hover-border);
78
+ color: var(--vp-button-brand-hover-text);
79
+ background-color: var(--vp-button-brand-hover-bg);
80
+ }
81
+
82
+ .VPButton.brand:active {
83
+ border-color: var(--vp-button-brand-active-border);
84
+ color: var(--vp-button-brand-active-text);
85
+ background-color: var(--vp-button-brand-active-bg);
86
+ }
87
+
88
+ .VPButton.alt {
89
+ border-color: var(--vp-button-alt-border);
90
+ color: var(--vp-button-alt-text);
91
+ background-color: var(--vp-button-alt-bg);
92
+ }
93
+
94
+ .VPButton.alt:hover {
95
+ border-color: var(--vp-button-alt-hover-border);
96
+ color: var(--vp-button-alt-hover-text);
97
+ background-color: var(--vp-button-alt-hover-bg);
98
+ }
99
+
100
+ .VPButton.alt:active {
101
+ border-color: var(--vp-button-alt-active-border);
102
+ color: var(--vp-button-alt-active-text);
103
+ background-color: var(--vp-button-alt-active-bg);
104
+ }
105
+
106
+ .VPButton.sponsor {
107
+ border-color: var(--vp-button-sponsor-border);
108
+ color: var(--vp-button-sponsor-text);
109
+ background-color: var(--vp-button-sponsor-bg);
110
+ }
111
+
112
+ .VPButton.sponsor:hover {
113
+ border-color: var(--vp-button-sponsor-hover-border);
114
+ color: var(--vp-button-sponsor-hover-text);
115
+ background-color: var(--vp-button-sponsor-hover-bg);
116
+ }
117
+
118
+ .VPButton.sponsor:active {
119
+ border-color: var(--vp-button-sponsor-active-border);
120
+ color: var(--vp-button-sponsor-active-text);
121
+ background-color: var(--vp-button-sponsor-active-bg);
122
+ }
123
+ </style>
@@ -1,10 +1,13 @@
1
1
  <script setup lang="ts">
2
- import { useRoute } from 'vitepress'
2
+ import { useRoute, useData } from 'vitepress'
3
3
  import { useSidebar } from '../composables/sidebar'
4
4
  import NotFound from '../NotFound.vue'
5
- import VPContentDoc from './VPContentDoc.vue'
5
+ import VPPage from './VPPage.vue'
6
+ import VPHome from './VPHome.vue'
7
+ import VPDoc from './VPDoc.vue'
6
8
 
7
9
  const route = useRoute()
10
+ const { frontmatter } = useData()
8
11
  const { hasSidebar } = useSidebar()
9
12
  </script>
10
13
 
@@ -12,14 +15,38 @@ const { hasSidebar } = useSidebar()
12
15
  <div
13
16
  class="VPContent"
14
17
  id="VPContent"
15
- :class="{ 'has-sidebar': hasSidebar }"
18
+ :class="{
19
+ 'has-sidebar': hasSidebar,
20
+ 'is-home': frontmatter.layout === 'home'
21
+ }"
16
22
  >
17
23
  <NotFound v-if="route.component === NotFound" />
18
- <VPContentDoc v-else :class="{ 'has-sidebar': hasSidebar }" />
24
+
25
+ <VPPage v-else-if="frontmatter.layout === 'page'" />
26
+
27
+ <VPHome v-else-if="frontmatter.layout === 'home'">
28
+ <template #home-hero-before><slot name="home-hero-before" /></template>
29
+ <template #home-hero-after><slot name="home-hero-after" /></template>
30
+ <template #home-features-before><slot name="home-features-before" /></template>
31
+ <template #home-features-after><slot name="home-features-after" /></template>
32
+ </VPHome>
33
+
34
+ <VPDoc v-else :class="{ 'has-sidebar': hasSidebar }" />
19
35
  </div>
20
36
  </template>
21
37
 
22
38
  <style scoped>
39
+ .VPContent {
40
+ flex-grow: 1;
41
+ margin: 0 auto;
42
+ max-width: var(--vp-layout-max-width);
43
+ }
44
+
45
+ .VPContent.is-home {
46
+ width: 100%;
47
+ max-width: 100%;
48
+ }
49
+
23
50
  @media (max-width: 768px) {
24
51
  .VPContent {
25
52
  overflow-x: hidden;
@@ -28,16 +55,19 @@ const { hasSidebar } = useSidebar()
28
55
 
29
56
  @media (min-width: 960px) {
30
57
  .VPContent {
31
- padding-top: var(--vp-nav-height-desktop);
58
+ padding-top: var(--vp-nav-height);
32
59
  }
33
60
 
34
61
  .VPContent.has-sidebar {
62
+ margin: 0;
35
63
  padding-left: var(--vp-sidebar-width);
64
+ max-width: 100%;
36
65
  }
37
66
  }
38
67
 
39
68
  @media (min-width: 1440px) {
40
69
  .VPContent.has-sidebar {
70
+ padding-right: calc((100vw - var(--vp-layout-max-width)) / 2);
41
71
  padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width) - 32px);
42
72
  }
43
73
  }
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
  import { useData } from 'vitepress'
4
- import VPContentDocOutline from './VPContentDocOutline.vue'
5
- import VPContentDocFooter from './VPContentDocFooter.vue'
4
+ import VPDocOutline from './VPDocOutline.vue'
5
+ import VPDocFooter from './VPDocFooter.vue'
6
6
 
7
7
  const { page } = useData()
8
8
 
@@ -12,13 +12,13 @@ const pageName = computed(() => {
12
12
  </script>
13
13
 
14
14
  <template>
15
- <div class="VPContentDoc has-aside">
15
+ <div class="VPDoc has-aside">
16
16
  <div class="container">
17
17
  <div class="aside">
18
18
  <div class="aside-container">
19
19
  <div class="aside-curtain" />
20
20
  <div class="aside-content">
21
- <VPContentDocOutline v-if="page.headers" />
21
+ <VPDocOutline v-if="page.headers" />
22
22
  </div>
23
23
  </div>
24
24
  </div>
@@ -28,49 +28,49 @@ const pageName = computed(() => {
28
28
  <Content class="vp-doc" :class="pageName" />
29
29
  </main>
30
30
 
31
- <VPContentDocFooter />
31
+ <VPDocFooter />
32
32
  </div>
33
33
  </div>
34
34
  </div>
35
35
  </template>
36
36
 
37
37
  <style scoped>
38
- .VPContentDoc {
38
+ .VPDoc {
39
39
  padding: 32px 24px 96px;
40
40
  }
41
41
 
42
42
  @media (min-width: 768px) {
43
- .VPContentDoc {
43
+ .VPDoc {
44
44
  padding: 48px 32px 128px;
45
45
  }
46
46
  }
47
47
 
48
48
  @media (min-width: 960px) {
49
- .VPContentDoc {
49
+ .VPDoc {
50
50
  padding: 32px 64px 96px;
51
51
  }
52
52
  }
53
53
 
54
54
  @media (min-width: 1280px) {
55
- .VPContentDoc {
55
+ .VPDoc {
56
56
  padding: 32px 0 128px 64px;
57
57
  }
58
58
 
59
- .VPContentDoc:not(.has-sidebar.has-aside) {
59
+ .VPDoc:not(.has-sidebar.has-aside) {
60
60
  padding-left: calc((100vw - 688px) / 2);
61
61
  }
62
62
 
63
- .VPContentDoc.has-aside:not(.has-sidebar) {
63
+ .VPDoc.has-aside:not(.has-sidebar) {
64
64
  padding-left: calc((100vw - 688px - 320px) / 2);
65
65
  }
66
66
 
67
- .VPContentDoc:not(.has-aside) .content {
67
+ .VPDoc:not(.has-aside) .content {
68
68
  min-width: 688px;
69
69
  }
70
70
  }
71
71
 
72
72
  @media (min-width: 1440px) {
73
- .VPContentDoc {
73
+ .VPDoc {
74
74
  padding: 32px 0 128px 96px;
75
75
  }
76
76
  }
@@ -13,7 +13,7 @@ const control = usePrevNext()
13
13
  </script>
14
14
 
15
15
  <template>
16
- <footer v-if="control.prev || control.next" class="VPContentDocFooter">
16
+ <footer v-if="control.prev || control.next" class="VPDocFooter">
17
17
  <div v-if="theme.editLink && frontmatter.editLink !== false" class="edit-link">
18
18
  <VPLink class="edit-link-button" :href="editLink.url" :no-icon="true">
19
19
  <VPIconEdit class="edit-link-icon" />
@@ -39,7 +39,7 @@ const control = usePrevNext()
39
39
  </template>
40
40
 
41
41
  <style scoped>
42
- .VPContentDocFooter {
42
+ .VPDocFooter {
43
43
  margin-top: 64px;
44
44
  }
45
45
 
@@ -94,6 +94,7 @@ const control = usePrevNext()
94
94
  }
95
95
 
96
96
  .pager.has-prev {
97
+ padding-top: 0;
97
98
  padding-left: 16px;
98
99
  }
99
100
  }
@@ -22,7 +22,7 @@ function handleClick({ target: el }: Event) {
22
22
  </script>
23
23
 
24
24
  <template>
25
- <div class="VPContentDocOutline" ref="container">
25
+ <div class="VPDocOutline" ref="container">
26
26
  <div class="outline-marker" ref="marker" />
27
27
 
28
28
  <div class="outline-title">On this page</div>
@@ -54,7 +54,7 @@ function handleClick({ target: el }: Event) {
54
54
  </template>
55
55
 
56
56
  <style scoped>
57
- .VPContentDocOutline {
57
+ .VPDocOutline {
58
58
  position: relative;
59
59
  border-left: 1px solid var(--vp-c-divider-light);
60
60
  padding-left: 16px;
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ import { useData } from 'vitepress'
3
+ import { useSidebar } from '../composables/sidebar'
4
+
5
+ const { theme } = useData()
6
+ const { hasSidebar } = useSidebar()
7
+ </script>
8
+
9
+ <template>
10
+ <footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
11
+ <div class="container">
12
+ <p class="message">{{ theme.footer.message }}</p>
13
+ <p class="copyright">{{ theme.footer.copyright }}</p>
14
+ </div>
15
+ </footer>
16
+ </template>
17
+
18
+ <style scoped>
19
+ .VPFooter {
20
+ position: relative;
21
+ z-index: var(--vp-z-index-footer);
22
+ border-top: 1px solid var(--vp-c-divider-light);
23
+ padding: 32px 24px;
24
+ background-color: var(--vp-c-bg-content);
25
+ }
26
+
27
+ .VPFooter.has-sidebar {
28
+ display: none;
29
+ }
30
+
31
+ @media (min-width: 768px) {
32
+ .VPFooter {
33
+ padding: 32px;
34
+ }
35
+ }
36
+
37
+ .container {
38
+ margin: 0 auto;
39
+ max-width: var(--vp-layout-max-width);
40
+ text-align: center;
41
+ }
42
+
43
+ .message,
44
+ .copyright {
45
+ line-height: 24px;
46
+ font-size: 14px;
47
+ font-weight: 500;
48
+ color: var(--vp-c-text-2);
49
+ }
50
+
51
+ .message { order: 2; }
52
+ .copyright { order: 1; }
53
+ </style>
@@ -0,0 +1,144 @@
1
+ <script setup lang="ts">
2
+ import VPButton from './VPButton.vue'
3
+
4
+ interface HeroAction {
5
+ theme?: 'brand' | 'alt'
6
+ text: string
7
+ link: string
8
+ }
9
+
10
+ defineProps<{
11
+ name?: string
12
+ text: string
13
+ tagline?: string
14
+ actions?: HeroAction[]
15
+ }>()
16
+ </script>
17
+
18
+ <template>
19
+ <div class="VPHero">
20
+ <div class="container">
21
+ <p v-if="name" class="name"><span class="clip">{{ name }}</span></p>
22
+ <h1 v-if="text" class="text">{{ text }}</h1>
23
+ <p v-if="tagline" class="tagline">{{ tagline }}</p>
24
+
25
+ <div v-if="actions" class="actions">
26
+ <div v-for="action in actions" :key="action.link" class="action">
27
+ <VPButton
28
+ tag="a"
29
+ size="big"
30
+ :theme="action.theme"
31
+ :text="action.text"
32
+ :href="action.link"
33
+ />
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <style scoped>
41
+ .VPHero {
42
+ margin-top: calc(var(--vp-nav-height) * -1);
43
+ padding: calc(var(--vp-nav-height) + 48px) 24px 48px;
44
+ }
45
+
46
+ @media (min-width: 640px) {
47
+ .VPHero {
48
+ padding: calc(var(--vp-nav-height) + 80px) 48px 64px;
49
+ }
50
+ }
51
+
52
+ .container {
53
+ margin: 0 auto;
54
+ max-width: 960px;
55
+ }
56
+
57
+ .name,
58
+ .text {
59
+ line-height: 40px;
60
+ font-size: 32px;
61
+ font-weight: 700;
62
+ }
63
+
64
+ .name {
65
+ padding-bottom: 4px;
66
+ color: var(--vp-home-hero-name-color);
67
+ }
68
+
69
+ .clip {
70
+ background: var(--vp-home-hero-name-background);
71
+ -webkit-text-fill-color: var(--vp-home-hero-name-color);
72
+ -webkit-background-clip: text;
73
+ }
74
+
75
+ @media (min-width: 640px) {
76
+ .name,
77
+ .text {
78
+ max-width: 640px;
79
+ line-height: 56px;
80
+ font-size: 48px;
81
+ }
82
+
83
+ .name {
84
+ padding-bottom: 6px;
85
+ }
86
+ }
87
+
88
+ @media (min-width: 960px) {
89
+ .name,
90
+ .text {
91
+ max-width: 720px;
92
+ line-height: 64px;
93
+ font-size: 56px;
94
+ }
95
+
96
+ .name {
97
+ padding-bottom: 6px;
98
+ }
99
+ }
100
+
101
+ .tagline {
102
+ padding-top: 16px;
103
+ line-height: 28px;
104
+ font-size: 18px;
105
+ font-weight: 500;
106
+ color: var(--vp-c-text-2);
107
+ }
108
+
109
+ @media (min-width: 640px) {
110
+ .tagline {
111
+ padding-top: 24px;
112
+ max-width: 540px;
113
+ line-height: 32px;
114
+ font-size: 20px;
115
+ }
116
+ }
117
+
118
+ @media (min-width: 960px) {
119
+ .tagline {
120
+ padding-top: 24px;
121
+ max-width: 640px;
122
+ line-height: 36px;
123
+ font-size: 24px;
124
+ }
125
+ }
126
+
127
+ .actions {
128
+ display: flex;
129
+ flex-wrap: wrap;
130
+ margin: -8px;
131
+ padding-top: 24px;
132
+ }
133
+
134
+ @media (min-width: 640px) {
135
+ .actions {
136
+ padding-top: 32px;
137
+ }
138
+ }
139
+
140
+ .action {
141
+ flex-shrink: 0;
142
+ padding: 8px;
143
+ }
144
+ </style>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+ import VPHomeHero from './VPHomeHero.vue'
3
+ import VPHomeFeatures from './VPHomeFeatures.vue'
4
+ </script>
5
+
6
+ <template>
7
+ <div class="VPHome">
8
+ <slot name="home-hero-before" />
9
+ <VPHomeHero />
10
+ <slot name="home-hero-after" />
11
+
12
+ <slot name="home-features-before" />
13
+ <VPHomeFeatures />
14
+ <slot name="home-features-after" />
15
+ </div>
16
+ </template>
17
+
18
+ <style scoped>
19
+ .VPHome {
20
+ padding-bottom: 96px;
21
+ }
22
+
23
+ .VPHome :deep(.VPHomeSponsors) {
24
+ margin-top: 112px;
25
+ margin-bottom: -128px;
26
+ }
27
+
28
+ @media (min-width: 768px) {
29
+ .VPHome {
30
+ padding-bottom: 128px;
31
+ }
32
+ }
33
+ </style>