You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1d6ed16
Browse filesBrowse the repository at this point in the historyBrowse files
fix(shared): keep hosted reloads unpadded without exposing a marker
The hosted marker was appended to window.name at load, so a page's own
scripts saw a value they never set and JSON kept in window.name broke.
It also outlived its document, and WebKit clears window.name when a
sandboxed page reloads, so iOS reloads gained the gutter anyway.
Mark the page as it unloads instead, in window.name (which Chromium
keeps across the reload) and history.state (which WebKit keeps), and
remove the mark on the next load before the page's scripts run. A mark
left at another path no longer counts. The layout guide now says the
html{padding:0} opt-out must be unlayered.
"The page sits on the thread's own background, so by default leave html, body, and the outermost element with no background color. This overrides general style preferences such as a fixed black page background.",
245
245
"Use a fluid width with no horizontal padding on the outermost element, and no outer card, border, or banner title: the page is part of your reply.",
246
246
"Size widths against the container (%, auto, max-width), not the viewport (vw, dvw, svw, lvw, or window.innerWidth) or a fixed pixel width: opened on its own, the page gets a 16px gutter on every side, so anything as wide as the viewport overflows it.",
247
-
"A page that must run edge to edge when opened on its own, such as a full-bleed canvas, can remove that gutter by setting html{padding:0}. Treat it as an exception, not a default: do not add it routinely, and do not put html in a reset such as html,body{margin:0;padding:0}. The base stylesheet already zeroes the body margin, so reset body alone, or use *{margin:0;padding:0}, which leaves the gutter.",
247
+
"A page that must run edge to edge when opened on its own, such as a full-bleed canvas, can remove that gutter with an unlayered html{padding:0} rule; a rule inside @layer, such as a Tailwind v4 class, loses to the gutter. Treat it as an exception, not a default: do not add it routinely, and do not put html in a reset such as html,body{margin:0;padding:0}. The base stylesheet already zeroes the body margin, so reset body alone, or use *{margin:0;padding:0}, which leaves the gutter.",
248
248
"If a box needs its own background (a mock of a specific screen, a panel that must stand apart), give it at least 16px of padding on every side and var(--radius) corners, so content never touches its edge.",
249
249
"Give charts fixed pixel heights rather than heights that scale with width.",
250
250
"Let content set the page's height. The frame grows to fit the page, so a height that follows the viewport makes it grow again and again: html_preview and html_render reject vh, svh, lvh, and dvh units, and height:100% on html or body has the same problem.",
0 commit comments