@vuepress/theme-default 2.0.0-rc.11 → 2.0.0-rc.110

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/VPAutoLink.vue +32 -0
  2. package/lib/client/components/VPDarkIcon.vue +8 -0
  3. package/lib/client/components/VPDropdownTransition.vue +43 -0
  4. package/lib/client/components/VPEditIcon.vue +12 -0
  5. package/lib/client/components/VPFadeSlideYTransition.vue +23 -0
  6. package/lib/client/components/VPHome.vue +37 -0
  7. package/lib/client/components/VPHomeFeatures.vue +65 -0
  8. package/lib/client/components/VPHomeFooter.vue +30 -0
  9. package/lib/client/components/VPHomeHero.vue +186 -0
  10. package/lib/client/components/VPLightIcon.vue +28 -0
  11. package/lib/client/components/VPNavbar.vue +138 -0
  12. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +39 -15
  13. package/lib/client/components/VPNavbarDropdown.vue +329 -0
  14. package/lib/client/components/VPNavbarItems.vue +111 -0
  15. package/lib/client/components/VPPage.vue +69 -0
  16. package/lib/client/components/VPPageMeta.vue +139 -0
  17. package/lib/client/components/VPPageNav.vue +123 -0
  18. package/lib/client/components/VPSidebar.vue +120 -0
  19. package/lib/client/components/VPSidebarItem.vue +185 -0
  20. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +27 -7
  21. package/lib/client/components/VPToggleColorModeButton.vue +55 -0
  22. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  23. package/lib/client/components/global/Badge.vue +83 -22
  24. package/lib/client/components/global/index.d.ts +1 -3
  25. package/lib/client/components/global/index.js +1 -3
  26. package/lib/client/composables/index.d.ts +7 -1
  27. package/lib/client/composables/index.js +7 -1
  28. package/lib/client/composables/useDarkMode.d.ts +1 -3
  29. package/lib/client/composables/useDarkMode.js +20 -17
  30. package/lib/client/composables/useData.d.ts +8 -0
  31. package/lib/client/composables/useData.js +7 -0
  32. package/lib/client/composables/useEditLink.d.ts +3 -0
  33. package/lib/client/composables/useEditLink.js +28 -0
  34. package/lib/client/composables/useHeaders.d.ts +9 -0
  35. package/lib/client/composables/useHeaders.js +38 -0
  36. package/lib/client/composables/useNavbarConfig.d.ts +3 -0
  37. package/lib/client/composables/useNavbarConfig.js +29 -0
  38. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  39. package/lib/client/composables/useNavbarRepo.js +38 -0
  40. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  41. package/lib/client/composables/useNavbarSelectLanguage.js +59 -0
  42. package/lib/client/composables/useNavigate.d.ts +1 -0
  43. package/lib/client/composables/useNavigate.js +22 -0
  44. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  45. package/lib/client/composables/useRelatedLinks.js +90 -0
  46. package/lib/client/composables/useScrollPromise.js +3 -1
  47. package/lib/client/composables/useSidebarItems.d.ts +21 -20
  48. package/lib/client/composables/useSidebarItems.js +96 -85
  49. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  50. package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
  51. package/lib/client/config.d.ts +3 -2
  52. package/lib/client/config.js +8 -23
  53. package/lib/client/index.d.ts +1 -0
  54. package/lib/client/layouts/Layout.vue +126 -56
  55. package/lib/client/layouts/NotFound.vue +59 -12
  56. package/lib/client/shim.d.ts +6 -5
  57. package/lib/client/styles/_mixins.scss +4 -4
  58. package/lib/client/styles/_variables.module.scss +1 -1
  59. package/lib/client/styles/_variables.scss +2 -1
  60. package/lib/client/styles/arrow.scss +24 -22
  61. package/lib/client/styles/code-group.scss +34 -30
  62. package/lib/client/styles/content/code.scss +43 -0
  63. package/lib/client/styles/content/index.scss +3 -0
  64. package/lib/client/styles/content/normalize.scss +39 -0
  65. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  66. package/lib/client/styles/external-link-icon.scss +36 -0
  67. package/lib/client/styles/index.scss +3 -13
  68. package/lib/client/styles/layout.scss +5 -197
  69. package/lib/client/styles/normalize.scss +1 -194
  70. package/lib/client/styles/plugins.scss +28 -0
  71. package/lib/client/styles/vars-dark.scss +20 -58
  72. package/lib/client/styles/vars.scss +54 -150
  73. package/lib/client/typings.d.ts +13 -0
  74. package/lib/client/typings.js +1 -0
  75. package/lib/client/utils/index.d.ts +2 -1
  76. package/lib/client/utils/index.js +2 -1
  77. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
  78. package/lib/client/utils/isActiveSidebarItem.js +1 -1
  79. package/lib/client/utils/resolveAutoLink.d.ts +9 -0
  80. package/lib/client/utils/{getNavLink.js → resolveAutoLink.js} +3 -3
  81. package/lib/client/utils/resolveEditLink.d.ts +3 -3
  82. package/lib/client/utils/resolveEditLink.js +3 -3
  83. package/lib/client/utils/resolvePrefix.d.ts +1 -0
  84. package/lib/client/utils/resolvePrefix.js +4 -0
  85. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  86. package/lib/client/utils/resolveRepoType.js +4 -4
  87. package/lib/node/defaultTheme.d.ts +2 -1
  88. package/lib/node/defaultTheme.js +57 -64
  89. package/lib/node/index.d.ts +1 -3
  90. package/lib/node/index.js +0 -3
  91. package/lib/node/typings.d.ts +59 -0
  92. package/lib/node/typings.js +1 -0
  93. package/lib/node/utils/assignDefaultLocaleOptions.js +3 -8
  94. package/lib/node/utils/index.d.ts +1 -1
  95. package/lib/node/utils/index.js +1 -1
  96. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  97. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  98. package/lib/shared/index.d.ts +5 -3
  99. package/lib/shared/index.js +1 -3
  100. package/lib/shared/nav.d.ts +19 -30
  101. package/lib/shared/navbar.d.ts +21 -0
  102. package/lib/shared/navbar.js +1 -0
  103. package/lib/shared/options.d.ts +36 -66
  104. package/lib/shared/page.d.ts +9 -6
  105. package/lib/shared/sidebar.d.ts +26 -0
  106. package/lib/shared/sidebar.js +1 -0
  107. package/package.json +34 -27
  108. package/templates/build.html +16 -10
  109. package/lib/client/components/AutoLink.vue +0 -113
  110. package/lib/client/components/DropdownTransition.vue +0 -25
  111. package/lib/client/components/Home.vue +0 -15
  112. package/lib/client/components/HomeContent.vue +0 -5
  113. package/lib/client/components/HomeFeatures.vue +0 -22
  114. package/lib/client/components/HomeFooter.vue +0 -17
  115. package/lib/client/components/HomeHero.vue +0 -97
  116. package/lib/client/components/Navbar.vue +0 -79
  117. package/lib/client/components/NavbarDropdown.vue +0 -126
  118. package/lib/client/components/NavbarItems.vue +0 -194
  119. package/lib/client/components/Page.vue +0 -31
  120. package/lib/client/components/PageMeta.vue +0 -124
  121. package/lib/client/components/PageNav.vue +0 -122
  122. package/lib/client/components/Sidebar.vue +0 -18
  123. package/lib/client/components/SidebarItem.vue +0 -87
  124. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  125. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  126. package/lib/client/components/global/CodeGroup.d.ts +0 -6
  127. package/lib/client/components/global/CodeGroup.js +0 -120
  128. package/lib/client/components/global/CodeGroupItem.vue +0 -27
  129. package/lib/client/composables/useThemeData.d.ts +0 -4
  130. package/lib/client/composables/useThemeData.js +0 -3
  131. package/lib/client/styles/badge.scss +0 -36
  132. package/lib/client/styles/code.scss +0 -263
  133. package/lib/client/styles/custom-container.scss +0 -142
  134. package/lib/client/styles/home.scss +0 -168
  135. package/lib/client/styles/navbar-dropdown.scss +0 -183
  136. package/lib/client/styles/navbar.scss +0 -197
  137. package/lib/client/styles/page.scss +0 -87
  138. package/lib/client/styles/sidebar.scss +0 -134
  139. package/lib/client/styles/transitions.scss +0 -22
  140. package/lib/client/utils/getNavLink.d.ts +0 -9
  141. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  142. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -1,200 +1,7 @@
1
- html,
2
- body {
3
- padding: 0;
4
- margin: 0;
5
- background-color: var(--c-bg);
6
- transition: background-color var(--t-color);
7
- }
8
-
9
- html.dark {
10
- color-scheme: dark;
11
- }
12
-
13
- html {
14
- font-size: 16px;
15
- }
16
-
17
1
  body {
18
2
  font-family: var(--font-family);
19
- -webkit-font-smoothing: antialiased;
20
- -moz-osx-font-smoothing: grayscale;
21
- font-size: 1rem;
22
- color: var(--c-text);
23
- }
24
-
25
- a {
26
- font-weight: 500;
27
- color: var(--c-text-accent);
28
- text-decoration: none;
29
- overflow-wrap: break-word;
30
- }
31
-
32
- p a code {
33
- font-weight: 400;
34
- color: var(--c-text-accent);
35
- }
36
-
37
- kbd {
38
- font-family: var(--font-family-code);
39
- color: var(--c-text);
40
- background: var(--c-bg-lighter);
41
- border: solid 0.15rem var(--c-border-dark);
42
- border-bottom: solid 0.25rem var(--c-border-dark);
43
- border-radius: 0.15rem;
44
- padding: 0 0.15em;
45
3
  }
46
4
 
47
5
  code {
48
- font-family: var(--font-family-code);
49
- color: var(--c-text-lighter);
50
- padding: 0.25rem 0.5rem;
51
- margin: 0;
52
- font-size: 0.85em;
53
- background-color: var(--c-bg-light);
54
- border-radius: 3px;
55
- overflow-wrap: break-word;
56
- transition: background-color var(--t-color);
57
- }
58
-
59
- blockquote {
60
- font-size: 1rem;
61
- color: var(--c-text-quote);
62
- border-left: 0.2rem solid var(--c-border-dark);
63
- margin: 1rem 0;
64
- padding: 0.25rem 0 0.25rem 1rem;
65
- overflow-wrap: break-word;
66
-
67
- & > p {
68
- margin: 0;
69
- }
70
- }
71
-
72
- ul,
73
- ol {
74
- padding-left: 1.2em;
75
- }
76
-
77
- strong {
78
- font-weight: 600;
79
- }
80
-
81
- h1,
82
- h2,
83
- h3,
84
- h4,
85
- h5,
86
- h6 {
87
- font-weight: 600;
88
- line-height: 1.25;
89
- overflow-wrap: break-word;
90
-
91
- &:focus-visible {
92
- outline: none;
93
- }
94
-
95
- .header-anchor {
96
- color: inherit;
97
- text-decoration: none;
98
- position: relative;
99
-
100
- &:hover::before {
101
- font-size: 0.8em;
102
- content: '¶';
103
- position: absolute;
104
- left: -0.75em;
105
- color: var(--c-brand);
106
- }
107
-
108
- &:focus-visible {
109
- outline: none;
110
-
111
- &::before {
112
- content: '¶';
113
- position: absolute;
114
- left: -0.75em;
115
- color: var(--c-brand);
116
- outline: auto;
117
- }
118
- }
119
- }
120
- }
121
-
122
- h1 {
123
- font-size: 2.2rem;
124
- }
125
-
126
- h2 {
127
- font-size: 1.65rem;
128
- padding-bottom: 0.3rem;
129
- border-bottom: 1px solid var(--c-border);
130
- transition: border-color var(--t-color);
131
- }
132
-
133
- h3 {
134
- font-size: 1.35rem;
135
- }
136
-
137
- h4 {
138
- font-size: 1.15rem;
139
- }
140
-
141
- h5 {
142
- font-size: 1.05rem;
143
- }
144
-
145
- h6 {
146
- font-size: 1rem;
147
- }
148
-
149
- a {
150
- @media print {
151
- &[href^="http://"],
152
- &[href^="https://"]
153
- {
154
- &::after {
155
- content: ' (' attr(href) ') ';
156
- }
157
- }
158
- }
159
- }
160
-
161
- p,
162
- ul,
163
- ol {
164
- line-height: 1.7;
165
- overflow-wrap: break-word;
166
- }
167
-
168
- hr {
169
- border: 0;
170
- border-top: 1px solid var(--c-border);
171
- }
172
-
173
- table {
174
- border-collapse: collapse;
175
- margin: 1rem 0;
176
- display: block;
177
- overflow-x: auto;
178
- transition: border-color var(--t-color);
179
- }
180
-
181
- tr {
182
- border-top: 1px solid var(--c-border-dark);
183
- transition: border-color var(--t-color);
184
-
185
- &:nth-child(2n) {
186
- background-color: var(--c-bg-light);
187
- transition: background-color var(--t-color);
188
-
189
- code {
190
- background-color: var(--c-bg-dark);
191
- }
192
- }
193
- }
194
-
195
- th,
196
- td {
197
- padding: 0.6em 1em;
198
- border: 1px solid var(--c-border-dark);
199
- transition: border-color var(--t-color);
6
+ font-family: var(--code-font-family);
200
7
  }
@@ -0,0 +1,28 @@
1
+ @use 'mixins';
2
+ @use 'variables' as *;
3
+
4
+ // plugin-comment
5
+ .vp-comment {
6
+ @include mixins.content-wrapper;
7
+ }
8
+
9
+ .vp-navbar {
10
+ // plugin-docsearch
11
+ /* stylelint-disable-next-line selector-class-pattern */
12
+ .DocSearch {
13
+ transition: background-color var(--vp-t-color);
14
+ }
15
+
16
+ // plugin-search
17
+ .search-box {
18
+ vertical-align: top;
19
+ flex: 0 0 auto;
20
+ }
21
+ }
22
+
23
+ // plugin-markdown-hint
24
+ .hint-container {
25
+ @media screen and (max-width: $MQMobile) {
26
+ margin-inline: -0.75rem;
27
+ }
28
+ }
@@ -1,68 +1,30 @@
1
- html.dark {
1
+ [data-theme='dark'] {
2
2
  // brand colors
3
- --c-brand: #3aa675;
4
- --c-brand-light: #349469;
3
+ --vp-c-accent: #3dd68c;
4
+ --vp-c-accent-bg: #3aa675;
5
+ --vp-c-accent-hover: #349469;
6
+ --vp-c-accent-soft: rgb(16 185 129 / 16%);
5
7
 
6
8
  // background colors
7
- --c-bg: #22272e;
8
- --c-bg-light: #2b313a;
9
- --c-bg-lighter: #262c34;
10
- --c-bg-dark: #343b44;
11
- --c-bg-darker: #37404c;
9
+ --vp-c-bg: #1b1b1f;
10
+ --vp-c-bg-alt: #161618;
11
+ --vp-c-bg-elv: #202127;
12
12
 
13
13
  // text colors
14
- --c-text: #adbac7;
15
- --c-text-light: #96a7b7;
16
- --c-text-lighter: #8b9eb0;
17
- --c-text-lightest: #8094a8;
14
+ --vp-c-text: rgb(235 235 245 / 86%);
15
+ --vp-c-text-mute: rgb(235 235 245 / 60%);
16
+ --vp-c-text-subtle: rgb(235 235 245 / 38%);
18
17
 
19
18
  // border colors
20
- --c-border: #3e4c5a;
21
- --c-border-dark: #34404c;
19
+ --vp-c-divider: #2e2e32;
20
+ --vp-c-border: #3c3f44;
21
+ --vp-c-border-hard: #45484e;
22
22
 
23
- // custom container colors
24
- --c-tip: #318a62;
25
- --c-warning: #e0ad15;
26
- --c-warning-bg: #2d2f2d;
27
- --c-warning-bg-light: #423e2a;
28
- --c-warning-bg-lighter: #44442f;
29
- --c-warning-border-dark: #957c35;
30
- --c-warning-details-bg: #39392d;
31
- --c-warning-title: #fdca31;
32
- --c-warning-text: #d8d96d;
33
- --c-warning-text-accent: #ffbf00;
34
- --c-warning-text-light: #ddb84b;
35
- --c-warning-text-quote: #ccab49;
36
- --c-danger: #fc1e38;
37
- --c-danger-bg: #39232c;
38
- --c-danger-bg-light: #4b2b35;
39
- --c-danger-bg-lighter: #553040;
40
- --c-danger-border-dark: #a25151;
41
- --c-danger-details-bg: #482936;
42
- --c-danger-title: #fc2d3b;
43
- --c-danger-text: #ea9ca0;
44
- --c-danger-text-accent: #fd3636;
45
- --c-danger-text-light: #d9777c;
46
- --c-danger-text-quote: #d56b6b;
47
- --c-details-bg: #323843;
23
+ // shadow color
24
+ --vp-c-shadow: rgb(0 0 0 / 30%);
48
25
 
49
- // badge component colors
50
- --c-badge-warning: var(--c-warning);
51
- --c-badge-warning-text: #3c2e05;
52
- --c-badge-danger: var(--c-danger);
53
- --c-badge-danger-text: #401416;
54
-
55
- // code blocks vars
56
- --code-hl-bg-color: #363b46;
57
- }
58
-
59
- // plugin-docsearch
60
- html.dark .DocSearch {
61
- --docsearch-logo-color: var(--c-text);
62
- --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
63
- --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d,
64
- 0 2px 2px 0 rgba(3, 4, 9, 0.3);
65
- --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);
66
- --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
67
- 0 -4px 8px 0 rgba(0, 0, 0, 0.2);
26
+ // control colors
27
+ --vp-c-control: rgb(101 117 133 / 12%);
28
+ --vp-c-control-hover: rgb(101 117 133 / 18%);
29
+ --vp-c-control-disabled: #363636;
68
30
  }
@@ -1,87 +1,62 @@
1
+ // === colors ===
1
2
  :root {
2
- // brand colors
3
- --c-brand: #3eaf7c;
4
- --c-brand-light: #4abf8a;
3
+ // accent colors
4
+ --vp-c-accent: #299764;
5
+ --vp-c-accent-bg: #3eaf7c;
6
+ --vp-c-accent-hover: #4abf8a;
7
+ --vp-c-accent-text: var(--vp-c-white);
8
+ --vp-c-accent-soft: rgb(16 185 129 / 14%);
5
9
 
6
10
  // background colors
7
- --c-bg: #ffffff;
8
- --c-bg-light: #f3f4f5;
9
- --c-bg-lighter: #eeeeee;
10
- --c-bg-dark: #ebebec;
11
- --c-bg-darker: #e6e6e6;
12
- --c-bg-navbar: var(--c-bg);
13
- --c-bg-sidebar: var(--c-bg);
14
- --c-bg-arrow: #cccccc;
11
+ --vp-c-bg: #fff;
12
+ --vp-c-bg-alt: #f6f6f7;
13
+ --vp-c-bg-elv: #fff;
15
14
 
16
15
  // text colors
17
- --c-text: #2c3e50;
18
- --c-text-accent: var(--c-brand);
19
- --c-text-light: #3a5169;
20
- --c-text-lighter: #4e6e8e;
21
- --c-text-lightest: #6a8bad;
22
- --c-text-quote: #999999;
16
+ --vp-c-text: rgb(60 60 67);
17
+ --vp-c-text-mute: rgb(60 60 67 / 78%);
18
+ --vp-c-text-subtle: rgb(60 60 67 / 56%);
23
19
 
24
20
  // border colors
25
- --c-border: #eaecef;
26
- --c-border-dark: #dfe2e5;
21
+ --vp-c-divider: #e2e2e3;
22
+ --vp-c-border: #c2c2c4;
23
+ --vp-c-border-hard: #b8b8ba;
27
24
 
28
- // custom container colors
29
- --c-tip: #42b983;
30
- --c-tip-bg: var(--c-bg-light);
31
- --c-tip-title: var(--c-text);
32
- --c-tip-text: var(--c-text);
33
- --c-tip-text-accent: var(--c-text-accent);
34
- --c-warning: #ffc310;
35
- --c-warning-bg: #fffae3;
36
- --c-warning-bg-light: #fff3ba;
37
- --c-warning-bg-lighter: #fff0b0;
38
- --c-warning-border-dark: #f7dc91;
39
- --c-warning-details-bg: #fff5ca;
40
- --c-warning-title: #f1b300;
41
- --c-warning-text: #746000;
42
- --c-warning-text-accent: #edb100;
43
- --c-warning-text-light: #c1971c;
44
- --c-warning-text-quote: #ccab49;
45
- --c-danger: #f11e37;
46
- --c-danger-bg: #ffe0e0;
47
- --c-danger-bg-light: #ffcfde;
48
- --c-danger-bg-lighter: #ffc9c9;
49
- --c-danger-border-dark: #f1abab;
50
- --c-danger-details-bg: #ffd4d4;
51
- --c-danger-title: #ed1e2c;
52
- --c-danger-text: #660000;
53
- --c-danger-text-accent: #bd1a1a;
54
- --c-danger-text-light: #b5474d;
55
- --c-danger-text-quote: #c15b5b;
56
- --c-details-bg: #eeeeee;
25
+ // shadow colors
26
+ --vp-c-shadow: rgb(0 0 0 / 15%);
57
27
 
58
- // badge component colors
59
- --c-badge-tip: var(--c-tip);
60
- --c-badge-warning: #ecc808;
61
- --c-badge-warning-text: var(--c-bg);
62
- --c-badge-danger: #dc2626;
63
- --c-badge-danger-text: var(--c-bg);
28
+ // control colors
29
+ --vp-c-control: rgb(142 150 170 / 10%);
30
+ --vp-c-control-hover: rgb(142 150 170 / 16%);
31
+ --vp-c-control-disabled: #eaeaea;
64
32
 
65
- // code group colors
66
- --c-code-group-tab-title: rgba(255, 255, 255, 0.9);
67
- --c-code-group-tab-bg: var(--code-bg-color);
68
- --c-code-group-tab-outline: var(var(--c-code-group-tab-title));
69
- --c-code-group-tab-active-border: var(--c-brand);
70
-
71
- // transition vars
72
- --t-color: 0.3s ease;
73
- --t-transform: 0.3s ease;
33
+ // layout colors
34
+ --vp-navbar-c-bg: var(--vp-c-bg);
35
+ --vp-sidebar-c-bg: var(--vp-c-bg);
74
36
 
75
- // code blocks vars
76
- --code-bg-color: #282c34;
77
- --code-hl-bg-color: rgba(0, 0, 0, 0.66);
78
- --code-ln-color: #9e9e9e;
79
- --code-ln-wrapper-width: 3.5rem;
37
+ // code group colors
38
+ --vp-c-code-tab-title: var(--code-c-text, rgb(255 255 255 / 90%));
39
+ --vp-c-code-tab-bg: var(--code-bg-color, var(--code-c-bg));
40
+ --vp-c-code-tab-active: var(--vp-c-accent);
41
+
42
+ // badge colors
43
+ --badge-c-tip-text: var(--vp-c-green-text);
44
+ --badge-c-tip-bg: var(--vp-c-green-soft);
45
+ --badge-c-warning-text: var(--vp-c-yellow-text);
46
+ --badge-c-warning-bg: var(--vp-c-yellow-soft);
47
+ --badge-c-danger-text: var(--vp-c-red-text);
48
+ --badge-c-danger-bg: var(--vp-c-red-soft);
49
+ --badge-c-important-text: var(--vp-c-purple-text);
50
+ --badge-c-important-bg: var(--vp-c-purple-soft);
51
+ --badge-c-info-text: var(--vp-c-indigo-text);
52
+ --badge-c-info-bg: var(--vp-c-indigo-soft);
53
+ --badge-c-note-text: var(--vp-c-grey-text);
54
+ --badge-c-note-bg: var(--vp-c-grey-soft);
80
55
 
81
56
  // font vars
82
- --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
83
- Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
84
- --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
57
+ --font-family:
58
+ -apple-system, 'BlinkMacSystemFont', 'Segoe UI', roboto, oxygen, ubuntu,
59
+ cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
85
60
 
86
61
  // layout vars
87
62
  --navbar-height: 3.6rem;
@@ -91,86 +66,15 @@
91
66
  --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
92
67
  --content-width: 740px;
93
68
  --homepage-width: 960px;
94
- }
95
69
 
96
- // plugin-back-to-top
97
- .vp-back-to-top-button {
98
- --back-to-top-color: var(--c-brand);
99
- --back-to-top-color-hover: var(--c-brand-light);
100
- --back-to-top-bg-color: var(--c-bg);
101
- }
70
+ // header offset
71
+ --header-offset: var(--navbar-height);
102
72
 
103
- // catalog
104
- .vp-catalog-wrapper {
105
- --catalog-bg-color: var(--c-bg);
106
- --catalog-bg-secondary-color: var(--c-bg-dark);
107
- --catalog-border-color: var(--c-border);
108
- --catalog-active-color: var(--c-brand);
109
- --catalog-hover-color: var(--c-brand-light);
110
- }
111
-
112
- // plugin-docsearch
113
- .DocSearch {
114
- --docsearch-primary-color: var(--c-brand);
115
- --docsearch-text-color: var(--c-text);
116
- --docsearch-highlight-color: var(--c-brand);
117
- --docsearch-muted-color: var(--c-text-quote);
118
- --docsearch-container-background: rgba(9, 10, 17, 0.8);
119
- --docsearch-modal-background: var(--c-bg-light);
120
- --docsearch-searchbox-background: var(--c-bg-lighter);
121
- --docsearch-searchbox-focus-background: var(--c-bg);
122
- --docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);
123
- --docsearch-hit-color: var(--c-text-light);
124
- --docsearch-hit-active-color: var(--c-bg);
125
- --docsearch-hit-background: var(--c-bg);
126
- --docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);
127
- --docsearch-footer-background: var(--c-bg);
128
- }
129
-
130
- // plugin-external-link-icon
131
- .external-link-icon {
132
- --external-link-icon-color: var(--c-text-quote);
133
- }
134
-
135
- // plugin-medium-zoom
136
- .medium-zoom-overlay {
137
- --medium-zoom-bg-color: var(--c-bg);
138
- }
139
-
140
- // plugin-nprogress
141
- #nprogress {
142
- --nprogress-color: var(--c-brand);
143
- }
144
-
145
- // plugin-pwa-popup
146
- .pwa-popup {
147
- --pwa-popup-text-color: var(--c-text);
148
- --pwa-popup-bg-color: var(--c-bg);
149
- --pwa-popup-border-color: var(--c-brand);
150
- --pwa-popup-shadow: 0 4px 16px var(--c-brand);
151
- --pwa-popup-btn-text-color: var(--c-bg);
152
- --pwa-popup-btn-bg-color: var(--c-brand);
153
- --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
154
- }
155
-
156
- // plugin-redirect
157
- .language-modal-mask {
158
- --redirect-bg-color: var(--c-bg);
159
- --redirect-bg-color-light: var(--c-bg-light);
160
- --redirect-bg-color-lighter: var(--c-bg-lighter);
161
- --redirect-text-color: var(--c-text);
162
- --redirect-primary-bg-color: var(--c-brand);
163
- --redirect-primary-hover-bg-color: var(--c-brand-light);
164
- --redirect-primary-text-color: var(--c-bg);
165
- }
166
-
167
- // plugin-search
168
- .search-box {
169
- --search-bg-color: var(--c-bg);
170
- --search-accent-color: var(--c-brand);
171
- --search-text-color: var(--c-text);
172
- --search-border-color: var(--c-border);
73
+ // transition vars
74
+ --vp-t-color: 0.3s ease;
75
+ --vp-t-transform: 0.3s ease;
173
76
 
174
- --search-item-text-color: var(--c-text-lighter);
175
- --search-item-focus-bg-color: var(--c-bg-light);
77
+ // external-link-icon
78
+ --external-link-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z'/%3E%3C/svg%3E");
79
+ --external-link-c-icon: var(--vp-c-text-mute);
176
80
  }
@@ -0,0 +1,13 @@
1
+ import type { AutoLinkOptions, NavGroup, SidebarGroupOptions, SidebarLinkOptions } from '../shared/index.js';
2
+ export type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
3
+ export type SidebarLinkItem = SidebarLinkOptions;
4
+ export interface SidebarHeaderItem {
5
+ text: string;
6
+ link: string;
7
+ children?: SidebarHeaderItem[];
8
+ }
9
+ export interface SidebarGroupItem extends SidebarGroupOptions {
10
+ prefix?: string;
11
+ children: (SidebarHeaderItem | SidebarItem)[];
12
+ }
13
+ export type SidebarItem = SidebarGroupItem | SidebarLinkItem;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- export * from './getNavLink.js';
2
1
  export * from './isActiveSidebarItem.js';
2
+ export * from './resolveAutoLink.js';
3
3
  export * from './resolveEditLink.js';
4
+ export * from './resolvePrefix.js';
4
5
  export * from './resolveRepoType.js';
@@ -1,4 +1,5 @@
1
- export * from './getNavLink.js';
2
1
  export * from './isActiveSidebarItem.js';
2
+ export * from './resolveAutoLink.js';
3
3
  export * from './resolveEditLink.js';
4
+ export * from './resolvePrefix.js';
4
5
  export * from './resolveRepoType.js';
@@ -1,3 +1,3 @@
1
- import type { RouteLocationNormalizedLoaded } from 'vue-router';
2
- import type { ResolvedSidebarItem } from '../../shared/index.js';
3
- export declare const isActiveSidebarItem: (item: ResolvedSidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
1
+ import type { RouteLocationNormalizedLoaded } from 'vuepress/client';
2
+ import type { SidebarItem } from '../typings.js';
3
+ export declare const isActiveSidebarItem: (item: SidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
@@ -13,7 +13,7 @@ export const isActiveSidebarItem = (item, route) => {
13
13
  if (item.link && isActiveLink(item.link, route)) {
14
14
  return true;
15
15
  }
16
- if (item.children) {
16
+ if ('children' in item) {
17
17
  return item.children.some((child) => isActiveSidebarItem(child, route));
18
18
  }
19
19
  return false;
@@ -0,0 +1,9 @@
1
+ import type { AutoLinkOptions } from '../../shared/index.js';
2
+ /**
3
+ * Resolve AutoLink props from string
4
+ *
5
+ * @example
6
+ * - Input: '/README.md'
7
+ * - Output: { text: 'Home', link: '/' }
8
+ */
9
+ export declare const resolveAutoLink: (config: string, currentPath?: string) => AutoLinkOptions;
@@ -1,13 +1,13 @@
1
1
  import { resolveRoute } from 'vuepress/client';
2
2
  /**
3
- * Resolve NavLink props from string
3
+ * Resolve AutoLink props from string
4
4
  *
5
5
  * @example
6
6
  * - Input: '/README.md'
7
7
  * - Output: { text: 'Home', link: '/' }
8
8
  */
9
- export const getNavLink = (config) => {
10
- const { notFound, meta, path } = resolveRoute(config);
9
+ export const resolveAutoLink = (config, currentPath) => {
10
+ const { notFound, meta, path } = resolveRoute(config, currentPath);
11
11
  return notFound
12
12
  ? { text: path, link: path }
13
13
  : {
@@ -1,9 +1,9 @@
1
- import type { RepoType } from './resolveRepoType.js';
2
- export declare const editLinkPatterns: Record<Exclude<RepoType, null>, string>;
1
+ import type { RepoType } from '@theme/resolveRepoType';
2
+ export declare const EDIT_LINK_PATTERNS: Record<Exclude<RepoType, null>, string>;
3
3
  export declare const resolveEditLink: ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }: {
4
4
  docsRepo: string;
5
5
  docsBranch: string;
6
6
  docsDir: string;
7
7
  filePathRelative: string | null;
8
- editLinkPattern?: string | undefined;
8
+ editLinkPattern?: string;
9
9
  }) => string | null;
@@ -1,6 +1,6 @@
1
+ import { resolveRepoType } from '@theme/resolveRepoType';
1
2
  import { isLinkHttp, removeEndingSlash, removeLeadingSlash, } from 'vuepress/shared';
2
- import { resolveRepoType } from './resolveRepoType.js';
3
- export const editLinkPatterns = {
3
+ export const EDIT_LINK_PATTERNS = {
4
4
  GitHub: ':repo/edit/:branch/:path',
5
5
  GitLab: ':repo/-/edit/:branch/:path',
6
6
  Gitee: ':repo/edit/:branch/:path',
@@ -12,7 +12,7 @@ const resolveEditLinkPatterns = ({ docsRepo, editLinkPattern, }) => {
12
12
  }
13
13
  const repoType = resolveRepoType(docsRepo);
14
14
  if (repoType !== null) {
15
- return editLinkPatterns[repoType];
15
+ return EDIT_LINK_PATTERNS[repoType];
16
16
  }
17
17
  return null;
18
18
  };
@@ -0,0 +1 @@
1
+ export declare const resolvePrefix: (prefix?: string, path?: string) => string;
@@ -0,0 +1,4 @@
1
+ import { ensureEndingSlash, isLinkAbsolute, isLinkWithProtocol, } from '@vuepress/helper/client';
2
+ export const resolvePrefix = (prefix = '', path = '') => isLinkAbsolute(path) || isLinkWithProtocol(path)
3
+ ? path
4
+ : `${ensureEndingSlash(prefix)}${path}`;
@@ -1,2 +1,2 @@
1
- export type RepoType = 'GitHub' | 'GitLab' | 'Gitee' | 'Bitbucket' | null;
1
+ export type RepoType = 'Bitbucket' | 'Gitee' | 'GitHub' | 'GitLab' | null;
2
2
  export declare const resolveRepoType: (repo: string) => RepoType;