@vuepress/theme-default 2.0.0-beta.5 → 2.0.0-beta.50

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