Skip to content

Commit b009ddb

Browse files
committed
fix: stop mobile overflow, clarify copy button
- Add min-w-0 to the hero grid columns and the install methods grid so items can shrink below their widest child (the long install URL) instead of widening the page. Home page now fits 375px with zero horizontal scroll. - Restyle the copy control as a distinct bordered chip with an icon, clearly separated from the command text so it reads as a button rather than part of the command.
1 parent 058c51d commit b009ddb

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

web/app/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export default function Home() {
7878
<section className="relative overflow-hidden">
7979
<div className="flowgrid pointer-events-none absolute inset-0 -z-10" aria-hidden />
8080
<div className="mx-auto grid max-w-6xl items-center gap-10 px-6 py-20 lg:grid-cols-2 lg:py-28">
81-
<div>
81+
{/* min-w-0: a grid item defaults to min-width:auto and won't shrink
82+
below its widest child (the long install URL), which would push the
83+
whole page wide on mobile. */}
84+
<div className="min-w-0">
8285
<p className="eyebrow rise mb-5">backup · restore · sync · cdc</p>
8386
<h1
8487
className="rise text-[2.6rem] leading-[1.05] text-balance sm:text-6xl"
@@ -119,7 +122,7 @@ export default function Home() {
119122
</ExtLink>
120123
</div>
121124
</div>
122-
<div className="rise" style={{ "--rise-delay": "400ms" } as React.CSSProperties}>
125+
<div className="rise min-w-0" style={{ "--rise-delay": "400ms" } as React.CSSProperties}>
123126
<Terminal />
124127
</div>
125128
</div>
@@ -201,13 +204,13 @@ export default function Home() {
201204
<InstallCommand command={INSTALL_CMD} />
202205
</div>
203206
<div className="grid gap-6 sm:grid-cols-2">
204-
<div>
207+
<div className="min-w-0">
205208
<p className="mb-2 font-mono text-xs tracking-widest text-(--muted) uppercase">
206209
Homebrew
207210
</p>
208211
<InstallCommand command="brew install nixrajput/siphon/siphon" />
209212
</div>
210-
<div>
213+
<div className="min-w-0">
211214
<p className="mb-2 font-mono text-xs tracking-widest text-(--muted) uppercase">
212215
Scoop (Windows)
213216
</p>

web/components/InstallCommand.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export function InstallCommand({ command }: { command: string }) {
3737
<button
3838
type="button"
3939
onClick={copy}
40-
className="group flex w-full items-center gap-3 rounded-lg border border-(--line) bg-(--ink-2) px-4 py-3 text-left font-mono text-sm transition-colors hover:border-(--amber)"
40+
className="group flex w-full items-center gap-2 rounded-lg border border-(--line) bg-(--ink-2) py-2 pr-2 pl-4 text-left font-mono text-sm transition-colors hover:border-(--amber)"
4141
aria-label={`Copy install command: ${command}`}
4242
>
43-
<span aria-hidden className="text-(--amber) select-none">
43+
<span aria-hidden className="shrink-0 text-(--amber) select-none">
4444
$
4545
</span>
4646
{/* min-w-0 lets this flex item shrink below the command's intrinsic
@@ -49,11 +49,17 @@ export function InstallCommand({ command }: { command: string }) {
4949
<code className="min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-(--paper)">
5050
{command}
5151
</code>
52+
{/* The Copy action reads as a distinct chip — its own border + background,
53+
divided from the command — so it's clearly a button, not part of the
54+
text. shrink-0 keeps it from being squeezed by a long command. */}
5255
<span
53-
className={`text-xs tracking-widest uppercase select-none ${
54-
copied ? "text-(--flow)" : "text-(--muted) group-hover:text-(--amber)"
56+
className={`flex shrink-0 items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs tracking-wide uppercase transition-colors select-none ${
57+
copied
58+
? "border-(--flow) text-(--flow)"
59+
: "border-(--line) bg-(--ink) text-(--muted) group-hover:border-(--amber) group-hover:text-(--amber)"
5560
}`}
5661
>
62+
<span aria-hidden>{copied ? "✓" : "⧉"}</span>
5763
{copied ? "Copied" : "Copy"}
5864
</span>
5965
</button>

0 commit comments

Comments
 (0)