Setting — display leading
Variant: Display leading
A headline still on body-text line height, 1.5, and the correction to 1.08 that display type needs. At display sizes, body leading opens a gap between the lines that reads as two headlines. The proof mark is the line box itself: each line gets a tinted band, and the bands scale about their centres by exactly 1.08 / 1.5 while their lines move, so they end up touching with no gap and no overlap. The leading is visibly removed, rather than the text being nudged. Nothing reflows. The DOM stays at 1.5 and each line moves by half the leading it loses plus all the leading lost above it: 0.21em, 0.63em, and 0.84em for the paragraph and the footer under the headline. The footer travels too, so the removed leading ends up as margin below the card’s last rule rather than as a hole above it. All of them share one 336ms in-out window, because they are one setting change and a stagger would make it look like several. Reach for it on hero and release-note headlines, or any heading that wraps.
The source
A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Setting — display leading</title>
<style>
:root {
/* Neutrals — fixed, never remixed. */
--ivory: #faf9f5;
--paper: #ffffff;
--oat: #e3dacc;
--slate: #141413;
/* Knobs — the remix API. A knob exists iff declared here and used below. */
--hue: 38.8;
--lift: 0;
--chroma: 1;
--round: 1;
--speed: 1;
/* Accents — derived from the knobs with the family's offsets baked in,
so one hue roll moves them together. Defaults reproduce the original hex
(#d97757 / #b85c3e / #788c5d / #b04a3f). */
--clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
--clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
--olive: oklch(
calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
);
--rust: oklch(
calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
);
/* Clock — 5.6s, shared across the setting family. The proof mark goes
down at 16%, the correction lands by 32%, the mark is lifted by
56%, and the card resets inside a blank window at 93%. */
--cycle: 5.6s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
--_read: color-mix(in srgb, var(--slate) 78%, transparent);
--_quiet: color-mix(in srgb, var(--slate) 55%, transparent);
/* Display size, kept as a token because the paragraph below has to
travel by a multiple of the headline's em, not its own. */
--_ds: clamp(24px, 7.2vw, 34px);
--_band: color-mix(in srgb, var(--clay) 10%, transparent);
--_band-2: color-mix(in srgb, var(--clay) 18%, transparent);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
padding: clamp(12px, 3vw, 28px);
background: var(--ivory);
color: var(--slate);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
}
.sheet {
width: min(360px, 92vw);
padding: clamp(14px, 3.4vw, 22px) clamp(16px, 3.8vw, 26px);
border: 1px solid var(--oat);
border-radius: calc(14px * var(--round));
background: var(--paper);
}
/* The whole set resets inside one blank window, so the loop never shows
the correction being undone — a fix that visibly reverses reads as a
second animation with the opposite meaning. */
.stage {
animation: seam var(--t) infinite;
}
.eyebrow {
font-size: clamp(11px, 2.4vw, 12.5px);
font-weight: 600;
letter-spacing: 0.09em;
text-transform: uppercase;
color: var(--_quiet);
}
.foot {
margin-top: clamp(12px, 2.6vw, 16px);
padding-top: clamp(9px, 2vw, 12px);
border-top: 1px solid var(--oat);
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 6px 12px;
}
.foot code {
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
font-size: clamp(11px, 2.6vw, 12.5px);
color: var(--_quiet);
white-space: nowrap;
}
/* The state chip rolls on a two-row track rather than crossfading, so no
frame has both words legible. */
.chip {
height: calc(1.6em + 2px);
overflow: hidden;
padding: 0 0.7em;
border: 1px solid var(--oat);
border-radius: 999px;
font-size: clamp(11px, 2.5vw, 12px);
font-weight: 600;
line-height: 1.6em;
color: var(--_quiet);
}
.track {
display: block;
animation: roll var(--t) infinite;
}
.track > span {
display: block;
white-space: nowrap;
}
.track .set {
color: var(--slate);
}
.track .set::before {
content: '';
display: inline-block;
width: 0.45em;
height: 0.45em;
margin-right: 0.4em;
border-radius: 50%;
background: var(--olive);
vertical-align: 0.08em;
}
@keyframes roll {
0%,
32% {
transform: translateY(0);
animation-timing-function: var(--ease-out);
}
36%,
92.9% {
transform: translateY(-50%);
}
93%,
100% {
transform: translateY(0);
}
}
@keyframes seam {
0%,
88% {
opacity: 1;
animation-timing-function: ease;
}
92%,
94% {
opacity: 0;
animation-timing-function: ease;
}
98%,
100% {
opacity: 1;
}
}
/* The DOM is set at body leading, 1.5, and transforms alone close it to
1.08. Each line moves by exactly half the leading it loses plus all
the leading lost above it: 0.21em, 0.63em, and 0.84em for the block
under the headline. Nothing reflows and nothing is estimated. */
.display {
margin-top: clamp(8px, 1.8vw, 12px);
font-size: var(--_ds);
font-weight: 650;
line-height: 1.5;
letter-spacing: -0.022em;
isolation: isolate;
}
.dl {
position: relative;
display: block;
white-space: nowrap;
}
/* The proof mark is the line box itself. Bands scale about their centre
by 1.08 / 1.5 while their lines travel, so the two boxes finish
exactly abutting — the eye watches leading being taken out rather
than text being nudged. */
.dl::before {
content: '';
position: absolute;
inset: 0 -0.16em;
z-index: -1;
background: var(--_band);
animation: band var(--t) infinite;
}
.d2::before {
background: var(--_band-2);
}
.d1 {
animation: lift-1 var(--t) infinite;
}
.d2 {
animation: lift-2 var(--t) infinite;
}
.lede {
margin-top: clamp(4px, 1vw, 8px);
font-size: clamp(13px, 3.3vw, 15px);
line-height: 1.45;
color: var(--_read);
animation: lift-3 var(--t) infinite;
}
/* The footer travels with the paragraph, so the leading removed from
the headline ends up as margin under the card's last rule instead of
as a hole above it. */
.foot {
animation: lift-3 var(--t) infinite;
}
@keyframes band {
0%,
16% {
clip-path: inset(0 100% 0 0);
transform: scaleY(1);
opacity: 1;
animation-timing-function: var(--ease-out);
}
23%,
26% {
clip-path: inset(0 0 0 0);
transform: scaleY(1);
opacity: 1;
animation-timing-function: var(--ease-in-out);
}
32%,
46% {
clip-path: inset(0 0 0 0);
transform: scaleY(0.72);
opacity: 1;
animation-timing-function: ease;
}
56%,
92.9% {
clip-path: inset(0 0 0 0);
transform: scaleY(0.72);
opacity: 0;
}
93%,
100% {
clip-path: inset(0 100% 0 0);
transform: scaleY(1);
opacity: 1;
}
}
/* One curve, one window, three distances: the headline and the block
under it close up as one motion, because they are one setting change
and a stagger would read as three. */
@keyframes lift-1 {
0%,
26% {
transform: translateY(0);
animation-timing-function: var(--ease-in-out);
}
32%,
92.9% {
transform: translateY(-0.21em);
}
93%,
100% {
transform: translateY(0);
}
}
@keyframes lift-2 {
0%,
26% {
transform: translateY(0);
animation-timing-function: var(--ease-in-out);
}
32%,
92.9% {
transform: translateY(-0.63em);
}
93%,
100% {
transform: translateY(0);
}
}
@keyframes lift-3 {
0%,
26% {
transform: translateY(0);
animation-timing-function: var(--ease-in-out);
}
32%,
92.9% {
transform: translateY(calc(var(--_ds) * -0.84));
}
93%,
100% {
transform: translateY(0);
}
}
@media (prefers-reduced-motion: reduce) {
/* Every travel distance in the piece goes to zero time — positions cut
between their two states inside a frame — while the proof marks,
which say what is about to change and that it changed, keep fading
on a slower clock. */
.stage,
.track,
.dl,
.dl::before,
.lede,
.foot {
animation-duration: calc(var(--t) * 1.7);
}
.track {
animation-name: roll-rm;
}
@keyframes roll-rm {
0%,
32.9% {
transform: translateY(0);
}
33%,
92.9% {
transform: translateY(-50%);
}
93%,
100% {
transform: translateY(0);
}
}
.dl::before {
clip-path: none;
animation-name: band-rm;
}
.d1 {
animation-name: lift-1-rm;
}
.d2 {
animation-name: lift-2-rm;
}
.lede,
.foot {
animation-name: lift-3-rm;
}
@keyframes band-rm {
0%,
16% {
transform: scaleY(1);
opacity: 0;
animation-timing-function: ease;
}
23%,
28.9% {
transform: scaleY(1);
opacity: 1;
}
29%,
46% {
transform: scaleY(0.72);
opacity: 1;
animation-timing-function: ease;
}
56%,
100% {
transform: scaleY(0.72);
opacity: 0;
}
}
@keyframes lift-1-rm {
0%,
28.9% {
transform: translateY(0);
}
29%,
92.9% {
transform: translateY(-0.21em);
}
93%,
100% {
transform: translateY(0);
}
}
@keyframes lift-2-rm {
0%,
28.9% {
transform: translateY(0);
}
29%,
92.9% {
transform: translateY(-0.63em);
}
93%,
100% {
transform: translateY(0);
}
}
@keyframes lift-3-rm {
0%,
28.9% {
transform: translateY(0);
}
29%,
92.9% {
transform: translateY(calc(var(--_ds) * -0.84));
}
93%,
100% {
transform: translateY(0);
}
}
}
</style>
</head>
<body>
<div class="sheet">
<div class="stage">
<p class="eyebrow">Release notes</p>
<h1 class="display">
<span class="dl d1">Faster builds,</span>
<span class="dl d2">fewer surprises</span>
</h1>
<p class="lede">The cache now survives a branch switch.</p>
<div class="foot">
<code>line-height: 1.08</code>
<span class="chip" aria-hidden="true"
><span class="track"><span>as typed</span><span class="set">as set</span></span></span
>
</div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.