Design tokens
One source file generates the stylesheet, the typed module the components read, and the published distribution on this page. This is that file in full - every value, how it was derived, and the contrast it was checked at.
One source file generates the stylesheet, the typed module the components read, and the published distribution on this page. This is that file in full - every value, how it was derived, and the contrast it was checked at.
Following accent-text from the rule that defines it to the label it colours. Nothing in this trace is typed by hand - each step is read from the file it names when the site is built.
01 source
tokens/tokens.json
A rule, not a value. Start from the redline, blend toward ink (or paper in dark), and stop at the first step that clears the text target of 4.5:1 on the page background and on the quiet tint labels sit on.
{
"$use": "text",
"light": {
"accent-text": {
"solve": ["color.redline", "color.ink", ["bg", "accent-quiet"], "text"]
}
},
"dark": {
"accent-text": {
"solve": ["color.redline", "color.paper", ["bg", "accent-quiet"], "text"]
}
}
}02 build
scripts/build-tokens.mjs → public/tokens.json
The build solves the rule and publishes the answer with its working: where the value came from, and the ratio at its worst pairing. Here that is 4.52:1 on accent-quiet. Below the target, the build fails.
{
"light": {
"accent-text": {
"value": "#C70472",
"use": "text",
"origin": "solve(redline -> ink, text on bg + accent-quiet)",
"kind": "solved",
"contrast": 4.52,
"contrastAgainst": "accent-quiet",
"required": 4.5
}
},
"dark": {
"accent-text": {
"value": "#EA4AA3",
"use": "text",
"origin": "solve(redline -> paper, text on bg + accent-quiet)",
"kind": "solved",
"contrast": 4.53,
"contrastAgainst": "accent-quiet",
"required": 4.5
}
}
}03 stylesheet
app/tokens.css
The same build writes one custom property per scheme. Components never see a hex value, only the role.
:root, [data-theme='light'] {
--c-accent-text: #C70472;
}
[data-theme='dark'] {
--c-accent-text: #EA4AA3;
}04 component
styles/annotations.css
The active state label asks for the role by name, on the tint it was solved against.
.state-label[data-active="true"] {
color: var(--c-accent-text);
border-color: color-mix(in srgb, var(--c-accent) 45%, transparent);
background: var(--c-accent-quiet);
}05 rendered
components/annotation · components/ui/tag
Live components, not pictures of them. Switch the theme in the header and the value underneath changes; the components do not.
Everything the build publishes, exactly as served at /tokens.json: six primitives, 15 roles per scheme (4 of them solved for contrast), and the space, type, grid, border and motion scales. Hex values carry a swatch.
{
"$name": "mariomos design tokens",
"$version": "1.0.0",
"$description": "Single source of truth for the mariomos.com design system. This file is the input; app/tokens.css and public/tokens.json are generated from it by scripts/build-tokens.mjs. Nothing in the site hard-codes a value that lives here.",
"$generated": "Built from tokens/tokens.json by scripts/build-tokens.mjs. Derived colours are computed and contrast-solved, never hand-picked.",
"$generatedAt": "2026-10-23",
"$a11y": {
"$note": "Contrast targets, as ratios. Tokens declared with `solve` are generated by blending the base toward a direction until they meet the target against the named background - so an accessible value is computed, not eyeballed, and it is re-checked on every build.",
"text": 4.5,
"large-text": 3,
"non-text": 3
},
"color": {
"ink": {
"value": "#101A2B",
"role": "Deep navy. Text and dark surfaces. Not a tinted black - it reads as drafting ink."
},
"paper": {
"value": "#F7F8FA",
"role": "Cool white ground. Deliberately not cream."
},
"redline": {
"value": "#E5007D",
"role": "Magenta. Annotations, measurement marks, active states. The signal colour."
},
"measure": {
"value": "#00A3C4",
"role": "Cyan. Secondary annotation - dimensions, grid overlays."
},
"rule": {
"value": "#C9CFD8",
"role": "Hairlines, dividers, inactive marks."
},
"slate": {
"value": "#5A6675",
"role": "Secondary text, captions."
}
},
"semantic": {
"light": {
"bg": {
"value": "#F7F8FA",
"use": "surface",
"origin": "paper",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"bg-raised": {
"value": "#F0F1F4",
"use": "surface",
"origin": "mix(paper, ink, 0.03)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"bg-sunken": {
"value": "#E9EBEE",
"use": "surface",
"origin": "mix(paper, ink, 0.06)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"text": {
"value": "#101A2B",
"use": "text",
"origin": "ink",
"kind": "alias",
"contrast": 16.4,
"contrastAgainst": "bg",
"required": 4.5
},
"text-muted": {
"value": "#5A6675",
"use": "text",
"origin": "slate",
"kind": "alias",
"contrast": 5.5,
"contrastAgainst": "bg",
"required": 4.5
},
"text-invert": {
"value": "#F7F8FA",
"use": "inverse",
"origin": "paper",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"line": {
"value": "#C9CFD8",
"use": "surface",
"origin": "rule",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"line-strong": {
"value": "#88909B",
"use": "line",
"origin": "solve(rule -> ink, non-text on bg)",
"kind": "solved",
"contrast": 3.04,
"contrastAgainst": "bg",
"required": 3
},
"accent": {
"value": "#E5007D",
"use": "mark",
"origin": "redline",
"kind": "alias",
"contrast": 4.27,
"contrastAgainst": "bg",
"required": 3
},
"accent-strong": {
"value": "#DC017A",
"use": "fill",
"origin": "solve(redline -> ink, text under paper)",
"kind": "solved",
"contrast": 4.57,
"contrastAgainst": "paper",
"required": 4.5
},
"accent-quiet": {
"value": "#F5DFEE",
"use": "surface",
"origin": "mix(redline, paper, 0.9)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"accent-text": {
"value": "#C70472",
"use": "text",
"origin": "solve(redline -> ink, text on bg + accent-quiet)",
"kind": "solved",
"contrast": 4.52,
"contrastAgainst": "accent-quiet",
"required": 4.5
},
"measure": {
"value": "#00A3C4",
"use": "surface",
"origin": "measure",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"measure-text": {
"value": "#06738E",
"use": "text",
"origin": "solve(measure -> ink, text on bg + measure-quiet)",
"kind": "solved",
"contrast": 4.54,
"contrastAgainst": "measure-quiet",
"required": 4.5
},
"measure-quiet": {
"value": "#D9EEF4",
"use": "surface",
"origin": "mix(measure, paper, 0.88)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
}
},
"dark": {
"bg": {
"value": "#101A2B",
"use": "surface",
"origin": "ink",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"bg-raised": {
"value": "#1E2737",
"use": "surface",
"origin": "mix(ink, paper, 0.06)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"bg-sunken": {
"value": "#151E2F",
"use": "surface",
"origin": "mix(ink, paper, 0.02)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"text": {
"value": "#F7F8FA",
"use": "text",
"origin": "paper",
"kind": "alias",
"contrast": 16.4,
"contrastAgainst": "bg",
"required": 4.5
},
"text-muted": {
"value": "#969BA3",
"use": "text",
"origin": "mix(paper, ink, 0.42)",
"kind": "mix",
"contrast": 6.24,
"contrastAgainst": "bg",
"required": 4.5
},
"text-invert": {
"value": "#101A2B",
"use": "inverse",
"origin": "ink",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"line": {
"value": "#3A4250",
"use": "surface",
"origin": "mix(ink, paper, 0.18)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"line-strong": {
"value": "#616873",
"use": "line",
"origin": "solve(ink -> paper, non-text on bg)",
"kind": "solved",
"contrast": 3.1,
"contrastAgainst": "bg",
"required": 3
},
"accent": {
"value": "#E5007D",
"use": "mark",
"origin": "redline",
"kind": "alias",
"contrast": 3.84,
"contrastAgainst": "bg",
"required": 3
},
"accent-strong": {
"value": "#DC017A",
"use": "fill",
"origin": "solve(redline -> ink, text under paper)",
"kind": "solved",
"contrast": 4.57,
"contrastAgainst": "paper",
"required": 4.5
},
"accent-quiet": {
"value": "#36153A",
"use": "surface",
"origin": "mix(redline, ink, 0.82)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"accent-text": {
"value": "#EA4AA3",
"use": "text",
"origin": "solve(redline -> paper, text on bg + accent-quiet)",
"kind": "solved",
"contrast": 4.53,
"contrastAgainst": "accent-quiet",
"required": 4.5
},
"measure": {
"value": "#00A3C4",
"use": "surface",
"origin": "measure",
"kind": "alias",
"contrast": null,
"contrastAgainst": null,
"required": null
},
"measure-text": {
"value": "#0CA7C7",
"use": "text",
"origin": "solve(measure -> paper, text on bg + measure-quiet)",
"kind": "solved",
"contrast": 4.53,
"contrastAgainst": "measure-quiet",
"required": 4.5
},
"measure-quiet": {
"value": "#0D354A",
"use": "surface",
"origin": "mix(measure, ink, 0.8)",
"kind": "mix",
"contrast": null,
"contrastAgainst": null,
"required": null
}
}
},
"space": {
"1": 4,
"2": 8,
"3": 12,
"4": 16,
"6": 24,
"8": 32,
"12": 48,
"16": 64,
"24": 96,
"32": 128,
"40": 160,
"$base": 4,
"$unit": "px",
"$note": "space-N is N x 4px. The scale is sparse on purpose - only these steps are legal."
},
"type": {
"$ratio": 1.25,
"$base": 16,
"$note": "Minor third from 16px. Nine steps, no improvisation between them.",
"size": {
"0": 12,
"1": 14,
"2": 16,
"3": 20,
"4": 25,
"5": 31,
"6": 39,
"7": 49,
"8": 61
},
"leading": {
"display": 1.1,
"body": 1.6,
"tight": 1.3
},
"measure": {
"$note": "Body copy is capped at 68 characters. Left-aligned, never centred.",
"value": "68ch"
},
"family": {
"display": "Bricolage Grotesque",
"body": "IBM Plex Sans",
"mono": "IBM Plex Mono"
},
"width": {
"$note": "Bricolage Grotesque wdth axis. Headlines compress as the viewport narrows.",
"compressed": 78,
"narrow": 88,
"normal": 100
}
},
"grid": {
"columns": 12,
"content-start": 3,
"content-end": 10,
"$note": "Content occupies columns 3-10. Columns 1-2 are the annotation margin; 11-12 are trailing air.",
"gutter": 24,
"max-width": 1280
},
"border": {
"hairline": 1,
"mark": 1.5,
"radius": {
"$note": "Near-square. sm for labels, tags and panels; md for controls a person presses or types into, rounded just enough to read as interactive. Nothing on this site is a soft rounded card.",
"none": 0,
"sm": 2,
"md": 4
}
},
"motion": {
"$note": "One orchestrated moment on load, then motion only answers actions.",
"duration": {
"instant": 90,
"fast": 160,
"medium": 280,
"draw": 2000
},
"easing": {
"standard": "cubic-bezier(0.2, 0, 0, 1)",
"draw": "cubic-bezier(0.16, 1, 0.3, 1)"
}
}
}