Thread — the reply branch opens and re-shelves
Variant: Reply branch
Opening a reply thread as a shared element: the parent message is the row that lifts off the list and becomes the thread’s header, then goes back to the exact shelf it came from. The panel slides over from the right in 288ms on ease-out while the parent rises two rows in 317ms on ease-in-out — the panel is entering, the message is already on screen moving from A to B, so they get different curves. The flier starts exactly over its list row and the row steps aside on the same frame, so there is only ever one of this message — and it only casts a shadow while it is in the air. It sheds its "3 replies" count in flight, because that is a property of the list row and not of the header, and picks it back up on the way home. Replies stagger in 72ms apart. On close the panel leaves the way it came in 216ms, faster than it arrived, and the message lands back in its row, so the reader is returned to where they were without having to find their place again. The panel covers rather than splits, because at card width two columns are both too narrow to read. Under reduced motion nothing flies: the list fades out before the thread fades in, never both at once, so the two layers’ text never ghosts. Reach for it for comment threads, replies and any list item that opens a detail layer it belongs to.
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>Thread — the reply branch opens and re-shelves</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. */
--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 — 7.2s, so 1% is 72ms. "3 replies" pressed at 14%; the panel
opens 18% to 22% while the parent lifts 18% to 22.4%; replies
stagger in from 22.5%. Close at 64%, panel gone by 69%, parent
re-shelved at 70.4%. */
--cycle: 7.2s;
--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);
--_muted: color-mix(in srgb, var(--slate) 58%, transparent);
--_shade: color-mix(in srgb, var(--slate) 14%, transparent);
--_press: color-mix(in srgb, var(--oat) 70%, var(--paper));
--_a: color-mix(in srgb, var(--clay) 30%, var(--paper));
--_j: color-mix(in srgb, var(--olive) 32%, var(--paper));
--_m: color-mix(in srgb, var(--oat) 90%, var(--paper));
--_row: 28px;
--_gap: 6px;
--_pitch: calc(var(--_row) + var(--_gap));
--_stagger: calc(72ms / var(--speed));
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
color: var(--slate);
}
.card {
width: min(340px, 92vw);
background: var(--paper);
border: 1px solid var(--oat);
border-radius: calc(14px * var(--round));
overflow: hidden;
}
.head {
display: flex;
justify-content: space-between;
align-items: center;
height: 32px;
padding: 0 14px;
font-size: 12px;
color: var(--_muted);
border-bottom: 1px solid var(--oat);
}
.head b {
color: var(--slate);
font-weight: 600;
}
.view {
position: relative;
height: calc(5 * var(--_pitch) - var(--_gap) + 16px);
padding: 8px 10px;
overflow: hidden;
}
.list,
.panel {
display: grid;
align-content: start;
gap: var(--_gap);
}
.row {
display: flex;
align-items: center;
gap: 8px;
height: var(--_row);
padding: 0 6px;
font-size: 13px;
white-space: nowrap;
overflow: hidden;
background: var(--paper);
border-radius: calc(6px * var(--round));
}
.av {
flex: none;
display: grid;
place-items: center;
width: 18px;
height: 18px;
border-radius: 50%;
font-size: 11px;
font-style: normal;
font-weight: 600;
background: var(--_m);
}
.a .av {
background: var(--_a);
}
.j .av {
background: var(--_j);
}
.row b {
flex: none;
font-weight: 600;
}
.row span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
color: var(--_muted);
}
.row .count {
flex: none;
margin-left: auto;
padding: 2px 6px;
font-style: normal;
font-size: 12px;
font-weight: 600;
color: var(--clay-d);
border-radius: calc(4px * var(--round));
}
/* Press tints live on a layer and fade, so the press animates only
transform and opacity. */
.count,
.x {
position: relative;
isolation: isolate;
}
.list .count::before,
.x::before {
content: '';
position: absolute;
inset: 0;
z-index: -1;
border-radius: inherit;
background: var(--_press);
opacity: 0;
}
.list .count {
animation: tap var(--t) infinite;
}
.list .count::before {
animation: tint-tap var(--t) infinite;
}
.x::before {
animation: tint-close var(--t) infinite;
}
/* The list row steps aside for exactly as long as the flier is up, on
the same frames, so there is only ever one of this message. */
.parent {
animation: home var(--t) infinite;
}
/* The panel covers the list rather than squeezing it: at card width a
side-by-side split leaves both columns too narrow to read. */
.panel {
position: absolute;
inset: 0;
padding: 8px 10px;
background: var(--paper);
box-shadow: -1px 0 0 var(--oat);
transform: translateX(100%);
animation: panel var(--t) infinite;
}
.bar {
display: flex;
justify-content: space-between;
align-items: center;
height: var(--_row);
padding: 0 6px;
font-size: 12px;
color: var(--_muted);
}
.bar b {
color: var(--slate);
font-weight: 600;
}
.x {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 50%;
animation: close var(--t) infinite;
}
.x svg {
width: 10px;
height: 10px;
stroke: var(--slate);
stroke-width: 1.6;
stroke-linecap: round;
}
/* The slot the parent lands in. It is empty in motion — the flier
becomes it — and only filled in reduced motion, where nothing flies. */
.slot {
opacity: 0;
}
.replies {
display: grid;
gap: var(--_gap);
padding-left: 16px;
border-top: 1px solid var(--oat);
margin-top: calc(var(--_gap) / -2);
padding-top: calc(var(--_gap) / 2);
}
.replies .row {
opacity: 0;
animation: reply var(--t) infinite;
}
.replies .row:nth-child(2) {
animation-delay: var(--_stagger);
}
.replies .row:nth-child(3) {
animation-delay: calc(2 * var(--_stagger));
}
/* One object, two homes. The parent message is the row that lifts off
the list and becomes the thread's header, then goes back to the
exact shelf it came from — so closing the thread returns the reader
to where they were, and the eye never has to find their place again. */
.flier {
position: absolute;
left: 10px;
right: 10px;
top: calc(8px + 3 * var(--_pitch));
z-index: 1;
overflow: visible;
opacity: 0;
animation: fly var(--t) infinite;
}
.flier::after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 6px 16px -6px var(--_shade);
opacity: 0;
animation: shade var(--t) var(--ease-out) infinite;
}
.flier .count {
animation: shed var(--t) infinite;
}
@keyframes tap {
0%,
14% {
transform: none;
animation-timing-function: var(--ease-out);
}
16% {
transform: scale(0.96);
animation-timing-function: var(--ease-out);
}
18%,
100% {
transform: none;
}
}
/* In: 288ms ease-out. Out: 216ms ease-out — exit faster than enter,
and the panel leaves the way it came so the direction is honest. */
@keyframes panel {
0%,
18% {
transform: translateX(100%);
animation-timing-function: var(--ease-out);
}
22%,
66% {
transform: translateX(0);
animation-timing-function: var(--ease-out);
}
69%,
100% {
transform: translateX(100%);
}
}
@keyframes close {
0%,
64% {
transform: none;
animation-timing-function: var(--ease-out);
}
65.5% {
transform: scale(0.9);
animation-timing-function: var(--ease-out);
}
67%,
100% {
transform: none;
}
}
/* Two pitches up in 317ms on ease-in-out — it is on screen the whole
way, A to B. It starts exactly over the list row, so switching it on
is invisible; switching it off at the end is invisible for the same
reason. */
@keyframes fly {
0%,
17.9% {
opacity: 0;
transform: none;
}
18% {
opacity: 1;
transform: none;
animation-timing-function: var(--ease-in-out);
}
22.4%,
66% {
opacity: 1;
transform: translateY(calc(-2 * var(--_pitch)));
animation-timing-function: var(--ease-in-out);
}
70.4% {
opacity: 1;
transform: none;
}
70.5%,
100% {
opacity: 0;
transform: none;
}
}
/* The lift is only shadowed while it is in the air: on the shelf and
in the slot it is flat paper like every other row. */
@keyframes shade {
0%,
18% {
opacity: 0;
}
20%,
21% {
opacity: 1;
}
22.4%,
66% {
opacity: 0;
}
68%,
69% {
opacity: 1;
}
70.4%,
100% {
opacity: 0;
}
}
/* The reply count is a property of the list row, not of the thread
header, so it is shed in flight and picked back up on the way home. */
@keyframes shed {
0%,
18% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
20.5%,
68% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
70.4%,
100% {
opacity: 1;
}
}
@keyframes home {
0%,
17.9% {
opacity: 1;
}
18%,
70.4% {
opacity: 0;
}
70.5%,
100% {
opacity: 1;
}
}
@keyframes tint-tap {
0%,
14% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
16% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
18%,
100% {
opacity: 0;
}
}
@keyframes tint-close {
0%,
64% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
65.5% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
67%,
100% {
opacity: 0;
}
}
@keyframes reply {
0%,
22.5% {
opacity: 0;
transform: translateY(4px);
animation-timing-function: var(--ease-out);
}
25.3%,
65.5% {
opacity: 1;
transform: none;
animation-timing-function: var(--ease-out);
}
66.5%,
100% {
opacity: 0;
transform: none;
}
}
@media (prefers-reduced-motion: reduce) {
/* Nothing travels and nothing scales. The list fades out before the
thread fades in — never both at once, or the two layers' text
ghost over each other — with the parent already in the slot.
Press tints stay. Everything, stagger included, runs 1.5x. */
:root {
--t: calc(var(--cycle) * 1.5 / var(--speed));
--_stagger: calc(72ms * 1.5 / var(--speed));
}
.flier {
display: none;
}
.slot {
opacity: 1;
}
.parent,
.list .count,
.x {
animation: none;
}
.list {
animation: list-still var(--t) infinite;
}
.panel {
transform: none;
opacity: 0;
animation-name: panel-still;
}
.replies .row {
animation-name: reply-still;
}
@keyframes list-still {
0%,
17% {
opacity: 1;
}
19.5%,
66.5% {
opacity: 0;
}
69%,
100% {
opacity: 1;
}
}
@keyframes panel-still {
0%,
19.5% {
opacity: 0;
}
22%,
64% {
opacity: 1;
}
66.5%,
100% {
opacity: 0;
}
}
@keyframes reply-still {
0%,
22.5% {
opacity: 0;
}
25.3%,
100% {
opacity: 1;
}
}
}
</style>
</head>
<body>
<div
class="card"
role="img"
aria-label="A channel where one message from Ana shows 3 replies; pressing it slides a thread panel over the list while Ana's message lifts off its row and becomes the thread's header, the replies stagger in beneath it, and on close the panel slides away and the message travels back down to its original row"
>
<div class="head"><b># launch</b><span>4 members</span></div>
<div class="view">
<div class="list" aria-hidden="true">
<div class="row m"><i class="av">M</i><b>Mei</b><span>Docs are nearly done</span></div>
<div class="row j"><i class="av">J</i><b>Joel</b><span>QA is on it today</span></div>
<div class="row m"><i class="av">M</i><b>Mei</b><span>Screens are exported</span></div>
<div class="row a parent">
<i class="av">A</i><b>Ana</b><span>Ship the beta Friday?</span
><em class="count">3 replies</em>
</div>
<div class="row j"><i class="av">J</i><b>Joel</b><span>Pricing page is live</span></div>
</div>
<div class="panel" aria-hidden="true">
<div class="bar">
<span><b>Thread</b> · # launch</span>
<i class="x"
><svg viewBox="0 0 10 10"><path d="M1.5 1.5l7 7M8.5 1.5l-7 7" /></svg
></i>
</div>
<div class="row a slot">
<i class="av">A</i><b>Ana</b><span>Ship the beta Friday?</span>
</div>
<div class="replies">
<div class="row j"><i class="av">J</i><b>Joel</b><span>If QA signs off</span></div>
<div class="row m"><i class="av">M</i><b>Mei</b><span>Docs will be ready</span></div>
<div class="row j"><i class="av">J</i><b>Joel</b><span>QA signed off</span></div>
</div>
</div>
<div class="row a flier" aria-hidden="true">
<i class="av">A</i><b>Ana</b><span>Ship the beta Friday?</span
><em class="count">3 replies</em>
</div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.