Skip to content

Commit 7ca2645

Browse files
committed
Fix horizontal scrolling on phones and tighten the mobile layout
The page scrolled 232px sideways at 375px. Two instances of the same trap: a flex item and a grid item both default to min-width:auto, so neither the pre nor the block containing it would shrink below the longest command, "cp -r Foreman/plugins/foreman/skills/foreman ~/.agents/skills/". The pre's own overflow-x never engaged because it was never allowed to be narrow. min-width:0 on both, and the commands scroll inside their own boxes. I had previously called this verified. The measurement was wrong: the tool reported a 607px viewport while claiming 375, so the check passed against a width no phone has. Measured this time inside a 375px iframe, and swept 320, 360, 375, 414, 480, 768 and 1024. All zero. Mobile layout, under 34rem: - Copy sits under the command instead of taking a third of the line. - Gutters 1.75rem to 1.25rem, and section padding tightened. - The footer wordmark and cutout get explicit sizes so they fill the sheet rather than shrinking to fit one line, with a smaller step under 24rem. - The footer's "Then say" block is hidden. Two columns apart on desktop, it stacked directly under the install section's identical line on a phone. Desktop renders byte identical to the committed screenshot.
1 parent b2c78a2 commit 7ca2645

1 file changed

Lines changed: 44 additions & 3 deletions

File tree

‎docs/index.html‎

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,21 @@
313313
.card p { font-size: .875rem; color: var(--muted); margin: 0; }
314314

315315
/* install */
316+
/* Grid items default to min-width:auto too, so each block here would refuse to
317+
shrink below the longest command inside it. Same trap as the flex row below. */
316318
.install { display: grid; gap: 1.5rem; }
319+
.install > div { min-width: 0; }
320+
.hero .cols > * { min-width: 0; }
317321
pre {
318322
margin: 0; background: var(--paper); border: 1px solid var(--hair);
319323
padding: .8rem .9rem; overflow-x: auto;
320324
font-family: var(--mono); font-size: .8125rem; line-height: 1.75;
321325
}
322326
.copyrow { display: flex; gap: .5rem; align-items: stretch; }
323-
.copyrow pre { flex: 1; }
327+
/* min-width:0 is load bearing. A flex item defaults to min-width:auto, which
328+
refuses to shrink below its longest unbreakable token, so the pre pushed the
329+
whole page 230px wide on a phone and its own overflow-x never engaged. */
330+
.copyrow pre { flex: 1; min-width: 0; }
324331
.copy {
325332
font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
326333
background: transparent; color: var(--muted); border: 1px solid var(--hair);
@@ -408,10 +415,44 @@
408415
.card:last-child { border-bottom: 0; }
409416
}
410417
@media (max-width: 34rem) {
418+
:root { --gut: 1.25rem; }
419+
411420
.bar nav { display: none; }
412-
.row .t { text-align: left; grid-column: 2 / -1; }
421+
413422
.row { grid-template-columns: 2rem 1fr; }
423+
.row .t { text-align: left; grid-column: 2 / -1; }
414424
.row .hatch { display: none; }
425+
426+
/* Give the command its full width and put Copy underneath it. Side by side,
427+
the button ate a third of the line on a 375px screen. */
428+
.copyrow { flex-direction: column; align-items: flex-start; }
429+
.copyrow pre { width: 100%; }
430+
.copy { padding: .55rem .8rem; }
431+
432+
.hero { padding: 2.25rem 0 2rem; }
433+
.hero .cols { gap: 1.75rem; }
434+
.sheet { padding: 1rem .875rem .875rem; }
435+
section { padding: 2.5rem 0; }
436+
437+
/* The wordmark carries the footer, so let it run to the edges and sit the
438+
cutout beside it rather than shrinking both to fit one line. */
439+
footer { padding: 1.75rem 0 1.5rem; }
440+
.sheetfoot { padding: 1.75rem 1.25rem 0; border-radius: 10px; }
441+
.wordrow { margin-top: 1.75rem; align-items: flex-end; gap: .5rem; }
442+
.wordmark { font-size: 3.75rem; }
443+
.cutout { width: 6rem; }
444+
.foothead { gap: 1.25rem; }
445+
/* Stacked, this lands directly under the install section's identical line.
446+
Two columns apart on desktop, a stutter on a phone. */
447+
.thensay { display: none; }
448+
.links { gap: .4rem; }
449+
.links a { padding: .4rem .55rem; }
450+
.footrule { gap: .35rem; }
451+
}
452+
453+
@media (max-width: 24rem) {
454+
.wordmark { font-size: 3.1rem; }
455+
.cutout { width: 5rem; }
415456
}
416457

417458
/* ---------- the one animation ----------
@@ -710,7 +751,7 @@ <h2>One folder of markdown. It goes anywhere an agent reads files.</h2>
710751
</div>
711752
</div>
712753

713-
<div>
754+
<div class="thensay">
714755
<span class="stamp">Then say</span>
715756
<p style="font-family:var(--mono); font-size:.8125rem; color:var(--sheetText);">
716757
help me build my portfolio

0 commit comments

Comments
 (0)