Skip to content

Commit 4a10e1f

Browse files
wdunn001claude
andcommitted
fix(global): site-wide responsive overflow — body overflow-x: hidden + tables/pre scroll within themselves on mobile
User reported the cost-tables (Starlink fleet, region/connection, etc.) plus likely other content overflowing the mobile viewport site-wide. The in-template fix in bf26006 (Benchmarks.astro .table-scroll wrapper) addressed the agent-loop tables but the cost-tables, v03-tables, markdown-rendered tables in changelog + docs all had the same problem. Site-wide global CSS fix instead of per-table wrappers: 1. body { overflow-x: hidden } — guarantees no single element forces the page into horizontal scroll. Individual wide elements handle their own overflow below. 2. @media (max-width: 900px): - table:not(.table-scroll > table) → display: block + overflow-x: auto. Catch-all for markdown-rendered tables (the changelog + docs have many) plus the .cost-table + .v03-table sets inside Benchmarks.astro that weren't wrapped in .table-scroll yet. Wrapped tables (.table-scroll > table from bf26006) skip this rule and keep their default display: table behaviour, which gives cleaner column sizing. - pre, code → overflow-x: auto. Long code blocks (the engine install snippets, JSON examples) get the same treatment. The on table is the standard responsive-table pattern used by GitHub markdown CSS + Bootstrap .table-responsive — the table-row / table-cell defaults INSIDE the table preserve cell layout; only the outer table becomes a scrollable block. 900px breakpoint is wide enough to catch tablets in portrait mode (common breakpoint for collapsing dense data tables). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bf26006 commit 4a10e1f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

src/styles/global.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,43 @@ body {
5050
min-height: 100dvh;
5151
display: flex;
5252
flex-direction: column;
53+
/* Prevent any single wide element (table, code block, long URL) from
54+
pushing the whole document into horizontal scroll. Individual wide
55+
elements get their own overflow handling via the rules below. */
56+
overflow-x: hidden;
57+
}
58+
59+
/* ── Global responsive overflow handling ──────────────────────────────
60+
Tables, pre/code blocks, and any wide content rendered from markdown
61+
(changelog, docs) needs to scroll WITHIN ITSELF on mobile instead of
62+
forcing page-level horizontal scroll. Component-level rules in
63+
Benchmarks.astro (.table-scroll) and similar handle in-template
64+
tables; these rules cover the markdown-rendered ones plus catch-all
65+
safety for anything else.
66+
67+
`display: block` on a `<table>` makes the table element a block-level
68+
container while THEAD/TBODY/TR/TH/TD keep their default
69+
table-row / table-cell display values — so the table renders
70+
normally inside, but the block parent can carry the scroll behaviour.
71+
Same pattern used by GitHub-flavoured-markdown CSS, Bootstrap
72+
.table-responsive, etc. */
73+
@media (max-width: 900px) {
74+
/* Catch-all for markdown-rendered tables (changelog, docs).
75+
In-template tables wrapped in .table-scroll are unaffected
76+
because they're already inside an overflow-x: auto container.
77+
A `<table>` that is the direct child of .table-scroll skips
78+
this rule via the :not() selector. */
79+
table:not(.table-scroll > table) {
80+
display: block;
81+
overflow-x: auto;
82+
-webkit-overflow-scrolling: touch;
83+
max-width: 100%;
84+
}
85+
pre, code {
86+
max-width: 100%;
87+
overflow-x: auto;
88+
-webkit-overflow-scrolling: touch;
89+
}
5390
}
5491

5592
a { color: inherit; text-decoration: none; }

0 commit comments

Comments
 (0)