Skip to content

fix(layout): pin sidebar left and stabilize width across viewports#22

Merged
charlesrhoward merged 1 commit intomainfrom
fix/sidebar-responsive-width
Apr 23, 2026
Merged

fix(layout): pin sidebar left and stabilize width across viewports#22
charlesrhoward merged 1 commit intomainfrom
fix/sidebar-responsive-width

Conversation

@charlesrhoward
Copy link
Copy Markdown
Contributor

Summary

  • Drop the fit-content(270px) override on --fd-sidebar-col / #nd-sidebar — in Fumadocs' grid-template-columns track it collapsed to the nav items' min-content at 1440 and below, producing letter-stacked labels.
  • Set --fd-layout-width: 200rem so Fumadocs' main track absorbs the excess at ultra-wide viewports instead of letting the outer 1fr gutters center the frame and push the sidebar inward.
  • Keep the [data-sidebar-panel] hide — collapsed-panel shell still mounts on desktop.

The content article still caps at max-w-[900px] mx-auto via Fumadocs itself, so prose width is unaffected.

Test plan

  • Verify sidebar sits flush-left at 1280, 1440, 1920, 2560 viewport widths.
  • Verify labels ("Get started", "Sandboxes", etc.) render on one line at all widths ≥ 768.
  • Verify TOC still appears at the right edge and prose stays centered.
  • Mobile drawer (<768px) unchanged.

🤖 Generated with Claude Code

Replace the fit-content(270px) grid track override that collapsed the
sidebar to min-content at 1440 and below, and grow --fd-layout-width
so Fumadocs' outer 1fr gutters don't center the frame on ultra-wide
monitors. Content article keeps its own max-w-[900px] mx-auto cap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@charlesrhoward charlesrhoward enabled auto-merge (squash) April 23, 2026 16:35
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mogplex-docs Ready Ready Preview, Comment Apr 23, 2026 4:35pm

Request Review

@mogplex
Copy link
Copy Markdown

mogplex Bot commented Apr 23, 2026

Mogplex PR Review

Status: No material issues found

Summary

Clean, focused layout fix. The root cause diagnosis is correct — fit-content(270px) on the grid track allowed Fumadocs' column to collapse to min-content at narrower-wide viewports, producing stacked nav labels. The fix is well-reasoned and the inline comment explains the 200rem value clearly.

No critical or warning-level issues. A couple of low-level observations below.

Suggestions

  • --fd-sidebar-width: 270px without --fd-sidebar-col — Fumadocs uses --fd-sidebar-col as the actual grid track and derives it from --fd-sidebar-width in its own stylesheet. Verify (if you haven't already) that Fumadocs' default derivation of --fd-sidebar-col from --fd-sidebar-width produces a fixed 270px track rather than re-introducing a fit-content expression. If the upstream preset still injects fit-content via --fd-sidebar-col, you may need to add back --fd-sidebar-col: 270px (without !important this time, since specificity via the #nd-docs-layout ID selector should already win).

  • 200rem at 768px–1024px — At small-desktop viewports the outer gutters are already zero or near-zero, so the 200rem cap is effectively inert there. This is fine, but worth a quick smoke-test at exactly 768px to confirm no horizontal overflow appears (e.g., if Fumadocs adds overflow: visible on the outer wrapper rather than overflow: hidden).

Verdict

APPROVE — The change is correct, minimal, and well-documented. The test plan covers the right viewports.

Affected files:

  • src/app/global.css

View check run

@charlesrhoward charlesrhoward merged commit 2840f8e into main Apr 23, 2026
6 checks passed
@charlesrhoward charlesrhoward deleted the fix/sidebar-responsive-width branch April 23, 2026 16:36
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