These rules are for AI coding agents and for humans. Follow them whenever you create or
change a page, component or chart that uses this kit. They are short on purpose: when in
doubt, copy a pattern from examples/ instead of inventing a new one.
css/tokens.css, css/base.css, css/components.css.ital@0;1) and Inter (wght@400;500;600;700).js/theme.js in <head> without defer (theme switch, mobile sidebar);
icons/icons.js with defer when you use <use href="#i-…"> icons.<html lang="en">, <meta name="viewport" content="width=device-width, initial-scale=1">
and <meta name="color-scheme" content="light dark">.var(--ink-2), var(--card), var(--line),
never #5D5A54 or rgba(…) in page code. The only exception is #fff on --solid or
--coral, as the kit itself does.--ink (primary), --ink-2 (secondary), --ink-3
(meta, labels). --ink-4 is for placeholders, disabled items and decoration only, never
for text people must read.--c (.pill, .notice,
.card.tinted, .chip, .avatar, .icon-badge, .span-bar, .progress) and set the
accent with .c-green etc. or style="--c: var(--green)". One solid fill per screen:
the primary action (.btn.primary).h1–h5, .display, .h1–.h5, .topbar .title) use the serif display face
at regular weight. Never bold the serif and never use it for body text, buttons or numbers.<em>; it becomes italic coral automatically.
Do not colour headings any other way..label (uppercase, letter-spaced, --ink-3); a label above a hero title
is a .kicker..prose (16 px). Numbers in columns use .num (tabular figures)..card (white, hairline border, soft shadow). Use .card.flat inside other
cards, .panel for recessed tool areas, .note (dashed) for hints and “coming later”..app > .side + .content; inside the content a .topbar and either plain
.sections or a .view with .view-main and .view-pane. Websites: .site-bar,
.container, .hero, .prose, .card-grid, .site-footer.--radius*, --line*, --shadow-*, --fs-*) so it matches and supports dark mode.--line or --line-2) and shadows from the tokens. No heavy
outlines, gradients on controls, or drop shadows of your own.filter: invert.?theme=dark and ?theme=light in the URL (needs js/theme.js) or with the
system setting. To show both at once, set data-theme="dark" on a container..scroll-x / .table-wrap so only
that block scrolls.min-width: 0 to flex and grid
children that hold long text..mobile-bar, .scrim,
data-sidebar-open / data-sidebar-close).aria-label;
decorative icons aria-hidden="true". Use real <button> and <a> elements.--ink-3 is below 4.5:1 for small text in the light theme (see README, Accessibility).
Do not put essential information only in --ink-3; if AA is required, apply the overrides
listed in the README.These rules are mandatory for every chart, graph, plot or other data visualisation.
https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js (with its integrity hash).
No other chart libraries (no Chart.js, ECharts, Highcharts, Plotly, Vega, Recharts …), no
chart images (PNG/JPG/static SVG exports). Small inline meters such as .progress and
.stat tiles are components, not charts, and may be used without D3.js/chart-theme.js:
ChartTheme.read(container) returns the current token values via getComputedStyle, and
ChartTheme.observe(container, render) re-renders on theme change and resize, so dark mode
works. Series colours are t.series[0..3] (--chart-1 … --chart-4) in that fixed order;
never cycle them, fold a fifth series into t.other or use small multiples. Status meaning
(good/bad) uses t.good / t.bad, never a series colour.--line-2 / --line
(ChartTheme.styleAxis). Tick and axis labels are --ink-3, sans, 10.5 px. Chart titles
use the serif (.chart-title, one <em> accent allowed). Values and labels use ink
tokens, never the series colour. Marks: columns at most 24 px wide with a 4 px rounded end
(ChartTheme.columnPath), lines 2 px, end dots r = 4 with a 2 px ring in the surface colour..legend); label selectively (the end
or the extreme, not every point); add a hover tooltip (ChartTheme.tooltip) and a table
view (details.chart-table); give the chart container role="img" and an aria-label
that states the main finding.See examples/charts.html for a column chart, a multi-series line chart and small multiples
that follow all of the above.
<em> per heading.