Skip to content

Commit 057eb10

Browse files
bloveclaude
andcommitted
fix(website): mobile hygiene — sidebar breakpoint + layout viewport constraint (#549)
* fix(docs): defer sidebar reveal to lg breakpoint Mobile audit flagged the docs sidebar as 500–925% viewport-height sticky on tablet (768px). At that width it crowded the article and was the largest sticky/fixed offender. Pushing the reveal from md:block (768px) to lg:block (1024px) hides it for tablet/narrow-desktop and lets the article use the full width. Mobile menu's docs tab already covers nav at <lg. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(website): constrain layout viewport on mobile Follow-up to #547. body { overflow-x: hidden } prevents the user-visible scrollbar but doesn't stop mobile browsers from EXPANDING the layout viewport when child content (code blocks, wide grids) exceeds device-width. The fixed nav then renders at that expanded width — its right side (hamburger button) ends up clipped offscreen. Two additions: 1. html { overflow-x: hidden } — anchors the layout viewport to the visual viewport so the fixed nav and other position:fixed elements stay aligned with what the user sees. 2. pre { max-width: 100%; overflow-x: auto } as a universal rule (was already on .shiki and .docs-prose pre; this catches any other pre that might appear in landing components without those classes). Verified live in prod via Chrome MCP: the previous PR's body { overflow-x: hidden } and h1..h6 { word-break } are both applied; the remaining overflow numbers come from layout-viewport expansion, which this PR addresses. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 232f943 commit 057eb10

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

apps/website/src/app/global.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
box-sizing: border-box;
66
}
77

8+
html {
9+
overflow-x: hidden;
10+
}
11+
812
body {
913
background-color: var(--color-bg);
1014
color: var(--color-text-primary);
@@ -14,6 +18,14 @@ body {
1418
overflow-x: hidden;
1519
}
1620

21+
/* Code blocks scroll internally; never expand the layout viewport. */
22+
pre, code {
23+
max-width: 100%;
24+
}
25+
pre {
26+
overflow-x: auto;
27+
}
28+
1729
/* Long unbreakable tokens (e.g. package names like @threadplane/chat,
1830
* file paths like app.config.ts) live inside marketing headings and pull
1931
* the layout wider than the viewport on narrow phones. Allow breaking

apps/website/src/components/docs/DocsSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export function DocsSidebar({ activeLibrary, activeSection, activeSlug }: Props)
168168

169169
return (
170170
<aside
171-
className="w-64 shrink-0 py-6 overflow-y-auto hidden md:block"
171+
className="w-64 shrink-0 py-6 overflow-y-auto hidden lg:block"
172172
style={{
173173
borderRight: `1px solid ${tokens.surfaces.border}`,
174174
background: tokens.surfaces.surface,

0 commit comments

Comments
 (0)