Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save milushov/6969c16330c77eb80ef00834960843df to your computer and use it in GitHub Desktop.

Select an option

Save milushov/6969c16330c77eb80ef00834960843df to your computer and use it in GitHub Desktop.
Lapster island toast — left-padding variants comparison
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Island toast — padding variants comparison</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {
--pill-h: 88px;
--pill-w: 360px; /* worst-case expanded width */
--di-h: 36px; /* empty header band */
--icon: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, sans-serif;
background: #0e0f12;
color: #fff;
padding: 36px 16px 60px;
min-height: 100vh;
}
h1 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
p.lede {
margin: 0 0 28px;
font-size: 13px; color: #ffffffaa;
max-width: 760px; line-height: 1.55;
}
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 24px;
max-width: 880px;
}
.variant {
background: #1c1e22;
padding: 18px;
border-radius: 14px;
border: 1px solid #ffffff10;
}
.variant h3 {
margin: 0 0 4px;
font-size: 14px; font-weight: 600;
display: flex; align-items: baseline; gap: 8px;
}
.variant .tag {
font-size: 11px;
color: #ffffff66;
font-weight: 500;
font-variant-numeric: tabular-nums;
}
.variant.preferred { border-color: #34c75955; box-shadow: 0 0 0 1px #34c75933 inset; }
.variant.preferred h3::after { content: " ✓"; color: #34c759; }
.variant .pros {
margin: 8px 0 12px;
font-size: 12px; color: #ffffffaa;
line-height: 1.55;
}
/* The toast itself */
.pill {
position: relative;
width: var(--pill-w);
max-width: 100%;
height: var(--pill-h);
background: #000;
border-radius: 44px; /* = height/2 → real capsule */
overflow: hidden;
box-shadow: 0 16px 36px #00000055;
}
/* DI header band (just visual marker for clarity in the mockup) */
.pill::before {
content: "";
position: absolute;
top: 0; left: 50%; transform: translateX(-50%);
width: 124px; height: var(--di-h);
background: #ffffff05; /* very subtle band so reviewers can see where DI ends */
border-bottom: 1px dashed #ffffff15;
}
.pill .content {
position: absolute;
inset: 0;
padding-top: var(--di-h);
display: flex;
align-items: center;
/* `padding-left` and `gap` are the variables we're comparing */
padding-left: var(--pad-left);
padding-right: var(--pad-right, var(--pad-left));
gap: var(--icon-gap);
}
.pill .icon {
width: var(--icon);
height: var(--icon);
border-radius: 50%;
background: var(--icon-bg, #0a84ff);
color: #fff;
display: grid; place-items: center;
flex: 0 0 var(--icon);
box-shadow: 0 2px 6px #00000040;
}
.pill .icon svg { width: 14px; height: 14px; }
.pill .text {
display: flex; flex-direction: column;
gap: 1px; min-width: 0;
}
.pill .title {
font-size: 13px; font-weight: 600;
color: #fff;
line-height: 1.2;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill .body {
font-size: 11px; font-weight: 400;
color: #ffffffbf;
line-height: 1.25;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Visual ruler — shows where the capsule's curve actually ends.
At the icon's vertical extreme (y = di-h + slab-mid + icon-radius)
the capsule curve still extends ~13.8pt from the bounding box. */
.ruler {
position: absolute;
inset: 0;
pointer-events: none;
}
.ruler::before {
/* The "safe" inner curve at the icon's bottom edge — anything left
of this is being eaten by the capsule's rounded corner */
content: "";
position: absolute;
top: 0; left: 0; bottom: 0;
width: 14px;
background: linear-gradient(to right, #ff3b3025 0%, transparent 100%);
}
/* Reusable toast factory — pad-left / pad-right / icon-gap vary */
.v-current { --pad-left: 12px; --icon-gap: 8px; } /* what ships today */
.v-lg { --pad-left: 16px; --icon-gap: 8px; }
.v-xl { --pad-left: 20px; --icon-gap: 10px; }
.v-xxl { --pad-left: 24px; --icon-gap: 12px; }
.v-balanced { --pad-left: 18px; --icon-gap: 12px; }
.v-balanced-pad { --pad-left: 18px; --pad-right: 14px; --icon-gap: 12px; }
.footnote {
color: #ffffff66;
font-size: 12px;
margin-top: 24px;
max-width: 760px;
line-height: 1.55;
}
.footnote code {
background: #ffffff10;
padding: 1px 6px;
border-radius: 4px;
font-size: 11px;
}
/* Side-by-side current vs preferred at the top */
.hero {
display: flex; gap: 18px; flex-wrap: wrap;
margin-bottom: 36px;
}
.hero .variant { flex: 1 1 360px; }
</style>
</head>
<body>
<h1>Island toast — left-padding variants</h1>
<p class="lede">
The icon currently sits 12pt from the bounding-box edge, but at an 88pt-tall pill the
capsule's bottom-left curve extends ~14pt into that bounding box at the icon's lowest
point — that's why the blue antenna circle looks like it's grazing the curve. Comparing
four padding bumps + one combined "padding + icon-gap" tune below. Faint red gradient on
the left of each pill shows the capsule's inner curve danger zone.
</p>
<div class="hero">
<div class="variant">
<h3>Current <span class="tag">pad-left 12, gap 8</span></h3>
<p class="pros">Ships today. Icon at x=12 collides with the capsule's curve at the bottom of the icon (~y=76, curve = 13.8pt) — that's the "no breathing room" feel.</p>
<div class="pill v-current">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
<div class="variant preferred">
<h3>Balanced <span class="tag">pad-left 18, pad-right 14, gap 12</span></h3>
<p class="pros">Clears the capsule curve with a real visual margin (~4pt of breathing room past the danger zone). Wider icon-to-text gap declutters the cluster. Slightly tighter right padding because the text rail is naturally narrower than the icon column on the left.</p>
<div class="pill v-balanced-pad">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
</div>
<h2 style="font-size:15px;font-weight:600;margin:0 0 14px;color:#ffffffcc;">Other points along the axis</h2>
<div class="grid">
<div class="variant">
<h3>Spacing.lg <span class="tag">pad-left 16, gap 8</span></h3>
<p class="pros">+4pt over current. Crosses the danger zone but only by 2pt — still feels tight, and the icon-to-text gap is unchanged.</p>
<div class="pill v-lg">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
<div class="variant">
<h3>Spacing.xl <span class="tag">pad-left 20, gap 10</span></h3>
<p class="pros">Clearly clear of the curve and reads "comfortable". Loses a little body-text horizontal room — may be a problem for the 2-line body cases on smaller iPhones.</p>
<div class="pill v-xl">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
<div class="variant">
<h3>Spacing.xxl <span class="tag">pad-left 24, gap 12</span></h3>
<p class="pros">Apple-DI generous. Icon island feels deliberate. Worst-case: long bodies start crowding the right edge on iPhone mini / SE.</p>
<div class="pill v-xxl">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
<div class="variant">
<h3>Symmetric 18/18 <span class="tag">pad-left 18, gap 12</span></h3>
<p class="pros">Same as the preferred but with equal padding both sides. Slightly tighter feeling because the body text loses 4pt of right rail without any visual reason to.</p>
<div class="pill v-balanced">
<div class="ruler"></div>
<div class="content">
<div class="icon"><svg viewBox="0 0 16 16" fill="none"><path d="M2 8 Q5 4 8 4 Q11 4 14 8" stroke="#fff" stroke-width="1.4" fill="none"/><path d="M4 10 Q6 7 8 7 Q10 7 12 10" stroke="#fff" stroke-width="1.4" fill="none"/><circle cx="8" cy="13" r="1.4" fill="#fff"/></svg></div>
<div class="text">
<div class="title">Bluetooth recovered</div>
<div class="body">Standalone recording off. Phone is back in charge.</div>
</div>
</div>
</div>
</div>
</div>
<p class="footnote">
Math: an 88pt-tall capsule has a corner radius of 44pt. At the icon's lowest extent
(y ≈ 76 from the top of the pill, ie. y ≈ 32 from the pill's vertical centre), the
capsule's inner curve is x = 44 − √(44² − 32²) ≈ <code>13.8pt</code> from the bounding
box. Anything left of that is being eaten by the curve. Current <code>pad-left: 12</code>
is already inside that zone — which matches the screenshot.
<br/><br/>
Recommendation: <strong>balanced 18/14/12</strong> — biggest visual upgrade with the
smallest token impact (uses standard <code>Spacing.lg</code> family + custom right inset).
Drop in via two token tweaks; revert is one line each.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment