@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,177 @@
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
+ body {
18
+ 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
+ }
46
+
47
+ 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-lighter);
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
+
66
+ & > p {
67
+ margin: 0;
68
+ }
69
+ }
70
+
71
+ ul,
72
+ ol {
73
+ padding-left: 1.2em;
74
+ }
75
+
76
+ strong {
77
+ font-weight: 600;
78
+ }
79
+
80
+ h1,
81
+ h2,
82
+ h3,
83
+ h4,
84
+ h5,
85
+ h6 {
86
+ font-weight: 600;
87
+ line-height: 1.25;
88
+
89
+ &:focus-visible {
90
+ outline: none;
91
+ }
92
+
93
+ &:hover .header-anchor {
94
+ opacity: 1;
95
+ }
96
+ }
97
+
98
+ h1 {
99
+ font-size: 2.2rem;
100
+ }
101
+
102
+ h2 {
103
+ font-size: 1.65rem;
104
+ padding-bottom: 0.3rem;
105
+ border-bottom: 1px solid var(--c-border);
106
+ transition: border-color var(--t-color);
107
+ }
108
+
109
+ h3 {
110
+ font-size: 1.35rem;
111
+ }
112
+
113
+ h4 {
114
+ font-size: 1.15rem;
115
+ }
116
+
117
+ h5 {
118
+ font-size: 1.05rem;
119
+ }
120
+
121
+ h6 {
122
+ font-size: 1rem;
123
+ }
124
+
125
+ a.header-anchor {
126
+ font-size: 0.85em;
127
+ float: left;
128
+ margin-left: -0.87em;
129
+ padding-right: 0.23em;
130
+ margin-top: 0.125em;
131
+ opacity: 0;
132
+ user-select: none;
133
+
134
+ &:hover {
135
+ text-decoration: none;
136
+ }
137
+
138
+ &:focus-visible {
139
+ opacity: 1;
140
+ }
141
+ }
142
+
143
+ p,
144
+ ul,
145
+ ol {
146
+ line-height: 1.7;
147
+ }
148
+
149
+ hr {
150
+ border: 0;
151
+ border-top: 1px solid var(--c-border);
152
+ }
153
+
154
+ table {
155
+ border-collapse: collapse;
156
+ margin: 1rem 0;
157
+ display: block;
158
+ overflow-x: auto;
159
+ transition: border-color var(--t-color);
160
+ }
161
+
162
+ tr {
163
+ border-top: 1px solid var(--c-border-dark);
164
+ transition: border-color var(--t-color);
165
+
166
+ &:nth-child(2n) {
167
+ background-color: var(--c-bg-light);
168
+ transition: background-color var(--t-color);
169
+ }
170
+ }
171
+
172
+ th,
173
+ td {
174
+ padding: 0.6em 1em;
175
+ border: 1px solid var(--c-border-dark);
176
+ transition: border-color var(--t-color);
177
+ }
@@ -1,15 +1,18 @@
1
- @use 'sass:color';
2
-
1
+ @import '_mixins';
3
2
  @import '_variables';
4
- @import '_wrapper';
5
3
 
6
4
  .page {
7
5
  padding-bottom: 2rem;
8
6
  display: block;
7
+
8
+ .theme-default-content {
9
+ @include content_wrapper;
10
+ padding-top: 0;
11
+ }
9
12
  }
10
13
 
11
14
  .page-meta {
12
- @extend %wrapper;
15
+ @include content_wrapper;
13
16
  padding-top: 1rem;
14
17
  padding-bottom: 1rem;
15
18
  overflow: auto;
@@ -20,12 +23,12 @@
20
23
 
21
24
  .meta-item-label {
22
25
  font-weight: 500;
23
- color: color.scale($textColor, $lightness: 25%);
26
+ color: var(--c-text-lighter);
24
27
  }
25
28
 
26
29
  .meta-item-info {
27
30
  font-weight: 400;
28
- color: #767676;
31
+ color: var(--c-text-quote);
29
32
  }
30
33
  }
31
34
 
@@ -53,19 +56,28 @@
53
56
  }
54
57
 
55
58
  .page-nav {
56
- @extend %wrapper;
59
+ @include content_wrapper;
57
60
  padding-top: 1rem;
58
61
  padding-bottom: 0;
59
62
 
60
63
  .inner {
61
64
  min-height: 2rem;
62
65
  margin-top: 0;
63
- border-top: 1px solid $borderColor;
66
+ border-top: 1px solid var(--c-border);
67
+ transition: border-color var(--t-color);
64
68
  padding-top: 1rem;
65
69
  overflow: auto;
66
70
  }
67
71
 
72
+ .prev {
73
+ a:before {
74
+ content: '←';
75
+ }
76
+ }
68
77
  .next {
69
78
  float: right;
79
+ a:after {
80
+ content: '→';
81
+ }
70
82
  }
71
83
  }
@@ -0,0 +1,134 @@
1
+ @import '_mixins';
2
+ @import '_variables';
3
+
4
+ .sidebar {
5
+ ul {
6
+ padding: 0;
7
+ margin: 0;
8
+ list-style-type: none;
9
+ }
10
+
11
+ a {
12
+ display: inline-block;
13
+ }
14
+
15
+ .navbar-items {
16
+ display: none;
17
+ border-bottom: 1px solid var(--c-border);
18
+ transition: border-color var(--t-color);
19
+ padding: 0.5rem 0 0.75rem 0;
20
+
21
+ a {
22
+ font-weight: 600;
23
+ }
24
+
25
+ .navbar-item {
26
+ display: block;
27
+ line-height: 1.25rem;
28
+ font-size: 1.1em;
29
+ padding: 0.5rem 0 0.5rem 1.5rem;
30
+ }
31
+ }
32
+
33
+ .sidebar-items {
34
+ padding: 1.5rem 0;
35
+ }
36
+ }
37
+
38
+ @media (max-width: $MQMobile) {
39
+ .sidebar {
40
+ .navbar-items {
41
+ display: block;
42
+
43
+ .navbar-dropdown-wrapper
44
+ .navbar-dropdown
45
+ .navbar-dropdown-item
46
+ a.router-link-active::after {
47
+ top: calc(1rem - 2px);
48
+ }
49
+ }
50
+
51
+ .sidebar-items {
52
+ padding: 1rem 0;
53
+ }
54
+ }
55
+ }
56
+
57
+ .sidebar-item {
58
+ cursor: default;
59
+ border-left: 0.25rem solid transparent;
60
+ color: var(--c-text);
61
+
62
+ &:focus-visible {
63
+ outline-width: 1px;
64
+ outline-offset: -1px;
65
+ }
66
+
67
+ &.active:not(p.sidebar-heading) {
68
+ font-weight: 600;
69
+ color: var(--c-text-accent);
70
+ border-left-color: var(--c-text-accent);
71
+ }
72
+
73
+ &.sidebar-heading {
74
+ transition: color 0.15s ease;
75
+ font-size: 1.1em;
76
+ font-weight: bold;
77
+ padding: 0.35rem 1.5rem 0.35rem 1.25rem;
78
+ width: 100%;
79
+ box-sizing: border-box;
80
+ margin: 0;
81
+
82
+ + .sidebar-item-children {
83
+ @include dropdown_wrapper;
84
+ margin-bottom: 0.75rem;
85
+ }
86
+
87
+ &.collapsible {
88
+ cursor: pointer;
89
+
90
+ .arrow {
91
+ position: relative;
92
+ top: -0.12em;
93
+ left: 0.5em;
94
+ }
95
+ }
96
+ }
97
+
98
+ &:not(.sidebar-heading) {
99
+ font-size: 1em;
100
+ font-weight: 400;
101
+ display: inline-block;
102
+ margin: 0;
103
+ padding: 0.35rem 1rem 0.35rem 2rem;
104
+ line-height: 1.4;
105
+ width: 100%;
106
+ box-sizing: border-box;
107
+
108
+ & + .sidebar-item-children {
109
+ padding-left: 1rem;
110
+ font-size: 0.95em;
111
+ }
112
+
113
+ .sidebar-item-children .sidebar-item-children & {
114
+ padding: 0.25rem 1rem 0.25rem 1.75rem;
115
+
116
+ &.active {
117
+ font-weight: 500;
118
+ border-left-color: transparent;
119
+ }
120
+ }
121
+
122
+ a.sidebar-heading + .sidebar-item-children &.active {
123
+ border-left-color: transparent;
124
+ }
125
+ }
126
+ }
127
+
128
+ a.sidebar-item {
129
+ cursor: pointer;
130
+
131
+ &:hover {
132
+ color: var(--c-text-accent);
133
+ }
134
+ }
File without changes
@@ -0,0 +1,22 @@
1
+ /**
2
+ * dropdown
3
+ */
4
+ .dropdown-enter-from,
5
+ .dropdown-leave-to {
6
+ height: 0 !important;
7
+ }
8
+
9
+ /**
10
+ * fade-slide-y
11
+ */
12
+ .fade-slide-y-enter-active {
13
+ transition: all 0.2s ease;
14
+ }
15
+ .fade-slide-y-leave-active {
16
+ transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
17
+ }
18
+ .fade-slide-y-enter-from,
19
+ .fade-slide-y-leave-to {
20
+ transform: translateY(10px);
21
+ opacity: 0;
22
+ }
@@ -0,0 +1,46 @@
1
+ html.dark {
2
+ // brand colors
3
+ --c-brand: #3aa675;
4
+ --c-brand-light: #349469;
5
+
6
+ // background colors
7
+ --c-bg: #22272e;
8
+ --c-bg-light: #2b313a;
9
+ --c-bg-lighter: #262c34;
10
+
11
+ // text colors
12
+ --c-text: #adbac7;
13
+ --c-text-light: #96a7b7;
14
+ --c-text-lighter: #8b9eb0;
15
+ --c-text-lightest: #8094a8;
16
+
17
+ // border colors
18
+ --c-border: #3e4c5a;
19
+ --c-border-dark: #34404c;
20
+
21
+ // custom container colors
22
+ --c-tip: #318a62;
23
+ --c-warning: #ceab00;
24
+ --c-warning-bg: #7e755b;
25
+ --c-warning-title: #ceac03;
26
+ --c-warning-text: #362e00;
27
+ --c-danger: #940000;
28
+ --c-danger-bg: #806161;
29
+ --c-danger-title: #610000;
30
+ --c-danger-text: #3a0000;
31
+ --c-details-bg: #323843;
32
+
33
+ // code blocks vars
34
+ --code-hl-bg-color: #363b46;
35
+ }
36
+
37
+ // plugin-docsearch
38
+ html.dark .DocSearch {
39
+ --docsearch-logo-color: var(--c-text);
40
+ --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
41
+ --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d,
42
+ 0 2px 2px 0 rgba(3, 4, 9, 0.3);
43
+ --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);
44
+ --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
45
+ 0 -4px 8px 0 rgba(0, 0, 0, 0.2);
46
+ }
@@ -0,0 +1,133 @@
1
+ :root {
2
+ // brand colors
3
+ --c-brand: #3eaf7c;
4
+ --c-brand-light: #4abf8a;
5
+
6
+ // background colors
7
+ --c-bg: #ffffff;
8
+ --c-bg-light: #f3f4f5;
9
+ --c-bg-lighter: #eeeeee;
10
+ --c-bg-navbar: var(--c-bg);
11
+ --c-bg-sidebar: var(--c-bg);
12
+ --c-bg-arrow: #cccccc;
13
+
14
+ // text colors
15
+ --c-text: #2c3e50;
16
+ --c-text-accent: var(--c-brand);
17
+ --c-text-light: #3a5169;
18
+ --c-text-lighter: #4e6e8e;
19
+ --c-text-lightest: #6a8bad;
20
+ --c-text-quote: #999999;
21
+
22
+ // border colors
23
+ --c-border: #eaecef;
24
+ --c-border-dark: #dfe2e5;
25
+
26
+ // custom container colors
27
+ --c-tip: #42b983;
28
+ --c-tip-bg: var(--c-bg-light);
29
+ --c-tip-title: var(--c-text);
30
+ --c-tip-text: var(--c-text);
31
+ --c-tip-text-accent: var(--c-text-accent);
32
+ --c-warning: #e7c000;
33
+ --c-warning-bg: #fffae3;
34
+ --c-warning-title: #ad9000;
35
+ --c-warning-text: #746000;
36
+ --c-warning-text-accent: var(--c-text);
37
+ --c-danger: #cc0000;
38
+ --c-danger-bg: #ffe0e0;
39
+ --c-danger-title: #990000;
40
+ --c-danger-text: #660000;
41
+ --c-danger-text-accent: var(--c-text);
42
+ --c-details-bg: #eeeeee;
43
+
44
+ // badge component colors
45
+ --c-badge-tip: var(--c-tip);
46
+ --c-badge-warning: var(--c-warning);
47
+ --c-badge-danger: var(--c-danger);
48
+
49
+ // transition vars
50
+ --t-color: 0.3s ease;
51
+ --t-transform: 0.3s ease;
52
+
53
+ // code blocks vars
54
+ --code-bg-color: #282c34;
55
+ --code-hl-bg-color: rgba(0, 0, 0, 0.66);
56
+ --code-ln-color: #9e9e9e;
57
+ --code-ln-wrapper-width: 3.5rem;
58
+
59
+ // font vars
60
+ --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
61
+ Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
62
+ --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
63
+
64
+ // layout vars
65
+ --navbar-height: 3.6rem;
66
+ --navbar-padding-v: 0.7rem;
67
+ --navbar-padding-h: 1.5rem;
68
+ --sidebar-width: 20rem;
69
+ --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
70
+ --content-width: 740px;
71
+ --homepage-width: 960px;
72
+ }
73
+
74
+ // plugin-back-to-top
75
+ .back-to-top {
76
+ --back-to-top-color: var(--c-brand);
77
+ --back-to-top-color-hover: var(--c-brand-light);
78
+ }
79
+
80
+ // plugin-docsearch
81
+ .DocSearch {
82
+ --docsearch-primary-color: var(--c-brand);
83
+ --docsearch-text-color: var(--c-text);
84
+ --docsearch-highlight-color: var(--c-brand);
85
+ --docsearch-muted-color: var(--c-text-quote);
86
+ --docsearch-container-background: rgba(9, 10, 17, 0.8);
87
+ --docsearch-modal-background: var(--c-bg-light);
88
+ --docsearch-searchbox-background: var(--c-bg-lighter);
89
+ --docsearch-searchbox-focus-background: var(--c-bg);
90
+ --docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);
91
+ --docsearch-hit-color: var(--c-text-light);
92
+ --docsearch-hit-active-color: var(--c-bg);
93
+ --docsearch-hit-background: var(--c-bg);
94
+ --docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);
95
+ --docsearch-footer-background: var(--c-bg);
96
+ }
97
+
98
+ // plugin-external-link-icon
99
+ .external-link-icon {
100
+ --external-link-icon-color: var(--c-text-quote);
101
+ }
102
+
103
+ // plugin-medium-zoom
104
+ .medium-zoom-overlay {
105
+ --medium-zoom-bg-color: var(--c-bg);
106
+ }
107
+
108
+ // plugin-nprogress
109
+ #nprogress {
110
+ --nprogress-color: var(--c-brand);
111
+ }
112
+
113
+ // plugin-pwa-popup
114
+ .pwa-popup {
115
+ --pwa-popup-text-color: var(--c-text);
116
+ --pwa-popup-bg-color: var(--c-bg);
117
+ --pwa-popup-border-color: var(--c-brand);
118
+ --pwa-popup-shadow: 0 4px 16px var(--c-brand);
119
+ --pwa-popup-btn-text-color: var(--c-bg);
120
+ --pwa-popup-btn-bg-color: var(--c-brand);
121
+ --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
122
+ }
123
+
124
+ // plugin-search
125
+ .search-box {
126
+ --search-bg-color: var(--c-bg);
127
+ --search-accent-color: var(--c-brand);
128
+ --search-text-color: var(--c-text);
129
+ --search-border-color: var(--c-border);
130
+
131
+ --search-item-text-color: var(--c-text-lighter);
132
+ --search-item-focus-bg-color: var(--c-bg-light);
133
+ }
@@ -0,0 +1,3 @@
1
+ export * from './isActiveSidebarItem.js';
2
+ export * from './resolveEditLink.js';
3
+ export * from './resolveRepoType.js';
@@ -0,0 +1,3 @@
1
+ export * from './isActiveSidebarItem.js';
2
+ export * from './resolveEditLink.js';
3
+ export * from './resolveRepoType.js';
@@ -0,0 +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;
@@ -0,0 +1,20 @@
1
+ const normalizePath = (path) => decodeURI(path)
2
+ .replace(/#.*$/, '')
3
+ .replace(/(index)?\.(md|html)$/, '');
4
+ const isActiveLink = (link, route) => {
5
+ if (route.hash === link) {
6
+ return true;
7
+ }
8
+ const currentPath = normalizePath(route.path);
9
+ const targetPath = normalizePath(link);
10
+ return currentPath === targetPath;
11
+ };
12
+ export const isActiveSidebarItem = (item, route) => {
13
+ if (item.link && isActiveLink(item.link, route)) {
14
+ return true;
15
+ }
16
+ if (item.children) {
17
+ return item.children.some((child) => isActiveSidebarItem(child, route));
18
+ }
19
+ return false;
20
+ };
@@ -1,9 +1,9 @@
1
- import type { RepoType } from './resolveRepoType';
1
+ import type { RepoType } from './resolveRepoType.js';
2
2
  export declare const editLinkPatterns: 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
- filePathRelative: string;
7
+ filePathRelative: string | null;
8
8
  editLinkPattern?: string | undefined;
9
9
  }) => string | null;
@@ -1,23 +1,29 @@
1
- import { removeLeadingSlash, removeEndingSlash } from '@vuepress/shared';
2
- import { resolveRepoType } from './resolveRepoType';
1
+ import { isLinkHttp, removeEndingSlash, removeLeadingSlash, } from '@vuepress/shared';
2
+ import { resolveRepoType } from './resolveRepoType.js';
3
3
  export const editLinkPatterns = {
4
4
  GitHub: ':repo/edit/:branch/:path',
5
5
  GitLab: ':repo/-/edit/:branch/:path',
6
+ Gitee: ':repo/edit/:branch/:path',
6
7
  Bitbucket: ':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',
7
8
  };
8
- export const resolveEditLink = ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }) => {
9
- const repoType = resolveRepoType(docsRepo);
10
- let pattern;
9
+ const resolveEditLinkPatterns = ({ docsRepo, editLinkPattern, }) => {
11
10
  if (editLinkPattern) {
12
- pattern = editLinkPattern;
11
+ return editLinkPattern;
13
12
  }
14
- else if (repoType !== null) {
15
- pattern = editLinkPatterns[repoType];
13
+ const repoType = resolveRepoType(docsRepo);
14
+ if (repoType !== null) {
15
+ return editLinkPatterns[repoType];
16
16
  }
17
+ return null;
18
+ };
19
+ export const resolveEditLink = ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }) => {
20
+ if (!filePathRelative)
21
+ return null;
22
+ const pattern = resolveEditLinkPatterns({ docsRepo, editLinkPattern });
17
23
  if (!pattern)
18
24
  return null;
19
25
  return pattern
20
- .replace(/:repo/, repoType === 'GitHub' ? `https://github.com/${docsRepo}` : docsRepo)
26
+ .replace(/:repo/, isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`)
21
27
  .replace(/:branch/, docsBranch)
22
28
  .replace(/:path/, removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`));
23
29
  };
@@ -0,0 +1,2 @@
1
+ export declare type RepoType = 'GitHub' | 'GitLab' | 'Gitee' | 'Bitbucket' | null;
2
+ export declare const resolveRepoType: (repo: string) => RepoType;
@@ -1,10 +1,12 @@
1
1
  import { isLinkHttp } from '@vuepress/shared';
2
2
  export const resolveRepoType = (repo) => {
3
- if (!isLinkHttp(repo))
3
+ if (!isLinkHttp(repo) || /github\.com/.test(repo))
4
4
  return 'GitHub';
5
5
  if (/bitbucket\.org/.test(repo))
6
6
  return 'Bitbucket';
7
7
  if (/gitlab\.com/.test(repo))
8
8
  return 'GitLab';
9
+ if (/gitee\.com/.test(repo))
10
+ return 'Gitee';
9
11
  return null;
10
12
  };
@@ -0,0 +1,10 @@
1
+ import type { Theme } from '@vuepress/core';
2
+ import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../shared/index.js';
3
+ export interface DefaultThemeOptions extends DefaultThemeLocaleOptions {
4
+ /**
5
+ * To avoid confusion with the root `plugins` option,
6
+ * we use `themePlugins`
7
+ */
8
+ themePlugins?: DefaultThemePluginsOptions;
9
+ }
10
+ export declare const defaultTheme: ({ themePlugins, ...localeOptions }?: DefaultThemeOptions) => Theme;