src/render/theme.ts. Light and dark follow the viewer’s system setting; ?theme=light or ?theme=dark on a page forces one.
Series colours
Series take eight categorical slots, c1 to c8, in a fixed order, and wrap after the eighth. Each slot has two colours:- Stroke (
data.<mode>.categorical) paints lines, points, line legend keys and series-coloured text. - Fill (
data.<mode>.categoricalFill) paints bars, stacked and 100% segments, areas, pie and donut slices, and square legend keys.
checks.<mode> in the tokens file records the measured numbers, and test/render/tokens.test.ts recomputes them.
Series groups
A group of related series (see Series groups) takes one of three hue families, in this order: blue (slots 1 and 5), pink and red (slots 2, 6 and 8), and green (slot 4). Each family has three lightness steps as strokes and fills, in light and dark (data.groups), and
step 1 stays close to the family’s base slot colour, moving only so that steps 2 and 3 always recede
(checks.<mode>.groupCVD.leadVsBase records how far). Slot 3 (cyan) and slot 7 (warm grey) host no group: cyan
cannot step in lightness without running into the blues, and grey steps would read as context.
While a group holds a family, ungrouped series skip its slots.
Every step is at least 3:1 against the card; every pair of steps in a family is at least ΔE2000 10
apart, and every step is at least 8 from the other families, from the ungrouped slots outside its
family and from the context grey, under normal vision and deuteranopia, protanopia and tritanopia
simulation. checks.<mode>.groupContrastVsCard and checks.<mode>.groupCVD record the measured
numbers, and test/render/tokens.test.ts recomputes them.
Categorical colours are adapted from the FT’s g-chartcolour.
Block heights
blockHeight in the tokens file sets what each height preset means, separately for desktop
(layouts 600 px and wider) and phone. default is the height every block had before presets.
The values keep every chart legible at each preset: a compact plot still has three value ticks and
room for its key and tooltip, a pie’s largest diameter follows the preset (on phones the card’s width caps it first), and
a KPI sparkline keeps about three quarters of its figure’s line height. A 22 px horizontal bar row
still fits its bar and a one-line name; names that wrap keep a two-line row at every preset. A tall table on a phone
stops at 18.5 rows so its scroll area never fills the screen.