Fix: architecture page's theme-menu dropdown clipped by nav overflow - #196
Conversation
Root cause: nav .wrap had overflow-x:auto (for the horizontally-scrollable
mobile nav) with no explicit overflow-y -- but per the CSS overflow spec,
setting overflow-x to anything but visible forces the browser to compute
overflow-y as auto too (confirmed via getComputedStyle: overflowY was
"auto" despite no rule ever setting it). The theme switcher's dropdown
(.theme-menu, position:absolute, anchored to .theme-switcher{position:
relative}) is a normal-flow descendant of that box, so it got clipped to
the nav bar's ~48px height -- the ~263px option list rendered as a single
sliver overlapping the toggle button's own label. Reproduced at every
width tested (390/768/820/900/1280px); it's a vertical-overflow bug, not
a narrow-viewport one. A secondary, width-dependent symptom: between
roughly 768-820px the nav's total content (811px) exceeded the viewport,
partially clipping the closed button itself at the right edge.
Fix: split the single flex row into two containers. The section links
(brand + .sec) move into a new nav .nav-links wrapper that keeps its own
overflow-x:auto (preserving the intentional mobile horizontal-scroll
behavior for the links) and min-width:0 (so it can actually shrink inside
the outer flex row). nav .wrap itself drops overflow-x:auto entirely and
becomes a plain 2-child flex row: .nav-links and .theme-switcher. The
switcher is no longer a descendant of any overflow:auto box, so its
dropdown renders at full height. No JS touched; the switcher's existing
anchoring (top:calc(100% + .5rem); right:0) is unchanged and still works.
Verified by rendering (headless Chrome + live DOM inspection), not just
reading the source:
- Menu opens full-height, all 7 options visible, at 390/768/900/1280px.
- nav .wrap computes overflow-x/-y: visible (was auto/auto); .nav-links
computes overflow-x: auto with scrollWidth 663 > clientWidth 620 at
768px -- the links still scroll internally, confirming the mobile
behavior wasn't lost.
- Closed button at 768px: right edge now within the wrap's bounds
(previously clipped ~19px past it).
- Spot-checked the terminal theme (recent --bone-faint legibility work):
unaffected, still legible, nav restructure doesn't touch typography/
ornament CSS.
🤖 Generated with Claude Code
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
|
Merge request: PR #196 @ 5c7222f Fixes the theme-picker clipping bug reported on the architecture page — root cause was |
Summary
The owner reported the theme-picker on the architecture page rendering as a single clipped/misaligned box instead of a proper dropdown. Diagnosed first (read-only), confirmed root cause, now applying the fix.
Root cause:
nav .wraphadoverflow-x:auto(for the intentional horizontally-scrollable mobile nav) with no explicitoverflow-y. Per the CSS overflow spec, settingoverflow-xto anything butvisibleforces the browser to computeoverflow-yasautotoo — confirmed viagetComputedStyle, not just reading the source. The theme switcher's dropdown (.theme-menu,position:absolute) is a normal-flow descendant of that box, so it got clipped to the nav bar's ~48px height instead of the ~263px it needs — rendering as a single sliver overlapping the toggle button's label. Reproduced at every width tested (390/768/820/900/1280px) — it's a vertical-overflow bug, not a narrow-viewport one. Secondary symptom: between ~768–820px the nav's total content also exceeded the viewport, partially clipping the closed button at the right edge too.Fix: split the single flex row into two containers. The section links move into a new
nav .nav-linkswrapper that keepsoverflow-x:auto(preserving the intentional mobile scroll behavior) and getsmin-width:0(so it can actually shrink in the outer flex row).nav .wrapdropsoverflow-x:autoentirely and becomes a plain 2-child flex row:.nav-linksand.theme-switcher. The switcher is no longer a descendant of anyoverflow:autobox, so its dropdown renders at full height. No JS touched — the switcher's existing anchoring (top:calc(100% + .5rem); right:0) is unchanged.Verification (rendered, not just read)
nav .wrapnow computesoverflow-x/-y: visible(wasauto/auto);.nav-linkscomputesoverflow-x: autowithscrollWidth663 >clientWidth620 at 768px — the section links still scroll horizontally, the intentional mobile behavior wasn't lost.--bone-faintlegibility work, PR Docs: fix ornament-pattern legibility in arabic/indian/andalus/terminal themes #191): unaffected — this change doesn't touch typography or ornament CSS.Docs-only, not security-sensitive. Does not touch #116 or #185. No orchestrator-approval posted, nothing merged.
🤖 Generated with Claude Code