Density metrics: the control heights, hit targets, panel widths and icon
sizes HIG §9.6 fixes so two panels built by two people come out the same
size. Spacing says how far apart things sit; metrics say how big the things
are.
Motion tokens — the one shared timing + spring vocabulary the whole UI
(toolkit widgets AND shell chrome) animates against, so same-class
gestures share a feel.
The one colour scheme every syntax-highlighting surface paints with: the
code editor widget, block-editor code fences, highlighted text inputs and
any app that renders source (a code editor, a diff, a snippet preview).
Elevation, by the design language’s one rule: only floating things
cast a shadow. Window tiles, bars, cards and selected controls have
none — a tile is separated by the ground and its window edge, a
selection is a lift (crate::tokens::Intents::selection).
Tuning for direct-manipulation gestures — the numbers that decide how
a dragged surface resists, catches and coasts. Shared for the same
reason the springs are: two controls that resist differently read as
two unrelated machines.
What is drawn straight onto media (video, a camera viewfinder, a photo):
the letterbox around a frame, the fade under text that sits on the
picture, and that text. Media is dark or light regardless of the theme,
so these are the same in every theme; only the hue of the neutral
material follows it. Controls over media are a floating Panel on the
material instead, inked from the theme.
One colour per participant: PRESENCE_HUES at one OKLCH lightness and
chroma, so they differ in hue only and no participant looks more
important than another. Where sRGB cannot carry the full chroma at a hue
(a light cyan) only that hue’s chroma drops; lightness never does.
Palette used by terminal-style widgets. Exposes default fg/bg and a 16-slot
ANSI base palette. Higher-index colors (256/truecolor) are out of scope —
consumers still derive those from the 16 anchors or from their own mapping.
A tinted pill (a status badge, a presence chip), resolved against the
ground it paints on. Every field is opaque rather than a token plus
alpha — measuring the token instead of the composite is how a chip ends
up as tinted ink on a tinted wash.
A reading face the system ships, chosen by name in a theme’s type role or
by a reader in an app that sets long-form text (Books). Each is set
through the Reading role’s family, so its optical sizes, features and
script fallbacks work like the default’s.
How two neighbours relate, which decides how far apart they sit
(HIG §7b). Layout containers take one (Column::with_rhythm,
Row::with_rhythm) and resolve it against the theme they are laid out
with, so the gap follows density, ui_scale and a custom spacing scale.
A named step on the Spacing scale, for APIs that resolve a gap at
layout time from the Theme they are handed (Spacer::token) rather than
taking an unscaled pixel value from the caller.
The body size, in logical pixels at 1×, that every role is designed
against. Role sizes are body × role_px / REFERENCE_BODY_PX, so they land
on whole pixels at the stock size.