Tokens
Every colour, type, spacing, size, radius, motion and layer token with its real value, per theme and accent.
Using tokens
Every token is a CSS custom property on :root. Use var(--s4) instead of a number, and a theme or option changes it everywhere. The same values ship as W3C JSON at @monoline/css/tokens.json and as Figma variables in @monoline/tokens. See Theming for how to override them.
.card {
padding: var(--s4);
border: 1px solid var(--rule);
color: var(--foreground);
}Colour
Three themes. Switch with data-theme on the html element; the accent comes from data-accent.
| Token | warm | dark | midnight |
|---|---|---|---|
--background | #FAFAF5 | #111110 | #060B1A |
--foreground | #16120E | #F0EDE7 | #DDE3F5 |
--muted | #706B65 | #8C8279 | #7680A5 |
--border | #E6E1D9 | #242220 | #0F1630 |
--surface | #16120E | #09090A | #02050F |
--surface-text | rgba(250, 250, 245, 0.85) | rgba(240, 237, 231, 0.85) | rgba(221, 227, 245, 0.85) |
--accent | #FF4500 | #FF4500 | #AAFF00 |
--accent-text | #D13900 | #FF4500 | #AAFF00 |
--accent-2 | #AAFF00 | #AAFF00 | #00E5FF |
--on-accent | #16120E | #111110 | #060B1A |
--danger | #B3261E | #F0847A | #FF8A80 |
--warning | #8A5300 | #E0A23A | #FFC857 |
--ok | #1F6B3A | #6FCF8E | #7CE0A3 |
Lines, washes and ink
Derived from the text colour, so they follow every theme. Use --rule for dividers, --wash for hover and code backgrounds, and --ink-2 to --ink-5 for lighter text and fills.
| Token | Value |
|---|---|
--rule | color-mix(in srgb, var(--foreground) 20%, transparent) |
--wash | color-mix(in srgb, var(--foreground) 4%, transparent) |
--wash-2 | color-mix(in srgb, var(--foreground) 9%, transparent) |
--ink-1 | var(--foreground) |
--ink-2 | color-mix(in srgb, var(--foreground) 70%, transparent) |
--ink-3 | color-mix(in srgb, var(--foreground) 45%, transparent) |
--ink-4 | color-mix(in srgb, var(--foreground) 25%, transparent) |
--ink-5 | color-mix(in srgb, var(--foreground) 10%, transparent) |
--hatch | repeating-linear-gradient(135deg, var(--muted) 0 1.5px, transparent 1.5px 7px) |
Accent presets
data-accent | warm: accent, accent-text | dark: accent, accent-text | midnight: accent, accent-text |
|---|---|---|---|
orange | #FF4500 | #FF4500 | #AAFF00 |
green | #0E7A5F | #45C29C | #5FD6B2 |
blue | #2563EB | #5B9DFF | #6FB1FF |
violet | #7C3AED | #A78BFA | #B49CFF |
rose | #E11D48 | #FB7185 | #FDA4AF |
teal | #0F766E | #2DD4BF | #5EEAD4 |
amber | #B45309 | #FBBF24 | #FCD34D |
slate | #334155 | #CBD5E1 | #E2E8F0 |
Typography
| Token | Value | Sample |
|---|---|---|
--font-display | "Space Mono", ui-monospace, monospace | The quick brown fox |
--font-body | "DM Mono", ui-monospace, monospace | The quick brown fox |
--text-xs | 11px | The quick brown fox |
--text-sm | 13px | The quick brown fox |
--text-base | 15px | The quick brown fox |
--text-lg | 18px | The quick brown fox |
--display-sm | clamp(28px, 3.4vw, 40px) | |
--display-md | clamp(34px, 5vw, 64px) | |
--display-xl | clamp(44px, 8vw, 104px) | |
--weight-regular | 400 | |
--weight-medium | 500 | |
--weight-bold | 700 | |
--leading-tight | 1.2 | |
--leading-normal | 1.55 | |
--leading-relaxed | 1.6 | |
--heading-1 | clamp(32px, 4vw, 44px) | The quick brown fox |
--heading-2 | clamp(26px, 3vw, 34px) | The quick brown fox |
Set data-font to mono, sans or serif to swap the font tokens. Font weights are not tokens yet; components use 400, 500 and 700.
Spacing
A 4px scale. data-density (compact, comfortable, spacious) rescales --s2 to --s7 and the base text size.
| Token | Value | Size |
|---|---|---|
--s1 | 4px | |
--s2 | 8px | |
--s3 | 12px | |
--s4 | 16px | |
--s5 | 24px | |
--s6 | 32px | |
--s7 | 48px | |
--s8 | 64px | |
--s9 | 96px |
Sizes and layout
Control heights keep Button, Input and Select the same height at each size. The layout tokens set the sidebar, line length and widest column.
| Token | Value |
|---|---|
--control-sm | calc(var(--s6) + var(--s1)) |
--control-md | var(--s7) |
--control-lg | calc(var(--s7) + var(--s2)) |
| Token | Value |
|---|---|
--side | 264px |
--measure | 64ch |
--content | 1080px |
--container-sm | 640px |
--container-md | 768px |
--container-lg | 1024px |
--container-xl | 1280px |
--container-2xl | 1536px |
--bp-xs | 480px |
--bp-sm | 640px |
--bp-md | 768px |
--bp-lg | 1024px |
--bp-xl | 1280px |
--bp-2xl | 1536px |
--window-pad | var(--s6) |
Radius
Square by default. data-radius="soft" sets --radius to 6px and "round" to 12px. --round is for pills and dots.
| Token | Value | Shape |
|---|---|---|
--radius | 0 | |
--round | 999px | |
--radius-sm | calc(var(--radius) * 0.5) | |
--radius-md | var(--radius) | |
--radius-lg | calc(var(--radius) * 1.5) |
Motion and layers
Animations are turned off for people who ask the system for reduced motion.
| Token | Value |
|---|---|
--ease | cubic-bezier(0.76, 0, 0.24, 1) |
--fast | 0.12s |
--base | 0.2s |
--slow | 0.45s |
| Token | Value |
|---|---|
--z-drawer | 40 |
--z-grain | 50 |
--z-toast | 60 |
Not tokens yet
Said plainly, so you do not look for them: the kit has no breakpoint, font-weight, size-scale, shadow or border-width tokens. Breakpoints in the stylesheets are fixed values, and the docs site uses 560, 880 and 1100 pixels. The useMediaQuery hook takes any query. These are on the roadmap.
- Breakpoints: a standard set, as custom properties and a documented list.
- Font weights and line heights.
- Sizes for widths and heights beyond the control heights.
- A radius scale (small, medium, large) instead of one value.
- Shadows for popovers and toasts, and a focus-ring token.