Skip to content

fix(theme): collapse header nav to hamburger below 1200px - #574

Closed
inference-gateway-maintainer[bot] wants to merge 1 commit into
mainfrom
fix/nav-collapse-breakpoint
Closed

inference-gateway-maintainer[bot] wants to merge 1 commit into
mainfrom
fix/nav-collapse-breakpoint

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Problem

The default VitePress theme swaps the hamburger for the horizontal nav menu at
768px. That default assumes a short nav; ours has six groups (Getting Started,
Guides, Reference, Protocols, Agents, Skills).

Measured against the theme's own layout rules, the horizontal menu needs roughly:

  • 272px title/sidebar column (--vp-sidebar-width, absolute at >= 960px)
  • ~590px of nav labels (6 groups, 14px text, 0 12px padding, plus caret)
  • ~160px for the search box + its 32px left padding
  • ~40px extra menu + 32px right padding

That is ~1130-1180px before anything is crowded. Between 768px and that point,
.content-body is a non-wrapping flex row with no flex-shrink control on the
menu, so the nav links get squeezed - labels like "Getting Started" wrap onto
two lines inside the 64px bar and collide with the search box. Tablets, split
screens and small laptop windows all land in that range.

Fix

CSS only, in the existing theme override file - no new component, no JS. Keep
the mobile nav screen (which already lists the exact same links, plus appearance
and social links) until there is room for the horizontal menu:

  • hide .VPNavBarMenu and .VPNavBarExtra below 1200px
  • show .VPNavBarHamburger and allow .VPNavScreen below 1200px

!important is used to beat the theme's scoped component styles. Above 1200px
nothing changes.

Notes

  • The breakpoint is a hard-coded width tuned to the current six nav groups; it
    is commented as such and should be re-measured if nav items are added or
    renamed.
  • Pre-existing theme quirk, unchanged by this PR: VitePress's
    closeScreenOnTabletWindow closes the nav screen on any resize at >= 768px,
    so between 768px and 1200px an open menu closes if the window is resized. The
    hamburger stays visible, so it can just be reopened; fixing it would mean
    shadowing the theme's VPNav component.

Validation

  • bun run build passes; the rule is present in the built stylesheet.
  • bunx prettier --check and bun run lint:md pass.
  • No browser was available in this environment (the Playwright MCP browser is
    not installed and installing it was blocked), so the breakpoint is derived
    from the theme's layout CSS rather than from a screenshot. Worth a quick
    visual check at ~800px, ~1000px and ~1300px on the preview deploy.

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner August 17, 2026 20:49
@inference-gateway-releaser

inference-gateway-releaser Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🗑️ Preview environment destroyed.

@edenreich edenreich closed this Aug 17, 2026
@edenreich
edenreich deleted the fix/nav-collapse-breakpoint branch August 17, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant