Skip to content

Commit db10a05

Browse files
sktbrdclaude
andcommitted
Revert "feat(home): let the NogglesRail globe span the full viewport on desktop"
This reverts commit da5261a. Full-bleed didn't look right — the globe reads better contained at the page's shell width. Reverting the layout also drops the `html { overflow-y: auto }` + `body { overflow-x: clip }` pair, since those existed only to absorb the scrollbar overshoot that `w-screen` introduced. Nothing left in the tree needs them, and keeping a rule whose stated reason no longer exists invites someone to delete it later without knowing what it guarded. Known consequence: the ~8px horizontal overflow on mobile comes back. It is not from this change — a rider card in the stake carousel overflows its row, and the clip was only hiding the symptom. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent da5261a commit db10a05

2 files changed

Lines changed: 2 additions & 42 deletions

File tree

src/app/globals.css

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,33 +118,8 @@
118118
* {
119119
@apply border-border outline-ring/50;
120120
}
121-
/* Guard for full-bleed sections that break out of the layout's centred
122-
`max-w-6xl` main (currently the NogglesRail globe on the homepage). Those
123-
use `w-screen`, and `100vw` counts the scrollbar, so they overshoot the
124-
usable width by exactly one scrollbar and let the whole page be dragged
125-
sideways — measured at 9px before this rule.
126-
127-
These two declarations only work together, so don't split them:
128-
129-
`overflow-x: clip` on `body` alone does nothing. While `html` is `visible`,
130-
the root's overflow is propagated from `body` to the viewport and body's own
131-
used value becomes `visible` — so the clip lands on the viewport, which
132-
WebKit does not honour here (verified: `clip` AND `hidden` on `html` both
133-
still scrolled 9px). Giving `html` a non-`visible` overflow-y stops that
134-
propagation, which is what finally lets body clip its own overflow.
135-
136-
`auto`, not `scroll`: `scroll` also stops propagation but forces a permanent
137-
scrollbar on every page on platforms that draw one.
138-
139-
`clip`, never `hidden`: `clip` leaves the other axis `visible`, so body
140-
never becomes a scroll container and `position: sticky` on the site header
141-
keeps working. `hidden` would break it. */
142-
html {
143-
overflow-y: auto;
144-
}
145121
body {
146122
@apply bg-background text-foreground;
147-
overflow-x: clip;
148123
}
149124
.leaflet-container {
150125
@apply !bg-card !font-[inherit];

src/components/newhome/RailsSection.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ export function RailsSection() {
1919
);
2020

2121
return (
22-
// No horizontal padding here: the heading keeps the page's shell while the
23-
// globe breaks out of it, so each one owns its own gutter.
24-
<section id="rails" className="py-10 sm:py-18">
25-
<div className={SHELL}>
22+
<section id="rails" className="px-4 py-10 sm:px-6 sm:py-18">
23+
<div className={`${SHELL} flex flex-col gap-6 px-0`}>
2624
<SectionHeading
2725
eyebrow={t("eyebrow")}
2826
title={t("title", { rails: stats.installations, countries: stats.countries })}
@@ -35,20 +33,7 @@ export function RailsSection() {
3533
</>
3634
}
3735
/>
38-
</div>
3936

40-
{/* Full-bleed globe, desktop only.
41-
The page renders inside the layout's `max-w-6xl mx-auto` main, so the
42-
globe and its detail panel were capped at 1152px with dead space either
43-
side on a wide screen. `mx-[calc(50%-50vw)] w-screen` re-centres the
44-
block on the viewport instead of on the shell.
45-
`100vw` counts the scrollbar on platforms that reserve one, so this
46-
overshoots by half a scrollbar per side — `overflow-x: clip` on body
47-
(globals.css) absorbs it. Without that guard this is exactly the
48-
horizontal scrollbar the homepage comment warns about.
49-
Below lg it stays inside the shell: the grid is single-column there and
50-
a full-width globe on a phone buys nothing. */}
51-
<div className="mx-auto mt-6 w-full max-w-6xl px-4 sm:px-6 lg:mx-[calc(50%-50vw)] lg:w-screen lg:max-w-none lg:px-6">
5237
<RailGlobeSection />
5338
</div>
5439
</section>

0 commit comments

Comments
 (0)