Commit 8f267fde16

8f267fde166636c35ed80edfc8fdaa54079fe78d

parent: 6d6b0b16ef

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-07 08:37 UTC

nav

Layout: unified · split

docs/.vitepress/theme/components/NavActions.vue +43 −35
@@ -1,5 +1,5 @@
1<script setup lang="ts"> 1<script setup lang="ts">
2import { Moon, Search, Sun } from 'lucide-vue-next' 2import { Moon, Search, Settings, Sun } from 'lucide-vue-next'
3import { useData } from 'vitepress' 3import { useData } from 'vitepress'
4// @ts-ignore 4// @ts-ignore
5import VPSocialLink from 'vitepress/dist/client/theme-default/components/VPSocialLink.vue' 5import VPSocialLink from 'vitepress/dist/client/theme-default/components/VPSocialLink.vue'
@@ -17,13 +17,15 @@ const { isDark } = useData()
17const toggleAppearance = inject<() => void>('toggle-appearance', () => { 17const toggleAppearance = inject<() => void>('toggle-appearance', () => {
18 isDark.value = !isDark.value 18 isDark.value = !isDark.value
19}) 19})
20
21// Opens the full-screen nav menu (the flyout's phone equivalent).
22function openScreenMenu() {
23 document.querySelector<HTMLElement>('.VPNavBarHamburger')?.click()
24}
20</script> 25</script>
21 26
22<template> 27<template>
23 <div class="nav-actions-container"> 28 <div class="nav-actions-container">
24 <div class="nav-bookmark-mobile">
25 <BookmarksPanel />
26 </div>
27 <div class="nav-actions" role="group" aria-label="Site actions"> 29 <div class="nav-actions" role="group" aria-label="Site actions">
28 <template v-for="(action, i) in navActions" :key="i"> 30 <template v-for="(action, i) in navActions" :key="i">
29 <div class="nav-action" :class="`nav-action--${action.type}`"> 31 <div class="nav-action" :class="`nav-action--${action.type}`">
@@ -57,7 +59,17 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => {
57 :me="false" 59 :me="false"
58 /> 60 />
59 61
60 <NolebaseEnhancedReadabilitiesMenu v-else-if="action.type === 'settings'" /> 62 <template v-else-if="action.type === 'settings'">
63 <NolebaseEnhancedReadabilitiesMenu />
64 <button
65 type="button"
66 class="nav-action-btn nav-settings-mobile"
67 aria-label="Settings"
68 @click="openScreenMenu()"
69 >
70 <Settings :size="ICON_SIZE" :stroke-width="ICON_STROKE" />
71 </button>
72 </template>
61 <BookmarksPanel v-else-if="action.type === 'bookmarks'" /> 73 <BookmarksPanel v-else-if="action.type === 'bookmarks'" />
62 </div> 74 </div>
63 </template> 75 </template>
@@ -71,31 +83,8 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => {
71 align-items: center; 83 align-items: center;
72} 84}
73 85
74.nav-bookmark-mobile {
75 display: flex;
76 align-items: center;
77 justify-content: center;
78 width: 36px;
79 height: var(--vp-nav-height);
80}
81
82.nav-bookmark-mobile :deep(.bookmarks-btn) {
83 color: var(--vp-c-text-2);
84 opacity: 1;
85}
86
87.nav-bookmark-mobile :deep(.bookmarks-btn svg) {
88 stroke-width: 1.5;
89}
90
91@media (min-width: 768px) {
92 .nav-bookmark-mobile {
93 display: none;
94 }
95}
96
97.nav-actions { 86.nav-actions {
98 display: none; 87 display: flex;
99 align-items: center; 88 align-items: center;
100 gap: var(--nav-pill-gap); 89 gap: var(--nav-pill-gap);
101 height: var(--nav-pill-height); 90 height: var(--nav-pill-height);
@@ -108,12 +97,6 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => {
108 transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1); 97 transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
109} 98}
110 99
111@media (min-width: 768px) {
112 .nav-actions {
113 display: flex;
114 }
115}
116
117.nav-action { 100.nav-action {
118 flex: none; 101 flex: none;
119 width: var(--nav-pill-item-size); 102 width: var(--nav-pill-item-size);
@@ -123,6 +106,24 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => {
123 justify-content: center; 106 justify-content: center;
124} 107}
125 108
109/* Social links move to the full-screen menu on phones. */
110.nav-action--link {
111 display: none;
112}
113
114@media (min-width: 768px) {
115 .nav-action--link {
116 display: flex;
117 }
118}
119
120/* Doubled class outranks the later `.nav-action-btn { display: flex }`. */
121@media (min-width: 768px) {
122 .nav-action-btn.nav-settings-mobile {
123 display: none;
124 }
125}
126
126.nav-action-btn { 127.nav-action-btn {
127 display: flex; 128 display: flex;
128 align-items: center; 129 align-items: center;
@@ -170,6 +171,13 @@ const toggleAppearance = inject<() => void>('toggle-appearance', () => {
170 -webkit-backdrop-filter: none !important; 171 -webkit-backdrop-filter: none !important;
171} 172}
172 173
174/* Phones use the full-screen gear instead of the flyout. */
175@media (max-width: 767.9px) {
176 .nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout) {
177 display: none !important;
178 }
179}
180
173.nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout .button) { 181.nav-action--settings :deep(.VPNolebaseEnhancedReadabilitiesMenuFlyout .button) {
174 width: 100% !important; 182 width: 100% !important;
175 height: 100% !important; 183 height: 100% !important;
docs/.vitepress/theme/components/settings/ScreenMenu.vue −2
@@ -5,7 +5,6 @@ import VPSocialLinks from 'vitepress/dist/client/theme-default/components/VPSoci
5 5
6import AccentColor from './AccentColor.vue' 6import AccentColor from './AccentColor.vue'
7import Effects from './Effects.vue' 7import Effects from './Effects.vue'
8import ScreenAppearance from './ScreenAppearance.vue'
9 8
10const mounted = useMounted() 9const mounted = useMounted()
11const { theme } = useData() 10const { theme } = useData()
@@ -14,7 +13,6 @@ const { theme } = useData()
14<template> 13<template>
15 <div v-if="mounted" space-y-2 class="VPNolebaseEnhancedReadabilitiesMenu"> 14 <div v-if="mounted" space-y-2 class="VPNolebaseEnhancedReadabilitiesMenu">
16 <Effects /> 15 <Effects />
17 <ScreenAppearance />
18 <AccentColor /> 16 <AccentColor />
19 <VPSocialLinks 17 <VPSocialLinks
20 v-if="theme.socialLinks" 18 v-if="theme.socialLinks"
docs/.vitepress/theme/styles/style.scss +8 −4
@@ -1350,10 +1350,14 @@ table tr:nth-child(odd) {
1350 @apply ml-2 pl-0!; 1350 @apply ml-2 pl-0!;
1351} 1351}
1352 1352
1353@media (min-width: 768px) { 1353// Search lives in the nav pill, which now shows on phones too.
1354 #local-search { 1354#local-search {
1355 @apply hidden!; 1355 @apply hidden!;
1356 } 1356}
1357
1358// Hidden but kept in the DOM; the pill's settings gear clicks it to open the menu.
1359.VPNavBarHamburger {
1360 display: none !important;
1357} 1361}
1358 1362
1359%thin-scrollbar { 1363%thin-scrollbar {