Legible — over the limit, said three ways
Variant: Over the limit
A storage meter that crosses its plan limit and says so in words, shape and texture before colour. Usage arrives in three eased bursts — 52, 71 and 93 of 80 GB — and every readout is derived from that one animated number: the header, the "GB left" count, and the overage are registered integers computed from the fill and rounded by the browser each frame, so the text cannot disagree with the bar for even a frame. On the frame the fill passes the limit tick, the status cuts from "GB left" to "GB over limit" beside a border-drawn warning triangle, and the fill beyond the tick turns to rust stripes — both layers are clipped by the same number, so the stripe can only begin where the solid ends. Rust is the third signal, never the first or the only: a red bar alone tells a colour-blind reader nothing. The fill keeps a square leading edge on purpose, because a value lives at one x and a rounded cap would smear it across its radius. Under reduced motion the bursts step instead of easing, on a slower clock, and the cut still follows the number. Use it for soft quotas — storage, seats, spend — where going over is allowed but has to be impossible to miss.
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>Legible — over the limit, said three ways</title>
<style>
@property --_v {
syntax: '<number>';
inherits: true;
initial-value: 0;
}
@property --_n {
syntax: '<integer>';
inherits: true;
initial-value: 0;
}
@property --_left {
syntax: '<integer>';
inherits: true;
initial-value: 80;
}
@property --_over {
syntax: '<integer>';
inherits: true;
initial-value: 0;
}
: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)
);
--_muted: color-mix(in srgb, var(--slate) 62%, transparent);
--_track: color-mix(in srgb, var(--oat) 70%, var(--paper));
--_stripe: color-mix(in srgb, var(--rust) 22%, var(--paper));
/* Clock — 6.4s: two bursts under the limit, one that crosses it, and
a long hold on the verdict. */
--cycle: 6.4s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* {
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(296px, 86vw);
padding: 16px 18px 14px;
border-radius: calc(14px * var(--round));
background: var(--paper);
border: 1px solid var(--oat);
display: grid;
gap: 10px;
animation:
fill var(--t) infinite,
frame var(--t) infinite;
}
.head {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 8px;
}
.label {
font-size: clamp(11px, 3.4vw, 12px);
font-weight: 600;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--_muted);
}
.read {
font-size: 13px;
color: var(--_muted);
font-variant-numeric: tabular-nums;
}
.num {
font-size: 20px;
font-weight: 600;
color: var(--slate);
--_n: calc(var(--_v));
counter-reset: n var(--_n);
}
.num::after {
content: counter(n);
}
.meter {
position: relative;
padding: 4px 0 18px;
}
.track {
position: relative;
height: 14px;
border-radius: 999px;
overflow: hidden;
background: var(--_track);
}
/* Square leading edge on purpose: a value lives at one x, and a round
end would smear it across the cap's radius. Both layers are clipped
by the same number, so the stripe can only begin where the solid
ends. */
.under,
.past {
position: absolute;
inset: 0;
}
.under {
background: var(--clay);
clip-path: inset(0 calc(100% - min(var(--_v), 80) * 1%) 0 0);
}
/* Past the limit the fill changes texture, not just tone — the stripe
is what a greyscale screenshot or a deuteranope still sees. */
.past {
background: repeating-linear-gradient(135deg, var(--rust) 0 3px, var(--_stripe) 3px 6px);
clip-path: inset(0 calc(100% - max(var(--_v), 80) * 1%) 0 80%);
}
.limit {
position: absolute;
left: 80%;
top: 0;
width: 2px;
height: 22px;
margin-left: -1px;
background: var(--slate);
}
.limit-name {
position: absolute;
left: 80%;
bottom: 0;
transform: translateX(-50%);
font-size: 11.5px;
font-weight: 600;
color: var(--_muted);
white-space: nowrap;
}
/* The verdict is words. The colour arrives with them, as the third of
three signals, never the first or the only. */
.status {
display: grid;
font-size: 13px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.status > span {
grid-area: 1 / 1;
display: flex;
align-items: center;
gap: 6px;
}
/* Every readout is derived from the one animated number, so the text
cannot disagree with the bar: "left" and "over" are registered
integers computed from --_v and rounded by the browser each frame,
and the swap between the two lines is a cut on the exact frame the
fill passes the limit — not a fade on its own schedule. */
.status {
--_left: max(calc(80 - var(--_v)), 0);
--_over: max(calc(var(--_v) - 80), 0);
--_past: clamp(0, calc((var(--_v) - 80.5) * 1000), 1);
}
.s-left {
color: var(--_muted);
counter-reset: l var(--_left);
opacity: calc(1 - var(--_past));
}
.s-left b::before {
content: counter(l);
}
.s-over {
color: var(--rust);
counter-reset: o var(--_over);
opacity: var(--_past);
}
.s-over b::before {
content: counter(o);
}
.s-left b,
.s-over b {
font-weight: 600;
}
/* A triangle, drawn from borders so it has no font metrics. Shape is
a signal a colour filter cannot remove. */
.warn {
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 10px solid currentColor;
}
@keyframes fill {
0%,
6% {
--_v: 0;
animation-timing-function: var(--ease-out);
}
14%,
30% {
--_v: 52;
animation-timing-function: var(--ease-out);
}
36%,
50% {
--_v: 71;
animation-timing-function: var(--ease-out);
}
58%,
95% {
--_v: 93;
}
96%,
100% {
--_v: 0;
}
}
@keyframes frame {
0% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
4%,
88% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
92%,
100% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
/* The bursts step instead of easing, on a clock 1.6× slower; the
readouts and the over-limit cut follow the same number, so every
signal still arrives together. */
.card {
animation:
fill-rm calc(var(--t) * 1.6) steps(1, end) infinite,
frame calc(var(--t) * 1.6) infinite;
}
@keyframes fill-rm {
0% {
--_v: 0;
}
6% {
--_v: 52;
}
30% {
--_v: 71;
}
50% {
--_v: 93;
}
96%,
100% {
--_v: 0;
}
}
}
</style>
</head>
<body>
<div
class="card"
role="img"
aria-label="Storage meter, 80 gigabyte limit. Usage climbs to 52, then 71, then 93 gigabytes. Past the limit the fill turns to rust stripes and the status reads 13 GB over limit beside a warning triangle."
>
<div class="head">
<span class="label">Storage</span>
<span class="read"><span class="num"></span> of 80 GB</span>
</div>
<div class="meter" aria-hidden="true">
<div class="track">
<div class="under"></div>
<div class="past"></div>
</div>
<div class="limit"></div>
<span class="limit-name">Limit</span>
</div>
<div class="status" aria-hidden="true">
<span class="s-left"
><span><b></b> GB left</span></span
>
<span class="s-over"
><i class="warn"></i><span><b></b> GB over limit</span></span
>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.