From 14f4f09d32a5325a33629b5911c714d44882a726 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 27 Aug 2026 21:42:51 +0530 Subject: [PATCH] fix(theme): keep search beside the title without a nav menu The nav menu is the bar's only growing element, so without `nav` configured everything packed to the right edge. Search now carries an auto right margin. A present menu's flex-grow still wins, so nothing moves in that case. Co-Authored-By: Claude Fable 5 --- src/client/theme-default/components/VPNavBar.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/theme-default/components/VPNavBar.vue b/src/client/theme-default/components/VPNavBar.vue index 35b404cb..7daff981 100644 --- a/src/client/theme-default/components/VPNavBar.vue +++ b/src/client/theme-default/components/VPNavBar.vue @@ -227,6 +227,15 @@ const overflow = provideNavOverflow({ height: var(--vp-nav-height); } +@media (min-width: 48rem) { + /* keeps search on the title's side when there is no nav menu to grow + into the middle; with a menu present its flex-grow wins and this + margin resolves to zero */ + .content-body > .search { + margin-right: auto; + } +} + /* collapsed into the `⋯` menu — kept mounted (hidden, out of the a11y tree and tab order) so its natural width stays measurable */ .content-body > .collapsed {