@vuepress/theme-default 2.0.0-rc.3 → 2.0.0-rc.30

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 (51) hide show
  1. package/lib/client/components/HomeHero.vue +2 -2
  2. package/lib/client/components/Navbar.vue +10 -9
  3. package/lib/client/components/NavbarBrand.vue +3 -2
  4. package/lib/client/components/NavbarDropdown.vue +4 -5
  5. package/lib/client/components/NavbarItems.vue +36 -37
  6. package/lib/client/components/PageMeta.vue +123 -27
  7. package/lib/client/components/PageNav.vue +133 -27
  8. package/lib/client/components/SidebarItem.vue +2 -3
  9. package/lib/client/components/SidebarItems.vue +1 -1
  10. package/lib/client/composables/index.d.ts +1 -0
  11. package/lib/client/composables/index.js +1 -0
  12. package/lib/client/composables/useNavigate.d.ts +1 -0
  13. package/lib/client/composables/useNavigate.js +25 -0
  14. package/lib/client/composables/useSidebarItems.d.ts +3 -4
  15. package/lib/client/composables/useSidebarItems.js +10 -12
  16. package/lib/client/composables/useUpdateDeviceStatus.js +3 -2
  17. package/lib/client/config.js +7 -11
  18. package/lib/client/index.d.ts +1 -1
  19. package/lib/client/index.js +0 -1
  20. package/lib/client/layouts/Layout.vue +8 -2
  21. package/lib/client/layouts/NotFound.vue +2 -2
  22. package/lib/client/styles/arrow.scss +18 -24
  23. package/lib/client/styles/custom-container.scss +4 -8
  24. package/lib/client/styles/external-link-icon.scss +33 -0
  25. package/lib/client/styles/index.scss +1 -0
  26. package/lib/client/styles/layout.scss +4 -0
  27. package/lib/client/styles/navbar-dropdown.scss +2 -2
  28. package/lib/client/styles/navbar.scss +4 -4
  29. package/lib/client/styles/page.scss +0 -76
  30. package/lib/client/styles/sidebar.scss +1 -1
  31. package/lib/client/styles/vars-dark.scss +7 -0
  32. package/lib/client/styles/vars.scss +63 -14
  33. package/lib/client/utils/getNavLink.d.ts +3 -9
  34. package/lib/client/utils/getNavLink.js +10 -11
  35. package/lib/client/utils/index.d.ts +0 -1
  36. package/lib/client/utils/index.js +0 -1
  37. package/lib/client/utils/isActiveSidebarItem.d.ts +1 -1
  38. package/lib/client/utils/resolveEditLink.d.ts +1 -1
  39. package/lib/node/defaultTheme.js +28 -22
  40. package/lib/node/index.d.ts +2 -1
  41. package/lib/node/index.js +1 -1
  42. package/lib/node/utils/resolveContainerPluginOptions.d.ts +3 -3
  43. package/lib/node/utils/resolveContainerPluginOptions.js +2 -2
  44. package/lib/shared/nav.d.ts +3 -11
  45. package/lib/shared/options.d.ts +25 -4
  46. package/lib/shared/page.d.ts +5 -3
  47. package/package.json +21 -20
  48. package/templates/build.html +13 -10
  49. package/lib/client/components/AutoLink.vue +0 -113
  50. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  51. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import SidebarItem from '@theme/SidebarItem.vue'
3
3
  import { onMounted, watch } from 'vue'
4
- import { useRoute } from 'vue-router'
4
+ import { useRoute } from 'vuepress/client'
5
5
  import { useSidebarItems } from '../composables/index.js'
6
6
 
7
7
  const route = useRoute()
@@ -1,4 +1,5 @@
1
1
  export * from './useDarkMode.js';
2
+ export * from './useNavigate.js';
2
3
  export * from './useScrollPromise.js';
3
4
  export * from './useSidebarItems.js';
4
5
  export * from './useThemeData.js';
@@ -1,4 +1,5 @@
1
1
  export * from './useDarkMode.js';
2
+ export * from './useNavigate.js';
2
3
  export * from './useScrollPromise.js';
3
4
  export * from './useSidebarItems.js';
4
5
  export * from './useThemeData.js';
@@ -0,0 +1 @@
1
+ export declare const useNavigate: () => ((url: string) => void);
@@ -0,0 +1,25 @@
1
+ import { isLinkAbsolute, isLinkWithProtocol } from '@vuepress/helper/client';
2
+ import { useRoute, useRouter } from 'vuepress/client';
3
+ const FAKE_HOST = 'http://.';
4
+ export const useNavigate = () => {
5
+ const router = useRouter();
6
+ const route = useRoute();
7
+ return (url) => {
8
+ if (url)
9
+ if (isLinkAbsolute(url)) {
10
+ // Inner absolute path
11
+ if (route.path !== url)
12
+ router.push(url);
13
+ }
14
+ else if (isLinkWithProtocol(url)) {
15
+ // Outer url
16
+ if (window)
17
+ window.open(url);
18
+ }
19
+ else {
20
+ // Inner relative path
21
+ const loc = route.path.slice(0, route.path.lastIndexOf('/'));
22
+ router.push(new URL(`${loc}/${encodeURI(url)}`, FAKE_HOST).pathname);
23
+ }
24
+ };
25
+ };
@@ -1,5 +1,4 @@
1
1
  import type { ComputedRef, InjectionKey } from 'vue';
2
- import type { Router } from 'vue-router';
3
2
  import type { PageData, PageHeader } from 'vuepress/client';
4
3
  import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, ResolvedSidebarItem, SidebarConfigArray, SidebarConfigObject } from '../../shared/index.js';
5
4
  export type SidebarItemsRef = ComputedRef<ResolvedSidebarItem[]>;
@@ -17,7 +16,7 @@ export declare const setupSidebarItems: () => void;
17
16
  *
18
17
  * It should only be resolved and provided once
19
18
  */
20
- export declare const resolveSidebarItems: (frontmatter: DefaultThemeNormalPageFrontmatter, themeLocale: DefaultThemeData, page: PageData, router: Router, path: string) => ResolvedSidebarItem[];
19
+ export declare const resolveSidebarItems: (frontmatter: DefaultThemeNormalPageFrontmatter, themeLocale: DefaultThemeData, page: PageData, path: string) => ResolvedSidebarItem[];
21
20
  /**
22
21
  * Util to transform page header to sidebar item
23
22
  */
@@ -30,8 +29,8 @@ export declare const resolveAutoSidebarItems: (page: PageData, sidebarDepth: num
30
29
  /**
31
30
  * Resolve sidebar items if the config is an array
32
31
  */
33
- export declare const resolveArraySidebarItems: (page: PageData, router: Router, path: string, sidebarConfig: SidebarConfigArray, sidebarDepth: number) => ResolvedSidebarItem[];
32
+ export declare const resolveArraySidebarItems: (page: PageData, path: string, sidebarConfig: SidebarConfigArray, sidebarDepth: number) => ResolvedSidebarItem[];
34
33
  /**
35
34
  * Resolve sidebar items if the config is a key -> value (path-prefix -> array) object
36
35
  */
37
- export declare const resolveMultiSidebarItems: (page: PageData, router: Router, path: string, sidebarConfig: SidebarConfigObject, sidebarDepth: number) => ResolvedSidebarItem[];
36
+ export declare const resolveMultiSidebarItems: (page: PageData, path: string, sidebarConfig: SidebarConfigObject, sidebarDepth: number) => ResolvedSidebarItem[];
@@ -1,8 +1,7 @@
1
1
  import { computed, inject, provide } from 'vue';
2
- import { useRoute, useRouter } from 'vue-router';
3
- import { usePageData, usePageFrontmatter } from 'vuepress/client';
2
+ import { usePageData, usePageFrontmatter, useRoute } from 'vuepress/client';
4
3
  import { isPlainObject, isString, resolveLocalePath } from 'vuepress/shared';
5
- import { getNavLink } from '../utils/index.js';
4
+ import { getAutoLink } from '../utils/index.js';
6
5
  import { useThemeLocaleData } from './useThemeData.js';
7
6
  export const sidebarItemsSymbol = Symbol('sidebarItems');
8
7
  /**
@@ -23,8 +22,7 @@ export const setupSidebarItems = () => {
23
22
  const frontmatter = usePageFrontmatter();
24
23
  const page = usePageData();
25
24
  const route = useRoute();
26
- const router = useRouter();
27
- const sidebarItems = computed(() => resolveSidebarItems(frontmatter.value, themeLocale.value, page.value, router, route.path));
25
+ const sidebarItems = computed(() => resolveSidebarItems(frontmatter.value, themeLocale.value, page.value, route.path));
28
26
  provide(sidebarItemsSymbol, sidebarItems);
29
27
  };
30
28
  /**
@@ -32,7 +30,7 @@ export const setupSidebarItems = () => {
32
30
  *
33
31
  * It should only be resolved and provided once
34
32
  */
35
- export const resolveSidebarItems = (frontmatter, themeLocale, page, router, path) => {
33
+ export const resolveSidebarItems = (frontmatter, themeLocale, page, path) => {
36
34
  // get sidebar config from frontmatter > theme data
37
35
  const sidebarConfig = frontmatter.sidebar ?? themeLocale.sidebar ?? 'auto';
38
36
  const sidebarDepth = frontmatter.sidebarDepth ?? themeLocale.sidebarDepth ?? 2;
@@ -44,10 +42,10 @@ export const resolveSidebarItems = (frontmatter, themeLocale, page, router, path
44
42
  return resolveAutoSidebarItems(page, sidebarDepth);
45
43
  }
46
44
  if (Array.isArray(sidebarConfig)) {
47
- return resolveArraySidebarItems(page, router, path, sidebarConfig, sidebarDepth);
45
+ return resolveArraySidebarItems(page, path, sidebarConfig, sidebarDepth);
48
46
  }
49
47
  if (isPlainObject(sidebarConfig)) {
50
- return resolveMultiSidebarItems(page, router, path, sidebarConfig, sidebarDepth);
48
+ return resolveMultiSidebarItems(page, path, sidebarConfig, sidebarDepth);
51
49
  }
52
50
  return [];
53
51
  };
@@ -76,11 +74,11 @@ export const resolveAutoSidebarItems = (page, sidebarDepth) => {
76
74
  /**
77
75
  * Resolve sidebar items if the config is an array
78
76
  */
79
- export const resolveArraySidebarItems = (page, router, path, sidebarConfig, sidebarDepth) => {
77
+ export const resolveArraySidebarItems = (page, path, sidebarConfig, sidebarDepth) => {
80
78
  const handleChildItem = (item) => {
81
79
  let childItem;
82
80
  if (isString(item)) {
83
- childItem = getNavLink(router, item);
81
+ childItem = getAutoLink(item);
84
82
  }
85
83
  else {
86
84
  childItem = item;
@@ -108,11 +106,11 @@ export const resolveArraySidebarItems = (page, router, path, sidebarConfig, side
108
106
  /**
109
107
  * Resolve sidebar items if the config is a key -> value (path-prefix -> array) object
110
108
  */
111
- export const resolveMultiSidebarItems = (page, router, path, sidebarConfig, sidebarDepth) => {
109
+ export const resolveMultiSidebarItems = (page, path, sidebarConfig, sidebarDepth) => {
112
110
  const sidebarPath = resolveLocalePath(sidebarConfig, path);
113
111
  const matchedSidebarConfig = sidebarConfig[sidebarPath] ?? [];
114
112
  if (matchedSidebarConfig === 'heading') {
115
113
  return resolveAutoSidebarItems(page, sidebarDepth);
116
114
  }
117
- return resolveArraySidebarItems(page, router, path, matchedSidebarConfig, sidebarDepth);
115
+ return resolveArraySidebarItems(page, path, matchedSidebarConfig, sidebarDepth);
118
116
  };
@@ -1,3 +1,4 @@
1
+ import { useEventListener } from '@vueuse/core';
1
2
  import { onMounted } from 'vue';
2
3
  import cssVars from '../styles/_variables.module.scss?module';
3
4
  export var DeviceType;
@@ -17,9 +18,9 @@ export const useUpdateDeviceStatus = (deviceType, callback) => {
17
18
  throw new Error('device width must be a integer');
18
19
  return;
19
20
  }
21
+ useEventListener('orientationchange', () => callback(width), false);
22
+ useEventListener('resize', () => callback(width), false);
20
23
  onMounted(() => {
21
24
  callback(width);
22
- window.addEventListener('resize', () => callback(width), false);
23
- window.addEventListener('orientationchange', () => callback(width), false);
24
25
  });
25
26
  };
@@ -1,3 +1,4 @@
1
+ import { hasGlobalComponent } from '@vuepress/helper/client';
1
2
  import { h } from 'vue';
2
3
  import { defineClientConfig } from 'vuepress/client';
3
4
  import { Badge, CodeGroup, CodeGroupItem } from './components/global/index.js';
@@ -7,17 +8,12 @@ import NotFound from './layouts/NotFound.vue';
7
8
  import './styles/index.scss';
8
9
  export default defineClientConfig({
9
10
  enhance({ app, router }) {
10
- app.component('Badge', Badge);
11
- app.component('CodeGroup', CodeGroup);
12
- app.component('CodeGroupItem', CodeGroupItem);
13
- // compat with @vuepress/plugin-external-link-icon
14
- app.component('AutoLinkExternalIcon', () => {
15
- const ExternalLinkIcon = app.component('ExternalLinkIcon');
16
- if (ExternalLinkIcon) {
17
- return h(ExternalLinkIcon);
18
- }
19
- return null;
20
- });
11
+ if (!hasGlobalComponent('Badge'))
12
+ app.component('Badge', Badge);
13
+ if (!hasGlobalComponent('CodeGroup'))
14
+ app.component('CodeGroup', CodeGroup);
15
+ if (!hasGlobalComponent('CodeGroupItem'))
16
+ app.component('CodeGroupItem', CodeGroupItem);
21
17
  // compat with @vuepress/plugin-docsearch and @vuepress/plugin-search
22
18
  app.component('NavbarSearch', () => {
23
19
  const SearchComponent = app.component('Docsearch') || app.component('SearchBox');
@@ -1,3 +1,3 @@
1
- export * from '../shared/index.js';
2
1
  export * from './composables/index.js';
3
2
  export * from './utils/index.js';
3
+ export type * from '../shared/index.js';
@@ -1,3 +1,2 @@
1
- export * from '../shared/index.js';
2
1
  export * from './composables/index.js';
3
2
  export * from './utils/index.js';
@@ -4,8 +4,7 @@ import Navbar from '@theme/Navbar.vue'
4
4
  import Page from '@theme/Page.vue'
5
5
  import Sidebar from '@theme/Sidebar.vue'
6
6
  import { computed, onMounted, onUnmounted, ref } from 'vue'
7
- import { useRouter } from 'vue-router'
8
- import { usePageData, usePageFrontmatter } from 'vuepress/client'
7
+ import { usePageData, usePageFrontmatter, useRouter } from 'vuepress/client'
9
8
  import type { DefaultThemePageFrontmatter } from '../../shared/index.js'
10
9
  import {
11
10
  useScrollPromise,
@@ -60,12 +59,19 @@ const onTouchEnd = (e): void => {
60
59
  }
61
60
  }
62
61
 
62
+ // external-link-icon
63
+ const enableExternalLinkIcon = computed(
64
+ () =>
65
+ frontmatter.value.externalLinkIcon ?? themeLocale.externalLinkIcon ?? true,
66
+ )
67
+
63
68
  // classes
64
69
  const containerClass = computed(() => [
65
70
  {
66
71
  'no-navbar': !shouldShowNavbar.value,
67
72
  'no-sidebar': !sidebarItems.value.length,
68
73
  'sidebar-open': isSidebarOpen.value,
74
+ 'external-link-icon': enableExternalLinkIcon.value,
69
75
  },
70
76
  frontmatter.value.pageClass,
71
77
  ])
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { useRouteLocale } from 'vuepress/client'
2
+ import { RouteLink, useRouteLocale } from 'vuepress/client'
3
3
  import { useThemeLocaleData } from '../composables/index.js'
4
4
 
5
5
  const routeLocale = useRouteLocale()
@@ -20,7 +20,7 @@ const homeText = themeLocale.value.backToHome ?? 'Back to home'
20
20
 
21
21
  <blockquote>{{ getMsg() }}</blockquote>
22
22
 
23
- <RouterLink :to="homeLink">{{ homeText }}</RouterLink>
23
+ <RouteLink :to="homeLink">{{ homeText }}</RouteLink>
24
24
  </div>
25
25
  </main>
26
26
  </div>
@@ -1,37 +1,31 @@
1
1
  .arrow {
2
2
  display: inline-block;
3
- width: 0;
4
- height: 0;
5
-
6
- &.up {
7
- border: {
8
- left: 4px solid transparent;
9
- right: 4px solid transparent;
10
- bottom: 6px solid var(--c-bg-arrow);
11
- }
3
+ vertical-align: middle;
4
+
5
+ width: 1em;
6
+ height: 1em;
7
+
8
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
9
+ background-position: center;
10
+ background-repeat: no-repeat;
11
+
12
+ line-height: normal;
13
+
14
+ transition: all 0.3s;
15
+
16
+ html.dark & {
17
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
12
18
  }
13
19
 
14
20
  &.down {
15
- border: {
16
- left: 4px solid transparent;
17
- right: 4px solid transparent;
18
- top: 6px solid var(--c-bg-arrow);
19
- }
21
+ transform: rotate(180deg);
20
22
  }
21
23
 
22
24
  &.right {
23
- border: {
24
- top: 4px solid transparent;
25
- bottom: 4px solid transparent;
26
- left: 6px solid var(--c-bg-arrow);
27
- }
25
+ transform: rotate(90deg);
28
26
  }
29
27
 
30
28
  &.left {
31
- border: {
32
- top: 4px solid transparent;
33
- bottom: 4px solid transparent;
34
- right: 6px solid var(--c-bg-arrow);
35
- }
29
+ transform: rotate(-90deg);
36
30
  }
37
31
  }
@@ -39,6 +39,8 @@
39
39
  }
40
40
 
41
41
  &.warning {
42
+ --external-link-icon-color: var(--c-warning-text-quote);
43
+
42
44
  border-color: var(--c-warning);
43
45
  background-color: var(--c-warning-bg);
44
46
  color: var(--c-warning-text);
@@ -68,13 +70,11 @@
68
70
  background-color: var(--c-warning-bg-lighter);
69
71
  }
70
72
  }
71
-
72
- .external-link-icon {
73
- --external-link-icon-color: var(--c-warning-text-quote);
74
- }
75
73
  }
76
74
 
77
75
  &.danger {
76
+ --external-link-icon-color: var(--c-danger-text-quote);
77
+
78
78
  border-color: var(--c-danger);
79
79
  background-color: var(--c-danger-bg);
80
80
  color: var(--c-danger-text);
@@ -104,10 +104,6 @@
104
104
  background-color: var(--c-danger-bg-lighter);
105
105
  }
106
106
  }
107
-
108
- .external-link-icon {
109
- --external-link-icon-color: var(--c-danger-text-quote);
110
- }
111
107
  }
112
108
 
113
109
  &.details {
@@ -0,0 +1,33 @@
1
+ @mixin external-link-icon {
2
+ &::after {
3
+ content: '';
4
+ display: inline-block;
5
+ margin-top: -1px;
6
+ margin-left: 4px;
7
+ width: 11px;
8
+ height: 11px;
9
+ background: var(--external-link-icon-color);
10
+ flex-shrink: 0;
11
+ -webkit-mask-image: var(--external-link-icon);
12
+ mask-image: var(--external-link-icon);
13
+ }
14
+ }
15
+
16
+ .vp-external-link-icon {
17
+ @include external-link-icon;
18
+ }
19
+
20
+ .external-link-icon {
21
+ .external-link {
22
+ @include external-link-icon;
23
+ }
24
+
25
+ .theme-default-content {
26
+ a[href*="://"],
27
+ a[target=_blank] {
28
+ &:not(.no-external-link-icon) {
29
+ @include external-link-icon;
30
+ }
31
+ }
32
+ }
33
+ }
@@ -7,6 +7,7 @@
7
7
  @use 'code';
8
8
  @use 'code-group';
9
9
  @use 'custom-container';
10
+ @use 'external-link-icon';
10
11
  @use 'home';
11
12
  @use 'layout';
12
13
  @use 'navbar';
@@ -201,3 +201,7 @@
201
201
  font-size: 1.9rem;
202
202
  }
203
203
  }
204
+
205
+ #vp-comment {
206
+ @include content_wrapper;
207
+ }
@@ -54,7 +54,7 @@
54
54
 
55
55
  & > a {
56
56
  font-weight: inherit;
57
- &.router-link-active {
57
+ &.route-link-active {
58
58
  &::after {
59
59
  display: none;
60
60
  }
@@ -84,7 +84,7 @@
84
84
  color: var(--c-text-accent);
85
85
  }
86
86
 
87
- &.router-link-active {
87
+ &.route-link-active {
88
88
  color: var(--c-text-accent);
89
89
 
90
90
  &::after {
@@ -76,7 +76,7 @@
76
76
  color: inherit;
77
77
 
78
78
  &:hover,
79
- &.router-link-active {
79
+ &.route-link-active {
80
80
  color: var(--c-text);
81
81
  }
82
82
  }
@@ -93,7 +93,7 @@
93
93
 
94
94
  > a {
95
95
  &:hover,
96
- &.router-link-active {
96
+ &.route-link-active {
97
97
  margin-bottom: -2px;
98
98
  border-bottom: 2px solid var(--c-text-accent);
99
99
  }
@@ -108,7 +108,7 @@
108
108
 
109
109
  > a {
110
110
  &:hover,
111
- &.router-link-active {
111
+ &.route-link-active {
112
112
  margin-bottom: 0;
113
113
  border-bottom: none;
114
114
  }
@@ -117,7 +117,7 @@
117
117
 
118
118
  a {
119
119
  &:hover,
120
- &.router-link-active {
120
+ &.route-link-active {
121
121
  color: var(--c-text-accent);
122
122
  }
123
123
  }
@@ -1,5 +1,4 @@
1
1
  @import '_mixins';
2
- @import '_variables';
3
2
 
4
3
  .page {
5
4
  padding-bottom: 2rem;
@@ -10,78 +9,3 @@
10
9
  padding-top: 0;
11
10
  }
12
11
  }
13
-
14
- .page-meta {
15
- @include content_wrapper;
16
- padding-top: 1rem;
17
- padding-bottom: 1rem;
18
- overflow: auto;
19
-
20
- .meta-item {
21
- cursor: default;
22
- margin-top: 0.8rem;
23
-
24
- .meta-item-label {
25
- font-weight: 500;
26
- color: var(--c-text-lighter);
27
- }
28
-
29
- .meta-item-info {
30
- font-weight: 400;
31
- color: var(--c-text-quote);
32
- }
33
- }
34
-
35
- .edit-link {
36
- display: inline-block;
37
- margin-right: 0.25rem;
38
-
39
- @media print {
40
- display: none;
41
- }
42
- }
43
-
44
- .last-updated {
45
- float: right;
46
- }
47
- }
48
-
49
- @media (max-width: $MQMobile) {
50
- .page-meta {
51
- .last-updated {
52
- font-size: 0.8em;
53
- float: none;
54
- }
55
-
56
- .contributors {
57
- font-size: 0.8em;
58
- }
59
- }
60
- }
61
-
62
- .page-nav {
63
- @include content_wrapper;
64
- padding-top: 1rem;
65
- padding-bottom: 0;
66
-
67
- .inner {
68
- min-height: 2rem;
69
- margin-top: 0;
70
- border-top: 1px solid var(--c-border);
71
- transition: border-color var(--t-color);
72
- padding-top: 1rem;
73
- overflow: auto;
74
- }
75
-
76
- .prev {
77
- a:before {
78
- content: '←';
79
- }
80
- }
81
- .next {
82
- float: right;
83
- a:after {
84
- content: '→';
85
- }
86
- }
87
- }
@@ -43,7 +43,7 @@
43
43
  .navbar-dropdown-wrapper
44
44
  .navbar-dropdown
45
45
  .navbar-dropdown-item
46
- a.router-link-active::after {
46
+ a.route-link-active::after {
47
47
  top: calc(1rem - 2px);
48
48
  }
49
49
  }
@@ -66,3 +66,10 @@ html.dark .DocSearch {
66
66
  --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
67
67
  0 -4px 8px 0 rgba(0, 0, 0, 0.2);
68
68
  }
69
+
70
+ // plugin-pwa
71
+ html.dark body {
72
+ --pwa-shadow-color: rgb(0 0 0 / 30%);
73
+ --pwa-content-color: #ccc;
74
+ --pwa-content-light-color: #999;
75
+ }
@@ -91,12 +91,37 @@
91
91
  --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
92
92
  --content-width: 740px;
93
93
  --homepage-width: 960px;
94
+
95
+ // external-link-icon
96
+ --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");
97
+ --external-link-icon-color: var(--c-text-quote);
94
98
  }
95
99
 
96
100
  // plugin-back-to-top
97
- .back-to-top {
101
+ .vp-back-to-top-button {
98
102
  --back-to-top-color: var(--c-brand);
99
103
  --back-to-top-color-hover: var(--c-brand-light);
104
+ --back-to-top-bg-color: var(--c-bg);
105
+ }
106
+
107
+ // plugin-catalog
108
+ .vp-catalog-wrapper {
109
+ --catalog-bg-color: var(--c-bg);
110
+ --catalog-bg-secondary-color: var(--c-bg-dark);
111
+ --catalog-border-color: var(--c-border);
112
+ --catalog-active-color: var(--c-brand);
113
+ --catalog-hover-color: var(--c-brand-light);
114
+ }
115
+
116
+ // plugin-comment
117
+ .waline-wrapper {
118
+ --waline-bg-color: var(--c-bg);
119
+ --waline-bg-color-light: var(--c-bg-light);
120
+ --waline-text-color: var(--c-color);
121
+ --waline-border: 1px solid var(--c-border);
122
+ --waline-border-color: var(--c-border);
123
+ --waline-theme-color: var(--c-brand);
124
+ --waline-active-color: var(--c-brand-light);
100
125
  }
101
126
 
102
127
  // plugin-docsearch
@@ -117,30 +142,54 @@
117
142
  --docsearch-footer-background: var(--c-bg);
118
143
  }
119
144
 
120
- // plugin-external-link-icon
121
- .external-link-icon {
122
- --external-link-icon-color: var(--c-text-quote);
123
- }
124
-
125
145
  // plugin-medium-zoom
126
146
  .medium-zoom-overlay {
127
147
  --medium-zoom-bg-color: var(--c-bg);
128
148
  }
129
149
 
150
+ // plugin-notice
151
+ .vp-notice-wrapper {
152
+ --notice-color: var(--c-text);
153
+ --notice-bg-color: var(--c-bg);
154
+
155
+ --notice-primary-color: var(--c-brand);
156
+ --notice-primary-text-color: var(--c-bg);
157
+ --notice-primary-hover-color: var(--c-brand-light);
158
+
159
+ --notice-button-color: var(--c-bg-light);
160
+ --notice-button-hover-color: var(--c-bg-lighter);
161
+ }
162
+
130
163
  // plugin-nprogress
131
164
  #nprogress {
132
165
  --nprogress-color: var(--c-brand);
133
166
  }
134
167
 
168
+ // plugin-photo-swipe
169
+ body {
170
+ --photo-swipe-bullet: var(--c-bg);
171
+ --photo-swipe-bullet-active: var(--c-brand);
172
+ }
173
+
135
174
  // plugin-pwa-popup
136
- .pwa-popup {
137
- --pwa-popup-text-color: var(--c-text);
138
- --pwa-popup-bg-color: var(--c-bg);
139
- --pwa-popup-border-color: var(--c-brand);
140
- --pwa-popup-shadow: 0 4px 16px var(--c-brand);
141
- --pwa-popup-btn-text-color: var(--c-bg);
142
- --pwa-popup-btn-bg-color: var(--c-brand);
143
- --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
175
+ body {
176
+ --pwa-text-color: var(--c-text);
177
+ --pwa-bg-color: var(--c-bg);
178
+ --pwa-border-color: var(--c-brand);
179
+ --pwa-btn-text-color: var(--c-bg);
180
+ --pwa-btn-bg-color: var(--c-brand);
181
+ --pwa-btn-hover-bg-color: var(--c-brand-light);
182
+ }
183
+
184
+ // plugin-redirect
185
+ .redirect-modal-mask {
186
+ --redirect-bg-color: var(--c-bg);
187
+ --redirect-bg-color-light: var(--c-bg-light);
188
+ --redirect-bg-color-lighter: var(--c-bg-lighter);
189
+ --redirect-text-color: var(--c-text);
190
+ --redirect-primary-color: var(--c-brand);
191
+ --redirect-primary-hover-color: var(--c-brand-light);
192
+ --redirect-primary-text-color: var(--c-bg);
144
193
  }
145
194
 
146
195
  // plugin-search