From d44509dabb1d067aca4e2c93c3934cbdb3614075 Mon Sep 17 00:00:00 2001 From: Speculator55005 <50082482+fas89@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:13:39 +0100 Subject: [PATCH 1/2] fix(styles): make the phone menu opaque and fit the navbar at every width The menu drawer was see-through on phones. `.vp-sidebar` is transparent so it blends with the page on desktop, but at the mobile breakpoint and below it is the drawer laid over the page, and the page text showed through the menu. It now has the page background there, in dark and light mode. The navbar's ten links, search label and key hints need about 1400px. From 720px to about 1395px they pushed the search button and the color-mode toggle off screen: on landscape phones, on tablets, and on laptops at 1280px and 1366px. `$MQMobile` is now 1279px in palette.scss, so below 1280px the links move into the menu drawer. From 1280px to 1439px the search button shows as an icon, as the slimsearch plugin already does below 960px, and the gap between links drops from 1.5rem to 1rem. At 1440px and wider the navbar is unchanged. Below 1280px the sidebar is the menu drawer as well, so tablets and small laptop windows get full-width content and open the page tree from the menu button, as phones already did. The alternative, keeping the sidebar there, needs fewer top-level navbar items. The default theme reads $MQMobile from the palette file for both its CSS and its JS, as its styles docs describe. The same pattern fixed the sibling FLUID site in open-data-protocol/fluid#54. --- docs/.vuepress/styles/index.scss | 25 +++++++++++++++++++++++++ docs/.vuepress/styles/palette.scss | 10 ++++++++++ 2 files changed, 35 insertions(+) diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index baef2d0e..4f83aa0d 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -298,12 +298,37 @@ body { border-bottom: 1px solid var(--ff-glass-border); } +// From the mobile breakpoint up to 1440px the full navbar does not fit: its +// ten links, the search label and the key hints need about 1400px. Show the +// search button as an icon, as the search plugin already does below 960px, +// and tighten the gap between links. The compact bar needs about 1240px. +@media (min-width: #{palette.$MQMobile + 1}) and (max-width: 1439px) { + .vp-search-button { + border-radius: 50%; + } + + .vp-search-placeholder, + .vp-search-key-hints { + display: none; + } + + .vp-navbar .vp-navbar-item:not(:first-child) { + margin-inline-start: 1rem; + } +} + // --------------------------------------------------------------------- // Sidebar — accent the active page, keep the rest quiet. // --------------------------------------------------------------------- .vp-sidebar { background: transparent; + // At the mobile breakpoint and below, the sidebar is a drawer laid over + // the page, so it needs a solid surface or the page shows through the menu. + @media (max-width: palette.$MQMobile) { + background: var(--vp-c-bg); + } + .sidebar-item.active { color: var(--vp-c-accent); font-weight: 600; diff --git a/docs/.vuepress/styles/palette.scss b/docs/.vuepress/styles/palette.scss index fbdf2a03..a17904f4 100644 --- a/docs/.vuepress/styles/palette.scss +++ b/docs/.vuepress/styles/palette.scss @@ -35,6 +35,16 @@ $ff-indigo: #818cf8; $ff-amber: #f59e0b; // retained for "warning" callout semantics only $ff-red: #ef4444; // retained for "danger" callout semantics only +// --------------------------------------------------------------------- +// Mobile breakpoint. The default theme reads it from this file; its own +// default is 719px. At this width and below, the navbar links move into +// the menu drawer. The navbar's ten links need about 1400px, or about +// 1240px in the compact form index.scss uses below 1440px. Narrower than +// that, the search button and the color-mode toggle were pushed off +// screen. Re-measure both when you add a top-level navbar item. +// --------------------------------------------------------------------- +$MQMobile: 1279px; + // ===================================================================== // DARK (default) — on :root so the first paint is dark. // ===================================================================== From c6f64d6e362568092b308fa118cea2708df573ab Mon Sep 17 00:00:00 2001 From: Speculator55005 <50082482+fas89@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:27:41 +0100 Subject: [PATCH 2/2] fix(styles): drawer out of the tab order; brand link hugs its name Two defects that the wider drawer range exposed. Both were already present on phones. The theme slides the closed drawer off screen but leaves it visible, so its ~300 links stayed in the tab order and keyboard focus vanished off screen. The drawer is now `visibility: hidden` until it opens, with a 0.3s delay on close so it stays visible while it slides away. The theme makes the site name a block as wide as the bar's free space, so a long name can end in an ellipsis. Inside the inline brand link that stretched the link across the bar, and a click on empty bar space went home. The name is now inline-block with the same width cap, so the link is only as wide as the name. The compact-navbar query now uses range syntax, `width > 1279px`, so a fractional width between 1279px and 1280px also gets the compact bar. --- docs/.vuepress/styles/index.scss | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index 4f83aa0d..7c55e08d 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -302,7 +302,9 @@ body { // ten links, the search label and the key hints need about 1400px. Show the // search button as an icon, as the search plugin already does below 960px, // and tighten the gap between links. The compact bar needs about 1240px. -@media (min-width: #{palette.$MQMobile + 1}) and (max-width: 1439px) { +// Range syntax, so a fractional width between 1279px and 1280px (browser +// zoom) gets the compact bar too. +@media (width > #{palette.$MQMobile}) and (width < 1440px) { .vp-search-button { border-radius: 50%; } @@ -317,6 +319,21 @@ body { } } +// At the mobile breakpoint and below, the theme makes the site name a block +// as wide as the bar's free space (`width: calc(100vw - 11rem)`) so a long +// name can end in an ellipsis. A block inside the inline brand link stretches +// the link across the bar, so the empty bar was a link home and the focus +// ring ran across it. Inline-block keeps the cap and the ellipsis but lets +// the link hug the name. +@media (max-width: palette.$MQMobile) { + .vp-site-name { + display: inline-block; + width: auto; + max-width: calc(100vw - 11rem); + vertical-align: top; + } +} + // --------------------------------------------------------------------- // Sidebar — accent the active page, keep the rest quiet. // --------------------------------------------------------------------- @@ -325,8 +342,22 @@ body { // At the mobile breakpoint and below, the sidebar is a drawer laid over // the page, so it needs a solid surface or the page shows through the menu. + // The theme only slides the closed drawer off screen, which leaves its + // links in the tab order. `visibility` takes them out until it opens; the + // delay keeps the drawer visible while it slides away (theme: 0.3s). @media (max-width: palette.$MQMobile) { background: var(--vp-c-bg); + visibility: hidden; + transition: + transform var(--vp-t-transform), + background-color var(--vp-t-color), + border-color var(--vp-t-color), + visibility 0s linear 0.3s; + + .vp-theme-container.sidebar-open & { + visibility: visible; + transition-delay: 0s; + } } .sidebar-item.active {