Playground

Theming

Themes, accents, fonts, corners, density and tokens.

Attributes on <html>

Look and feel is controlled by data attributes on the root element. Components never change; only token values do.

data-theme
warm (default, light), dark, midnight
data-accent
orange (default), green, blue, violet, rose, teal, amber, slate. Each pair is contrast-checked in all three themes.
data-font
mono (default), sans, serif. System stacks, nothing to download.
data-radius
square (default, --radius: 0), soft (6px), round (12px)
data-density
compact, comfortable (default), spacious. Rescales --s2 to --s7 and the small text sizes.
index.html
<html data-theme="midnight" data-accent="teal" data-font="sans" data-radius="soft" data-density="compact">

Accents, fonts, radius and density live in accents.css and options.css. Load options.css after the components. The Customise panel on this site sets exactly these attributes.

Override tokens

Every colour, size, space and timing is a CSS variable defined in tokens.css. Override them on :root, or scope them to a theme. Load your file after Monoline.

brand.css
:root {
  --font-body: "Inter", system-ui, sans-serif;
  --s4: 18px;
}

/* Brand accent, per theme. Keep the pairs readable. */
:root, [data-theme="warm"] {
  --accent: #0057FF;
  --accent-text: #0047D1;   /* accent used as text */
  --on-accent: #FFFFFF;     /* text on an accent fill */
}
[data-theme="dark"] { --accent: #5B9DFF; --accent-text: #5B9DFF; --on-accent: #07162E; }

Token groups

Colour
--background, --foreground, --muted, --border, --surface, --danger, --warning, --ok
Accent
--accent (fills, marks, focus), --accent-text (as text), --accent-2, --on-accent
Lines and washes
--rule, --wash, --wash-2, --ink-1 to --ink-5
Type
--font-display, --font-body, --text-xs to --text-lg, --display-sm, --display-md, --display-xl
Space
--s1 to --s9 (4px steps)
Shape and motion
--radius, --round, --ease, --fast, --base, --slow

The same tokens ship as W3C design-tokens JSON: @monoline/css/tokens.json. In your own CSS use tokens, not raw values, so themes keep working.