@vuepress/theme-default 2.0.0-beta.9 → 2.0.0-rc.1

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 (118) hide show
  1. package/LICENSE +1 -1
  2. package/lib/client/components/AutoLink.vue +113 -0
  3. package/lib/client/components/DropdownTransition.vue +15 -24
  4. package/lib/client/components/Home.vue +12 -130
  5. package/lib/client/components/HomeContent.vue +5 -0
  6. package/lib/client/components/HomeFeatures.vue +22 -0
  7. package/lib/client/components/HomeFooter.vue +17 -0
  8. package/lib/client/components/HomeHero.vue +97 -0
  9. package/lib/client/components/Navbar.vue +60 -95
  10. package/lib/client/components/NavbarBrand.vue +55 -0
  11. package/lib/client/components/NavbarDropdown.vue +126 -0
  12. package/lib/client/components/{NavbarLinks.vue → NavbarItems.vue} +81 -61
  13. package/lib/client/components/Page.vue +16 -15
  14. package/lib/client/components/PageMeta.vue +51 -66
  15. package/lib/client/components/PageNav.vue +61 -64
  16. package/lib/client/components/Sidebar.vue +12 -32
  17. package/lib/client/components/SidebarItem.vue +87 -0
  18. package/lib/client/components/SidebarItems.vue +57 -0
  19. package/lib/client/components/ToggleColorModeButton.vue +57 -0
  20. package/lib/client/components/ToggleSidebarButton.vue +21 -24
  21. package/lib/client/components/global/Badge.vue +24 -26
  22. package/lib/client/components/global/CodeGroup.d.ts +5 -4
  23. package/lib/client/components/global/CodeGroup.js +85 -17
  24. package/lib/client/components/global/CodeGroupItem.vue +22 -20
  25. package/lib/client/components/global/index.d.ts +4 -0
  26. package/lib/client/components/global/index.js +4 -0
  27. package/lib/client/composables/index.d.ts +5 -5
  28. package/lib/client/composables/index.js +5 -5
  29. package/lib/client/composables/useDarkMode.d.ts +12 -0
  30. package/lib/client/composables/useDarkMode.js +57 -0
  31. package/lib/client/composables/useScrollPromise.js +1 -1
  32. package/lib/client/composables/useSidebarItems.d.ts +14 -8
  33. package/lib/client/composables/useSidebarItems.js +49 -48
  34. package/lib/client/composables/useThemeData.d.ts +2 -2
  35. package/lib/client/composables/useThemeData.js +1 -1
  36. package/lib/client/composables/useUpdateDeviceStatus.d.ts +7 -0
  37. package/lib/client/composables/useUpdateDeviceStatus.js +25 -0
  38. package/lib/client/config.d.ts +4 -0
  39. package/lib/client/config.js +44 -0
  40. package/lib/client/index.d.ts +3 -4
  41. package/lib/client/index.js +3 -2
  42. package/lib/client/layouts/Layout.vue +133 -136
  43. package/lib/client/layouts/NotFound.vue +27 -0
  44. package/lib/client/shim.d.ts +5 -0
  45. package/lib/client/styles/{_wrapper.scss → _mixins.scss} +7 -2
  46. package/lib/client/styles/_variables.module.scss +5 -0
  47. package/lib/client/styles/_variables.scss +0 -34
  48. package/lib/client/styles/arrow.scss +4 -6
  49. package/lib/client/styles/badge.scss +14 -11
  50. package/lib/client/styles/code-group.scss +10 -10
  51. package/lib/client/styles/code.scss +33 -46
  52. package/lib/client/styles/custom-container.scss +82 -18
  53. package/lib/client/styles/home.scss +32 -24
  54. package/lib/client/styles/index.scss +4 -4
  55. package/lib/client/styles/layout.scss +82 -73
  56. package/lib/client/styles/{dropdown.scss → navbar-dropdown.scss} +36 -50
  57. package/lib/client/styles/navbar.scss +106 -50
  58. package/lib/client/styles/normalize.scss +199 -0
  59. package/lib/client/styles/page.scss +24 -8
  60. package/lib/client/styles/sidebar.scss +69 -87
  61. package/lib/client/styles/transitions.scss +13 -4
  62. package/lib/client/styles/vars-dark.scss +68 -0
  63. package/lib/client/styles/vars.scss +155 -0
  64. package/lib/client/utils/getNavLink.d.ts +15 -0
  65. package/lib/client/utils/getNavLink.js +18 -0
  66. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +5 -0
  67. package/lib/client/{composables/useResolveRouteWithRedirect.js → utils/getResolveRouteWithRedirect.js} +4 -6
  68. package/lib/client/utils/index.d.ts +5 -2
  69. package/lib/client/utils/index.js +5 -2
  70. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
  71. package/lib/client/utils/isActiveSidebarItem.js +20 -0
  72. package/lib/client/utils/resolveEditLink.d.ts +2 -2
  73. package/lib/client/utils/resolveEditLink.js +15 -9
  74. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  75. package/lib/client/utils/resolveRepoType.js +4 -2
  76. package/lib/node/defaultTheme.d.ts +4 -4
  77. package/lib/node/defaultTheme.js +111 -48
  78. package/lib/node/index.d.ts +4 -4
  79. package/lib/node/index.js +5 -17
  80. package/lib/node/utils/assignDefaultLocaleOptions.d.ts +4 -2
  81. package/lib/node/utils/assignDefaultLocaleOptions.js +13 -13
  82. package/lib/node/utils/index.d.ts +2 -5
  83. package/lib/node/utils/index.js +2 -17
  84. package/lib/node/utils/resolveContainerPluginOptions.d.ts +2 -20
  85. package/lib/node/utils/resolveContainerPluginOptions.js +4 -66
  86. package/lib/shared/index.d.ts +3 -3
  87. package/lib/shared/index.js +3 -15
  88. package/lib/shared/nav.d.ts +16 -18
  89. package/lib/shared/nav.js +1 -2
  90. package/lib/shared/options.d.ts +51 -6
  91. package/lib/shared/options.js +1 -2
  92. package/lib/shared/page.d.ts +15 -6
  93. package/lib/shared/page.js +1 -2
  94. package/package.json +43 -25
  95. package/templates/build.html +34 -0
  96. package/CHANGELOG.md +0 -419
  97. package/lib/client/clientAppEnhance.d.ts +0 -3
  98. package/lib/client/clientAppEnhance.js +0 -28
  99. package/lib/client/clientAppSetup.d.ts +0 -2
  100. package/lib/client/clientAppSetup.js +0 -11
  101. package/lib/client/components/DropdownLink.vue +0 -141
  102. package/lib/client/components/NavLink.vue +0 -115
  103. package/lib/client/components/SidebarChild.d.ts +0 -6
  104. package/lib/client/components/SidebarChild.js +0 -91
  105. package/lib/client/components/global/OutboundLink.vue +0 -30
  106. package/lib/client/composables/useNavLink.d.ts +0 -9
  107. package/lib/client/composables/useNavLink.js +0 -15
  108. package/lib/client/composables/useResolveRouteWithRedirect.d.ts +0 -5
  109. package/lib/client/layouts/404.vue +0 -38
  110. package/lib/client/styles/_normalize.scss +0 -148
  111. package/lib/client/styles/plugins.scss +0 -18
  112. package/lib/client/styles/sr-only.scss +0 -12
  113. package/lib/node/utils/resolveActiveHeaderLinksPluginOptions.d.ts +0 -6
  114. package/lib/node/utils/resolveActiveHeaderLinksPluginOptions.js +0 -16
  115. package/lib/node/utils/resolveGitPluginOptions.d.ts +0 -6
  116. package/lib/node/utils/resolveGitPluginOptions.js +0 -22
  117. package/lib/node/utils/resolveMediumZoomPluginOptions.d.ts +0 -6
  118. package/lib/node/utils/resolveMediumZoomPluginOptions.js +0 -17
@@ -1,3 +1,93 @@
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 { computed, onMounted, onUnmounted, ref } from 'vue'
7
+ import { useRouter } from 'vue-router'
8
+ import { usePageData, usePageFrontmatter } from 'vuepress/client'
9
+ import type { DefaultThemePageFrontmatter } from '../../shared/index.js'
10
+ import {
11
+ useScrollPromise,
12
+ useSidebarItems,
13
+ useThemeLocaleData,
14
+ } from '../composables/index.js'
15
+
16
+ defineSlots<{
17
+ 'navbar'?: (props: Record<never, never>) => any
18
+ 'navbar-before'?: (props: Record<never, never>) => any
19
+ 'navbar-after'?: (props: Record<never, never>) => any
20
+ 'sidebar'?: (props: Record<never, never>) => any
21
+ 'sidebar-top'?: (props: Record<never, never>) => any
22
+ 'sidebar-bottom'?: (props: Record<never, never>) => any
23
+ 'page'?: (props: Record<never, never>) => any
24
+ 'page-top'?: (props: Record<never, never>) => any
25
+ 'page-bottom'?: (props: Record<never, never>) => any
26
+ 'page-content-top'?: (props: Record<never, never>) => any
27
+ 'page-content-bottom'?: (props: Record<never, never>) => any
28
+ }>()
29
+
30
+ const page = usePageData()
31
+ const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
32
+ const themeLocale = useThemeLocaleData()
33
+
34
+ // navbar
35
+ const shouldShowNavbar = computed(
36
+ () =>
37
+ frontmatter.value.navbar !== false && themeLocale.value.navbar !== false,
38
+ )
39
+
40
+ // sidebar
41
+ const sidebarItems = useSidebarItems()
42
+ const isSidebarOpen = ref(false)
43
+ const toggleSidebar = (to?: boolean): void => {
44
+ isSidebarOpen.value = typeof to === 'boolean' ? to : !isSidebarOpen.value
45
+ }
46
+ const touchStart = { x: 0, y: 0 }
47
+ const onTouchStart = (e): void => {
48
+ touchStart.x = e.changedTouches[0].clientX
49
+ touchStart.y = e.changedTouches[0].clientY
50
+ }
51
+ const onTouchEnd = (e): void => {
52
+ const dx = e.changedTouches[0].clientX - touchStart.x
53
+ const dy = e.changedTouches[0].clientY - touchStart.y
54
+ if (Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 40) {
55
+ if (dx > 0 && touchStart.x <= 80) {
56
+ toggleSidebar(true)
57
+ } else {
58
+ toggleSidebar(false)
59
+ }
60
+ }
61
+ }
62
+
63
+ // classes
64
+ const containerClass = computed(() => [
65
+ {
66
+ 'no-navbar': !shouldShowNavbar.value,
67
+ 'no-sidebar': !sidebarItems.value.length,
68
+ 'sidebar-open': isSidebarOpen.value,
69
+ },
70
+ frontmatter.value.pageClass,
71
+ ])
72
+
73
+ // close sidebar after navigation
74
+ let unregisterRouterHook
75
+ onMounted(() => {
76
+ const router = useRouter()
77
+ unregisterRouterHook = router.afterEach(() => {
78
+ toggleSidebar(false)
79
+ })
80
+ })
81
+ onUnmounted(() => {
82
+ unregisterRouterHook()
83
+ })
84
+
85
+ // handle scrollBehavior with transition
86
+ const scrollPromise = useScrollPromise()
87
+ const onBeforeEnter = scrollPromise.resolve
88
+ const onBeforeLeave = scrollPromise.pending
89
+ </script>
90
+
1
91
  <template>
2
92
  <div
3
93
  class="theme-container"
@@ -5,148 +95,55 @@
5
95
  @touchstart="onTouchStart"
6
96
  @touchend="onTouchEnd"
7
97
  >
8
- <Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
9
- <template #before>
10
- <slot name="navbar-before" />
11
- </template>
12
- <template #after>
13
- <slot name="navbar-after" />
14
- </template>
15
- </Navbar>
98
+ <slot name="navbar">
99
+ <Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
100
+ <template #before>
101
+ <slot name="navbar-before" />
102
+ </template>
103
+ <template #after>
104
+ <slot name="navbar-after" />
105
+ </template>
106
+ </Navbar>
107
+ </slot>
16
108
 
17
109
  <div class="sidebar-mask" @click="toggleSidebar(false)" />
18
110
 
19
- <Sidebar>
20
- <template #top>
21
- <slot name="sidebar-top" />
22
- </template>
23
- <template #bottom>
24
- <slot name="sidebar-bottom" />
25
- </template>
26
- </Sidebar>
27
-
28
- <Home v-if="frontmatter.home" />
29
-
30
- <Transition
31
- v-else
32
- name="fade-slide-y"
33
- mode="out-in"
34
- @before-enter="onBeforeEnter"
35
- @before-leave="onBeforeLeave"
36
- >
37
- <Page :key="page.path">
111
+ <slot name="sidebar">
112
+ <Sidebar>
38
113
  <template #top>
39
- <slot name="page-top" />
114
+ <slot name="sidebar-top" />
40
115
  </template>
41
116
  <template #bottom>
42
- <slot name="page-bottom" />
117
+ <slot name="sidebar-bottom" />
43
118
  </template>
44
- </Page>
45
- </Transition>
46
- </div>
47
- </template>
119
+ </Sidebar>
120
+ </slot>
48
121
 
49
- <script lang="ts">
50
- import {
51
- computed,
52
- defineComponent,
53
- onMounted,
54
- onUnmounted,
55
- ref,
56
- Transition,
57
- } from 'vue'
58
- import { useRouter } from 'vue-router'
59
- import { usePageData, usePageFrontmatter } from '@vuepress/client'
60
- import Home from '../components/Home.vue'
61
- import Page from '../components/Page.vue'
62
- import Navbar from '../components/Navbar.vue'
63
- import Sidebar from '../components/Sidebar.vue'
64
- import {
65
- useScrollPromise,
66
- useSidebarItems,
67
- useThemeLocaleData,
68
- } from '../composables'
69
-
70
- export default defineComponent({
71
- name: 'Layout',
72
-
73
- components: {
74
- Home,
75
- Page,
76
- Navbar,
77
- Sidebar,
78
- Transition,
79
- },
80
-
81
- setup() {
82
- const page = usePageData()
83
- const frontmatter = usePageFrontmatter()
84
- const themeLocale = useThemeLocaleData()
85
-
86
- // navbar
87
- const shouldShowNavbar = computed(
88
- () =>
89
- frontmatter.value.navbar !== false && themeLocale.value.navbar !== false
90
- )
91
-
92
- // sidebar
93
- const sidebarItems = useSidebarItems()
94
- const isSidebarOpen = ref(false)
95
- const toggleSidebar = (to?: boolean): void => {
96
- isSidebarOpen.value = typeof to === 'boolean' ? to : !isSidebarOpen.value
97
- }
98
- const touchStart = { x: 0, y: 0 }
99
- const onTouchStart = (e): void => {
100
- touchStart.x = e.changedTouches[0].clientX
101
- touchStart.y = e.changedTouches[0].clientY
102
- }
103
- const onTouchEnd = (e): void => {
104
- const dx = e.changedTouches[0].clientX - touchStart.x
105
- const dy = e.changedTouches[0].clientY - touchStart.y
106
- if (Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 40) {
107
- if (dx > 0 && touchStart.x <= 80) {
108
- toggleSidebar(true)
109
- } else {
110
- toggleSidebar(false)
111
- }
112
- }
113
- }
114
-
115
- // classes
116
- const containerClass = computed(() => ({
117
- 'no-navbar': !shouldShowNavbar.value,
118
- 'no-sidebar': !sidebarItems.value.length,
119
- 'sidebar-open': isSidebarOpen.value,
120
- }))
121
-
122
- // close sidebar after navigation
123
- let unregisterRouterHook
124
- onMounted(() => {
125
- const router = useRouter()
126
- unregisterRouterHook = router.afterEach(() => {
127
- toggleSidebar(false)
128
- })
129
- })
130
- onUnmounted(() => {
131
- unregisterRouterHook()
132
- })
133
-
134
- // handle scrollBehavior with transition
135
- const scrollPromise = useScrollPromise()
136
- const onBeforeEnter = scrollPromise.resolve
137
- const onBeforeLeave = scrollPromise.pending
122
+ <slot name="page">
123
+ <Home v-if="frontmatter.home" />
138
124
 
139
- return {
140
- frontmatter,
141
- page,
142
- containerClass,
143
- shouldShowNavbar,
144
- toggleSidebar,
145
- onTouchStart,
146
- onTouchEnd,
147
- onBeforeEnter,
148
- onBeforeLeave,
149
- }
150
- },
151
- })
152
- </script>
125
+ <Transition
126
+ v-else
127
+ name="fade-slide-y"
128
+ mode="out-in"
129
+ @before-enter="onBeforeEnter"
130
+ @before-leave="onBeforeLeave"
131
+ >
132
+ <Page :key="page.path">
133
+ <template #top>
134
+ <slot name="page-top" />
135
+ </template>
136
+ <template #content-top>
137
+ <slot name="page-content-top" />
138
+ </template>
139
+ <template #content-bottom>
140
+ <slot name="page-content-bottom" />
141
+ </template>
142
+ <template #bottom>
143
+ <slot name="page-bottom" />
144
+ </template>
145
+ </Page>
146
+ </Transition>
147
+ </slot>
148
+ </div>
149
+ </template>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import { useRouteLocale } from 'vuepress/client'
3
+ import { useThemeLocaleData } from '../composables/index.js'
4
+
5
+ const routeLocale = useRouteLocale()
6
+ const themeLocale = useThemeLocaleData()
7
+
8
+ const messages = themeLocale.value.notFound ?? ['Not Found']
9
+ const getMsg = (): string =>
10
+ messages[Math.floor(Math.random() * messages.length)]
11
+ const homeLink = themeLocale.value.home ?? routeLocale.value
12
+ const homeText = themeLocale.value.backToHome ?? 'Back to home'
13
+ </script>
14
+
15
+ <template>
16
+ <div class="theme-container">
17
+ <main class="page">
18
+ <div class="theme-default-content">
19
+ <h1>404</h1>
20
+
21
+ <blockquote>{{ getMsg() }}</blockquote>
22
+
23
+ <RouterLink :to="homeLink">{{ homeText }}</RouterLink>
24
+ </div>
25
+ </main>
26
+ </div>
27
+ </template>
@@ -3,3 +3,8 @@ declare module '*.vue' {
3
3
  const comp: ComponentOptions
4
4
  export default comp
5
5
  }
6
+
7
+ declare module '*.module.scss?module' {
8
+ const cssVars: Record<string, string>
9
+ export default cssVars
10
+ }
@@ -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,5 @@
1
+ @import '_variables';
2
+
3
+ :export {
4
+ mobile: $MQMobile;
5
+ }
@@ -1,40 +1,6 @@
1
1
  @import '@vuepress/plugin-palette/palette';
2
2
 
3
- // colors
4
- $accentColor: #3eaf7c !default;
5
- $textColor: #2c3e50 !default;
6
- $borderColor: #eaecef !default;
7
- $arrowBgColor: #ccc !default;
8
- $tipColor: #42b983 !default;
9
- $warningColor: #e7c000 !default;
10
- $dangerColor: #cc0000 !default;
11
-
12
- // code colors
13
- $codeBgColor: #282c34 !default;
14
- $highlightLineBgColor: rgba(0, 0, 0, 66%) !default;
15
- $lineNumbersColor: rgba(255, 255, 255, 0.3) !default;
16
-
17
- // badge component colors
18
- $badgeTipColor: $tipColor !default;
19
- $badgeWarningColor: $warningColor !default;
20
- $badgeDangerColor: $dangerColor !default;
21
-
22
- // layout
23
- $navbarHeight: 3.6rem !default;
24
- $sidebarWidth: 20rem !default;
25
- $contentWidth: 740px !default;
26
- $homePageWidth: 960px !default;
27
-
28
3
  // responsive breakpoints
29
4
  $MQNarrow: 959px !default;
30
5
  $MQMobile: 719px !default;
31
6
  $MQMobileNarrow: 419px !default;
32
-
33
- // code
34
- $lineNumbersWrapperWidth: 3.5rem !default;
35
- $codeLang: 'c' 'cpp' 'cs' 'css' 'dart' 'docker' 'fs' 'go' 'html' 'java' 'js'
36
- 'json' 'kt' 'less' 'makefile' 'md' 'php' 'py' 'rb' 'rs' 'sass' 'scss' 'sh'
37
- 'styl' 'ts' 'toml' 'vue' 'yml' !default;
38
-
39
- // other
40
- $contentClass: '.theme-default-content' !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,30 +1,33 @@
1
- @import '_variables';
2
-
3
1
  .badge {
4
2
  display: inline-block;
5
3
  font-size: 14px;
4
+ font-weight: 600;
6
5
  height: 18px;
7
6
  line-height: 18px;
8
7
  border-radius: 3px;
9
8
  padding: 0 6px;
10
- color: white;
11
- background-color: #42b983;
9
+ color: var(--c-bg);
12
10
  vertical-align: top;
13
-
14
- .table-of-contents & {
15
- vertical-align: middle;
16
- }
11
+ transition:
12
+ color var(--t-color),
13
+ background-color var(--t-color);
17
14
 
18
15
  &.tip {
19
- background-color: $badgeTipColor;
16
+ background-color: var(--c-badge-tip);
20
17
  }
21
18
 
22
19
  &.warning {
23
- background-color: $badgeWarningColor;
20
+ background-color: var(--c-badge-warning);
21
+ color: var(--c-badge-warning-text);
24
22
  }
25
23
 
26
24
  &.danger {
27
- background-color: $badgeDangerColor;
25
+ background-color: var(--c-badge-danger);
26
+ color: var(--c-badge-danger-text);
27
+ }
28
+
29
+ .table-of-contents & {
30
+ vertical-align: middle;
28
31
  }
29
32
 
30
33
  & + & {
@@ -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,14 +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;
13
- }
14
-
15
- .code-group__ul {
16
- margin: auto 0;
17
- padding-left: 0;
18
- display: inline-flex;
19
- list-style: none;
15
+ background-color: var(--c-code-group-tab-bg);
20
16
  }
21
17
 
22
18
  .code-group__nav-tab {
@@ -26,7 +22,7 @@
26
22
  background-color: transparent;
27
23
  font-size: 0.85em;
28
24
  line-height: 1.4;
29
- color: rgba(255, 255, 255, 0.9);
25
+ color: var(--c-code-group-tab-title);
30
26
  font-weight: 600;
31
27
  }
32
28
 
@@ -34,8 +30,12 @@
34
30
  outline: none;
35
31
  }
36
32
 
33
+ .code-group__nav-tab:focus-visible {
34
+ outline: 1px solid var(--c-code-group-tab-outline);
35
+ }
36
+
37
37
  .code-group__nav-tab-active {
38
- border-bottom: $accentColor 1px solid;
38
+ border-bottom: var(--c-code-group-tab-active-border) 1px solid;
39
39
  }
40
40
 
41
41
  @media (max-width: $MQMobileNarrow) {