fix(nav): shrink the header on small screens #156
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web#156
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
On a 375 px phone the header alone is 278 px, and
<main>starts at 325 px on/docs/faq/and360 px on
/pricing/once breadcrumbs are added — 41 % to 54 % of a 375 x 667 viewport spentbefore any content.
Measured header heights on
/: 768 px -> 221.6 · 480-600 -> 258.9 · 375-414 -> 277.6 · 360 ->312.3 · 320 -> 354.9. It also varies per page at the same width (375 px:
/277.6,/pricing/312.3) because everything depends on wrapping.
.brand(src/components/header.astro:26-31) is a fixed 112 px at every width —padding: var(--spacing-xl) var(--page-margin), i.e. 32 px above and below a 48 px logo — and holds onenon-navigational link. Nothing in
header.astroresponds to a breakpoint; the 2 rem padding thatgives a desktop header its air is the same 2 rem on a 320 px phone.
Fix
One
@include breakpoint-max("medium")block. No JavaScript, no new component..brandpadding tovar(--spacing-md), logo height 48 -> 40.current
flex-flow: column nowrapatheader.astro:20.medium(operator decision). It is aonce-per-visitor control occupying 75 px in the top band of every page, and this is the single
largest space win available. Note the trade-off being accepted: the portal has no
Accept-Languagedetection, so a reader who lands in the wrong language must now scroll tochange it. If that proves to bite, the mitigation is detection, not moving the control back.
Done when
<main>starts within the first 220 px on a pagewith breadcrumbs.
relocated within the page, not concealed.
Part of gitborg/gitborg-docs#67.
supernaut refererade till detta ärende från bitborg/bitborg-docs2026-08-02 12:32:47 +00:00
Picked this up and found most of it already shipped. Recording the measurements so the next person does not redo the investigation.
Three of the four fix bullets landed in #170 and this issue was never closed:
.brandpadding is alreadyvar(--spacing-md)belowmedium(header.astro).medium, not the old column stack.medium(secondary-navigation.astro,footer.astro), relocated and not concealed.The fourth bullet says logo height 48 to 40. It is 24 today.
logo.astrorecords why: at 40 px the logo is wide enough at its 5:1 aspect to push the account row off the shared band and reinstate a row, so following that number literally would make the header taller.The baseline in the body no longer reproduces, for the same reason. It records 278 px at 375 px. Current main measures 242 px.
The remaining target is not reachable under this issue's constraints
Header at 375 px breaks down as
.header-band80 to 104 px plus.main-navigation130 px. The five main navigation links wrap to two rows belowsmall, and each row is held to the 48 px WCAG 2.5.8 touch-target minimum bysrc/style/shared/navigation.scss:19-27, added by #170 for #159. Even a perfect one-row band leaves roughly 178 to 210 px, above the 170 px target.Getting under 170 px needs one of: fewer or regrouped main navigation rows, touch targets below the WCAG minimum, or a JavaScript disclosure pattern. All three are outside this issue's stated scope (CSS only, no JavaScript, no link removed or hidden).
What was done
#245 tightens the
.user-menugap belowmedium, which is the one measurable win left inside scope. It takes 242 px to 234 px at 320, 360 and 375 px and changes nothing at 414 px and above. It does not close this issue.Measured with Chromium on the built site,
getBoundingClientRect()onheader.site-headerand<main>:/docs/faq/main top afterHeader height is identical across
/,/pricing/and/docs/faq/at every width tested, so the "varies by no more than one row" criterion is met. 768 px and above is unchanged.Decision needed
Either widen this issue's scope to allow one of the three routes above, or lower the target to what a CSS-only fix can reach and close it.