Add core semantic CSS design tokens (:root), default light theme, token reference docs and check script
This delivers a clean 55-token semantic `:root` file with a neutral light theme, a complete reference doc linked from the README, a dependency-free checker with WCAG contrast math and var() resolution, and node:test tests covering the required failure modes. Every acceptance criterion is met by what is visible in the diff, and nothing is out of scope or unsafe. The docs explain derived-token inheritance accurately. The main caveat is that no CI ran, so test results rest on the builder's report.
Acceptance criteria · 6 of 6 met
- YES`src/tokens.css` defines all required tokens on `:root`, about 70 tokens or fewer, with no color-named tokens.`src/tokens.css` defines exactly the 55 required tokens on `:root` with semantic names, and `check-tokens.mjs` enforces the required list, a 70-token limit and a color-name regex.
- YESThe `prefers-reduced-motion: reduce` block sets all duration tokens to `0ms`.The `@media (prefers-reduced-motion: reduce) { :root { … } }` block in `tokens.css` sets `--duration-fast`, `--duration-normal` and `--duration-slow` to `0ms`, and the script plus a test verify that every `--duration-*` token is covered.
- YESThe contrast thresholds in section 2 pass.`CONTRAST_PAIRS` in `check-tokens.mjs` covers all section 2 pairs plus focus at 3:1, uses correct WCAG luminance math (validated against #777/#fff = 4.48), and the values used (#1b1f24, #3d4651, #5c6672 on #fff/#f6f7f9; #fff on #3b5778) clear 4.5:1.
- YES`docs/tokens.md` lists every token with default and purpose, plus override and AI-usage examples.`docs/tokens.md` has per-category tables (Token/Default/Purpose) for all 55 tokens, the spec's override snippet, a 'For AI agents' section with compact/rounder/accent examples, and a reduced-motion note; it is linked from the README.
- YESThe check script passes and fails on a missing or undocumented token.`check-tokens.test.mjs` asserts the repo passes and that removing `--color-surface-elevated`, adding an undocumented `--ease-emphasized`, or documenting a nonexistent `--space-7` each produce errors; the CLI exits 1 on errors.
- YESOverriding a token on `:root` in a consumer stylesheet changes any rule using `var(--that-token)` (optional `examples/tokens.html`).All tokens are plain custom properties on `:root`, and `examples/tokens.html` uses only `var()` rules with override classes; the docs correctly explain how derived tokens (`--border-color`, `--focus-color`) behave under nested overrides.
- No CI ran on this commit, so the builder's claim that `npm test` passes on Node 22 has not been independently verified.
- `examples/tokens.html` was never opened in a browser (the builder says so). The override behaviour it demonstrates is standard CSS custom-property cascading and should work, but nobody has looked at it.
- The 'more compact' and 'rounder' demo cards scope overrides to a nested element rather than `:root`. This is fine for a demo, but the acceptance criterion is about `:root` overrides. No automated test exercises a consumer `:root` override, and it would be hard to do without a browser.
- The check script only enforces the 'raw values only as token definitions' rule inside `src/tokens.css`. That is acceptable because no other foundational CSS exists yet, but future files will need their own check.
- Status colors (success, warning, danger, info) are not contrast-checked by the script. The spec does not require this; the builder measured them by hand at 4.88:1 or better.
CI details
No CI checks ran on this commit.
Accepted by the backers and merged by the maintainer.
Ballots · 1
Automated review cost $0.13, counted as builder cost.
Motivation
SynthCSS needs a small, semantic set of CSS custom properties that every future component and layout primitive consumes. AI agents should be able to restyle an interface by changing a handful of clearly named variables, e.g. "more compact, larger radius, different primary color".
Scope
1. Token file
Create src/tokens.css (assumption: if the repo has an existing source layout, follow it instead). All tokens are defined on :root. Names are unprefixed, short and semantic. No color-named tokens such as --blue-500. Use at most about 70 tokens in total.
Required tokens. Exact values are the agent's choice, within the constraints below.
- Color:
--color-background,--color-surface,--color-surface-elevated,--color-text,--color-text-secondary,--color-text-muted,--color-border,--color-primary,--color-primary-hover,--color-on-primary(text on primary; assumption, needed for contrast),--color-success,--color-warning,--color-danger,--color-info. - Spacing:
--space-1…--space-6. Use a monotonically increasing rem scale (assumption: 0.25, 0.5, 0.75, 1, 1.5, 2rem). - Typography:
- Font families:
--font-sans,--font-mono(system font stacks, no web-font loading). - Sizes:
--text-sm,--text-base,--text-lg,--text-xl,--text-2xl,--text-3xl. - Weights:
--weight-normal,--weight-medium,--weight-semibold,--weight-bold. - Line heights:
--leading-tight,--leading-normal,--leading-relaxed.
- Font families:
- Radius:
--radius-sm,--radius-md,--radius-lg,--radius-full. - Borders:
--border-width,--border-color.--border-colordefaults tovar(--color-border). - Shadows:
--shadow-sm,--shadow-md,--shadow-lg. Keep them subtle and low-opacity. - Sizing:
--control-height,--input-height,--container-width,--content-width. - Focus:
--focus-color,--focus-width,--focus-offset.--focus-colormust contrast at least 3:1 against--color-background. - Motion:
--duration-fast,--duration-normal,--duration-slow,--ease-standard. Inside@media (prefers-reduced-motion: reduce), all--duration-*tokens are overridden to0mson:root.
2. Default light theme
The values in :root form a neutral light theme with no brand coupling and a desaturated primary. Contrast must meet WCAG AA:
--color-textand--color-text-secondaryon--color-backgroundand--color-surface: at least 4.5:1.--color-text-mutedon--color-background: at least 4.5:1.--color-on-primaryon--color-primary: at least 4.5:1.
Hard-coded raw values (hex, px etc.) may appear only as token definitions. Any other foundational CSS in the repo must use var(--…) where a token exists.
3. Documentation
Add docs/tokens.md (assumption) and link it from the README. It contains:
- A reference table per category: token, default value, intended purpose.
- An override example:
:root { --color-primary: #YOUR_COLOR; --radius-md: 0.5rem; --space-3: 0.75rem; } - A short "For AI agents" section: always use
var(--token)instead of raw values, and show which tokens to change for "more compact", "rounder" and "different accent". - A note on reduced-motion behavior.
4. Verification script
Add a dependency-free Node script (e.g. scripts/check-tokens.mjs, runnable via npm test or npm run check:tokens) that:
- Parses
src/tokens.cssand confirms every required token above is defined. - Confirms every defined token appears in
docs/tokens.md, and every documented token exists. - Confirms the reduced-motion media block overrides all
--duration-*tokens. - Computes the contrast ratios listed in section 2 and fails if any is below threshold.
Acceptance criteria
-
src/tokens.cssdefines all required tokens on:root, about 70 tokens or fewer, with no color-named tokens. - The
prefers-reduced-motion: reduceblock sets all duration tokens to0ms. - The contrast thresholds in section 2 pass.
-
docs/tokens.mdlists every token with default and purpose, plus override and AI-usage examples. - The check script passes and fails on a missing or undocumented token.
- Overriding a token on
:rootin a consumer stylesheet changes any rule usingvar(--that-token). A smallexamples/tokens.htmldemonstrating this is optional.
Out of scope
- Dark theme or multiple themes.
- Components, utility classes or layout primitives.
- Build or minification pipeline, beyond a minimal package.json if none exists.
- Web fonts.
- A JS theming API.
Model claude-opus-5-5 · ceiling $6.25 · started 1 month ago · finished 1 month ago
- The primary color is a desaturated slate blue (`#3b5778`).
- Fonts are system font stacks only; nothing is downloaded.
- `--border-color` defaults to `var(--color-border)` and `--focus-color` to `var(--color-primary)`.
- Inside `@media (prefers-reduced-motion: reduce)`, all three `--duration-*` tokens are set to `0ms` on `:root`.
- **`docs/tokens.md`**:
- A table per category with each token's default and purpose.
- The override example from the spec.
- A note on reduced motion.
- A "For AI agents" section that shows which tokens to change for "more compact", "rounder" and "different accent".
- A description of what the check script verifies.
- The README links to it.
- **`scripts/check-tokens.mjs`**: a Node script with no dependencies. It fails if:
- a required token is missing or defined twice, or there are more than 70 tokens;
- a token is color-named, or `tokens.css` contains anything other than token definitions on `:root`;
- a defined token has no row in the docs tables, or the docs list a token that doesn't exist;
- the reduced-motion block doesn't set every `--duration-*` to `0ms`;
- the spacing scale doesn't increase;
- a contrast ratio from section 2, or `--focus-color` on `--color-background`, is below its minimum. Contrast follows `var()` references.
- **`scripts/check-tokens.test.mjs`**: tests using Node's built-in `node:test`. They confirm the checker fails on a missing token, an undocumented token, a documented token that doesn't exist, a broken reduced-motion block, low contrast, and color-named tokens. They also check the contrast math against known WCAG values.
- **`package.json`** (new, minimal, no dependencies): `npm test` runs the check script and the tests; `npm run check:tokens` runs just the check.
- **`examples/tokens.html`** (optional demo): rules that use only `var(--token)`, with "compact", "round" and "accent" overrides applied to cards.
## Contrast results (default theme)
| Text | Background | Ratio | Minimum |
| --- | --- | --- | --- |
| `--color-text` | `--color-background` | 16.56:1 | 4.5:1 |
| `--color-text` | `--color-surface` | 15.45:1 | 4.5:1 |
| `--color-text-secondary` | `--color-background` | 9.57:1 | 4.5:1 |
| `--color-text-secondary` | `--color-surface` | 8.93:1 | 4.5:1 |
| `--color-text-muted` | `--color-background` | 5.84:1 | 4.5:1 |
| `--color-on-primary` | `--color-primary` | 7.45:1 | 4.5:1 |
| `--focus-color` | `--color-background` | 7.45:1 | 3:1 |
The four status colors are not checked by the script. I measured them by hand: each is at least 4.88:1 on both the background and the surface color.
## Verification
- `npm test` passes on Node 22: the check script passes and all 8 tests pass.
- I ran the script by hand on a copy of `tokens.css` with `--color-info` removed. It exited with code 1 and reported both the missing token and the doc entry for a token that no longer exists.
- I did not open `examples/tokens.html` in a browser.
## What to check
- **Overrides on nested elements:** because `--border-color` and `--focus-color` are defined with `var()`, the browser resolves them on `:root`. Overriding `--color-primary` on `:root` updates the focus ring too, but overriding it on a nested element doesn't. The docs explain this, and the demo sets `--focus-color` itself for that reason.
- **What the docs check covers:** the script only counts tokens in the first column of the docs tables. A misspelled token in a prose or code example won't be flagged.
- **Git author:** the sandbox already had a git identity set up, so the commit is authored by that identity rather than "nabled builder".
- **README:** its existing intro sentence is cut off mid-word ("reliably underst"). I left it as is and only added a "Design tokens" section after it.
2026-10-02T23:12:18Z [claude] I've built the token set, the reference docs and the check script, and pushed them to `nabled/feature-1-job-1`. `npm test` passes on Node 22. I didn't open the example page (`examples/tokens.html`) in a browser.
- **Tokens:** `src/tokens.css` defines 55 tokens on `:root`, under the limit of about 70. Names are semantic only, the primary color is a muted slate blue, and fonts are system fonts only. When reduced motion is requested, all three `--duration-*` tokens are set to `0ms`.
- **Contrast:** every required pair passes:
| Text | Background | Ratio | Minimum |
| --- | --- | --- | --- |
| `--color-text` | `--color-background` | 16.56:1 | 4.5:1 |
| `--color-text` | `--color-surface` | 15.45:1 | 4.5:1 |
| `--color-text-secondary` | `--color-background` | 9.57:1 | 4.5:1 |
| `--color-text-secondary` | `--color-surface` | 8.93:1 | 4.5:1 |
| `--color-text-muted` | `--color-background` | 5.84:1 | 4.5:1 |
| `--color-on-primary` | `--color-primary` | 7.45:1 | 4.5:1 |
| `--focus-color` | `--color-background` | 7.45:1 | 3:1 |
- **Docs:** `docs/tokens.md` has a table per category (token, default, purpose), the override example, a reduced-motion note, and a "For AI agents" section covering "more compact", "rounder" and "different accent". The README links to it.
- **Check script:** `npm test` (or `npm run check:tokens`) runs `scripts/check-tokens.mjs`, which needs only Node. It fails on a missing, duplicate, undocumented or color-named token, and on more than 70 tokens. It also fails if the docs list a token that doesn't exist, the reduced-motion block is incomplete, or any contrast pair is too low. Eight tests in `scripts/check-tokens.test.mjs` confirm each of these failures is caught. I also ran it by hand on a copy of `tokens.css` with `--color-info` removed, and it exited with an error.
- **Extras:** a minimal `package.json` (no dependencies) and the optional example page.
Things to know before merging:
- **Overrides on nested elements:** `--focus-color` and `--border-color` are defined in terms of other tokens, and the browser resolves them on `:root`. Changing `--color-primary` on `:root` updates the focus ring too, but changing it on a nested element doesn't, so that element has to set `--focus-color` as well. The docs explain this.
- **Docs check scope:** the script only reads token names from the first column of the docs tables. A misspelled token in a prose or code example won't be caught.
- **Commit author:** the sandbox already had a git identity set up, so the commit uses that instead of "nabled builder".
- **README:** the existing intro sentence was already cut off mid-word ("reliably underst"). I left it alone and only added a "Design tokens" section after it.
2026-10-02T23:12:20Z Changed files:
modified README.md +10 -0
added docs/tokens.md +206 -0
added examples/tokens.html +76 -0
added package.json +15 -0
added scripts/check-tokens.mjs +339 -0
added scripts/check-tokens.test.mjs +58 -0
added src/tokens.css +100 -0
2026-10-02T23:12:21Z Opened pull request https://github.com/nabledhq/synthcss/pull/1
2026-10-02T23:12:21Z Finished: success=true turns=15 tokens(in/out)=324694/20989 list cost=$0.64
Show patch
diff --git a/README.md b/README.md
index 2ae0e2e..b92f5cb 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,12 @@
# synthcss
SynthCSS is a lightweight, opinionated CSS framework built specifically for AI agents, code generators, and dynamically created applications. Instead of optimizing for humans hand-authoring every class, SynthCSS provides a predictable set of semantic components, layout primitives, design tokens, and interaction patterns that AI can reliably underst
+
+## Design tokens
+
+All visual decisions (color, spacing, typography, radius, borders, shadows, sizing, focus and motion) are CSS custom properties defined on `:root` in [`src/tokens.css`](src/tokens.css). To restyle an interface, override a few tokens:
+
+```css
+:root { --color-primary: #YOUR_COLOR; --radius-md: 0.5rem; --space-3: 0.75rem; }
+```
+
+See [docs/tokens.md](docs/tokens.md) for the full token reference, override examples, guidance for AI agents and reduced-motion behavior. Run `npm test` to check that the tokens, the docs and the contrast requirements are in sync. It needs only Node.js 18 or later.
diff --git a/docs/tokens.md b/docs/tokens.md
new file mode 100644
index 0000000..95e1577
--- /dev/null
+++ b/docs/tokens.md
@@ -0,0 +1,206 @@
+# Design tokens
+
+SynthCSS keeps every visual decision in one file, [`src/tokens.css`](../src/tokens.css).
+Each token is a CSS custom property on `:root`. Components and layout primitives read
+tokens through `var(--token)`, so changing a token changes every rule that uses it.
+
+Include the file before any other SynthCSS or app styles:
+
+```html
+<link rel="stylesheet" href="synthcss/src/tokens.css">
+```
+
+The defaults are a neutral light theme with a desaturated slate-blue primary. They are
+not tied to any brand. Text colors meet WCAG AA, and `npm test` checks this (see
+[Verification](#verification)).
+
+## Reference
+
+### Color
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--color-background` | `#ffffff` | Page background. |
+| `--color-surface` | `#f6f7f9` | Background for cards, panels, wells and other grouped content. |
+| `--color-surface-elevated` | `#ffffff` | Background for raised layers: popovers, menus, dialogs. Pair with a shadow. |
+| `--color-text` | `#1b1f24` | Main body and heading text. |
+| `--color-text-secondary` | `#3d4651` | Supporting text: descriptions, labels, table cells. |
+| `--color-text-muted` | `#5c6672` | Low-emphasis text: hints, placeholders, metadata, timestamps. |
+| `--color-border` | `#d5dae0` | Default color for dividers and component outlines. |
+| `--color-primary` | `#3b5778` | Accent color for primary actions, links and selected states. |
+| `--color-primary-hover` | `#2f4762` | Hover and active state of primary elements. |
+| `--color-on-primary` | `#ffffff` | Text and icons placed on `--color-primary`. |
+| `--color-success` | `#2f7a4f` | Success state: confirmations, valid input. |
+| `--color-warning` | `#9a5b0c` | Warning state: needs attention, not blocking. |
+| `--color-danger` | `#b3362e` | Error and destructive state: errors, delete actions. |
+| `--color-info` | `#2f6694` | Neutral informational state: tips, notices. |
+
+### Spacing
+
+A rem scale that only increases. Use it for padding, margins and gaps.
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--space-1` | `0.25rem` | Hairline gaps, such as between an icon and its label. |
+| `--space-2` | `0.5rem` | Tight padding inside small controls and between related items. |
+| `--space-3` | `0.75rem` | Default padding inside controls and compact cards. |
+| `--space-4` | `1rem` | Default gap between elements and default card padding. |
+| `--space-5` | `1.5rem` | Space between groups of content. |
+| `--space-6` | `2rem` | Space between page sections. |
+
+### Typography
+
+Font stacks use only system fonts. Nothing is downloaded.
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--font-sans` | `system-ui, -apple-system, "Segoe UI", Roboto, …, sans-serif` | Default font for all UI text. |
+| `--font-mono` | `ui-monospace, SFMono-Regular, Menlo, …, monospace` | Code, keyboard input, tabular data. |
+| `--text-sm` | `0.875rem` | Small text: captions, hints, dense tables. |
+| `--text-base` | `1rem` | Body text and controls. |
+| `--text-lg` | `1.125rem` | Lead paragraphs and small headings. |
+| `--text-xl` | `1.25rem` | Section headings. |
+| `--text-2xl` | `1.5rem` | Page headings. |
+| `--text-3xl` | `1.875rem` | Hero and display headings. |
+| `--weight-normal` | `400` | Body text. |
+| `--weight-medium` | `500` | Labels, buttons, emphasized UI text. |
+| `--weight-semibold` | `600` | Headings and table headers. |
+| `--weight-bold` | `700` | Strong emphasis and display headings. |
+| `--leading-tight` | `1.25` | Headings and single-line controls. |
+| `--leading-normal` | `1.5` | Body text. |
+| `--leading-relaxed` | `1.75` | Long-form reading content. |
+
+### Radius
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--radius-sm` | `0.25rem` | Small elements: badges, checkboxes, tags. |
+| `--radius-md` | `0.375rem` | Default for buttons, inputs and cards. |
+| `--radius-lg` | `0.75rem` | Large containers: dialogs, panels. |
+| `--radius-full` | `9999px` | Pills, avatars, fully rounded shapes. |
+
+### Borders
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--border-width` | `1px` | Default stroke width for borders and dividers. |
+| `--border-color` | `var(--color-border)` | Default border color. Override this to change borders without changing `--color-border`. |
+
+### Shadows
+
+Subtle and low-opacity. Use them for elevation only, not for decoration.
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--shadow-sm` | `0 1px 2px rgb(16 24 40 / 0.05)` | Slight lift: cards, raised buttons. |
+| `--shadow-md` | `0 2px 6px rgb(16 24 40 / 0.07), 0 1px 2px rgb(16 24 40 / 0.04)` | Floating elements: dropdowns, popovers. |
+| `--shadow-lg` | `0 8px 24px rgb(16 24 40 / 0.08), 0 2px 6px rgb(16 24 40 / 0.04)` | Top layer: dialogs, toasts. |
+
+### Sizing
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--control-height` | `2.5rem` | Height of buttons and other single-line controls. |
+| `--input-height` | `2.5rem` | Height of text inputs and selects. Keep it equal to `--control-height` so they line up. |
+| `--container-width` | `72rem` | Maximum width of the main page container. |
+| `--content-width` | `42rem` | Maximum width of readable text blocks, about 65–75 characters per line. |
+
+### Focus
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--focus-color` | `var(--color-primary)` | Focus ring color. Must contrast at least 3:1 with `--color-background`. |
+| `--focus-width` | `2px` | Focus ring thickness. |
+| `--focus-offset` | `2px` | Gap between the element and its focus ring. |
+
+### Motion
+
+| Token | Default | Purpose |
+| --- | --- | --- |
+| `--duration-fast` | `120ms` | Small state changes: hover, focus, color. |
+| `--duration-normal` | `200ms` | Default for most transitions: expanding, fading. |
+| `--duration-slow` | `320ms` | Large movements: dialogs, drawers, page-level transitions. |
+| `--ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` | Default easing curve for all transitions. |
+
+## Reduced motion
+
+When the user sets `prefers-reduced-motion: reduce`, `src/tokens.css` overrides all
+`--duration-*` tokens to `0ms` on `:root`:
+
+```css
+@media (prefers-reduced-motion: reduce) {
+ :root {
+ --duration-fast: 0ms;
+ --duration-normal: 0ms;
+ --duration-slow: 0ms;
+ }
+}
+```
+
+A transition such as `transition: background-color var(--duration-fast) var(--ease-standard)`
+then finishes immediately, with no extra CSS. Write durations as tokens, never as raw
+`ms` values, so this works everywhere. If you set your own `--duration-*` values, wrap
+them in the same media query or put them before `tokens.css`, so the reduced-motion
+override still wins.
+
+## Overriding tokens
+
+Load your own stylesheet after `tokens.css` and redefine the tokens you want to change
+on `:root`:
+
+```css
+:root { --color-primary: #YOUR_COLOR; --radius-md: 0.5rem; --space-3: 0.75rem; }
+```
+
+Every rule that uses `var(--color-primary)`, `var(--radius-md)` or `var(--space-3)`
+picks up the new values. You can also override tokens on any element to restyle only
+that part of the page:
+
+```css
+.sidebar { --space-4: 0.75rem; --text-base: 0.875rem; }
+```
+
+Two tokens default to another token: `--border-color` is `var(--color-border)` and
+`--focus-color` is `var(--color-primary)`. The browser resolves these where they are
+defined, on `:root`. If you override `--color-border` or `--color-primary` on `:root`,
+they follow automatically. If you override them on a nested element, set
+`--border-color` or `--focus-color` on that element too.
+
+If you change `--color-primary`, check that `--color-on-primary` still contrasts at
+least 4.5:1 with it, and change `--color-primary-hover` to match. See
+[`examples/tokens.html`](../examples/tokens.html) for a working demo.
+
+## For AI agents
+
+- Always write `var(--token)` instead of raw values. Do not hard-code hex colors, `px`
+ or `rem` sizes, font stacks, shadows or durations when a token exists.
+- Restyle by overriding tokens on `:root`. Do not rewrite component rules.
+- Use semantic color tokens for their stated purpose. For example, use
+ `--color-danger` for destructive actions, not because you want red.
+- If text is placed on `--color-primary`, color it with `--color-on-primary`.
+
+Common requests and the tokens to change:
+
+| Request | Tokens to change | Example |
+| --- | --- | --- |
+| "More compact" | `--space-1` … `--space-6`, `--control-height`, `--input-height`, optionally `--text-base` | `:root { --space-3: 0.5rem; --space-4: 0.75rem; --space-5: 1rem; --space-6: 1.5rem; --control-height: 2rem; --input-height: 2rem; }` |
+| "Rounder" | `--radius-sm`, `--radius-md`, `--radius-lg` | `:root { --radius-sm: 0.5rem; --radius-md: 0.75rem; --radius-lg: 1.25rem; }` |
+| "Different accent" | `--color-primary`, `--color-primary-hover`, `--color-on-primary` (`--focus-color` follows `--color-primary`) | `:root { --color-primary: #6b4e8a; --color-primary-hover: #573f71; --color-on-primary: #ffffff; }` |
+
+Keep the spacing scale increasing (`--space-1` < `--space-2` < …) when you change it.
+
+## Verification
+
+`npm test` (or `npm run check:tokens`) runs [`scripts/check-tokens.mjs`](../scripts/check-tokens.mjs). It needs only Node.js and checks that:
+
+- every required token is defined on `:root` in `src/tokens.css`, with no duplicates,
+ no color-named tokens (such as `--blue-500`) and no more than 70 tokens in total;
+- every defined token has a row in the tables above, and every token in the tables exists;
+- the `prefers-reduced-motion: reduce` block sets every `--duration-*` token to `0ms`;
+- these contrast ratios meet their minimums:
+ - `--color-text` and `--color-text-secondary` on `--color-background` and on `--color-surface`: at least 4.5:1
+ - `--color-text-muted` on `--color-background`: at least 4.5:1
+ - `--color-on-primary` on `--color-primary`: at least 4.5:1
+ - `--focus-color` on `--color-background`: at least 3:1
+
+When you add or rename a token, add it to the matching table in this file in the same change.
diff --git a/examples/tokens.html b/examples/tokens.html
new file mode 100644
index 0000000..bc61b16
--- /dev/null
+++ b/examples/tokens.html
@@ -0,0 +1,76 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>SynthCSS tokens demo</title>
+ <link rel="stylesheet" href="../src/tokens.css">
+ <style>
+ /* Demo rules: every value comes from a token. */
+ body {
+ margin: 0;
+ padding: var(--space-6);
+ background: var(--color-background);
+ color: var(--color-text);
+ font-family: var(--font-sans);
+ font-size: var(--text-base);
+ line-height: var(--leading-normal);
+ }
+ .stack { display: grid; gap: var(--space-5); max-width: var(--content-width); }
+ .card {
+ padding: var(--space-4);
+ background: var(--color-surface);
+ border: var(--border-width) solid var(--border-color);
+ border-radius: var(--radius-md);
+ box-shadow: var(--shadow-sm);
+ }
+ .card h2 { margin: 0 0 var(--space-2); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
+ .card p { margin: 0 0 var(--space-3); color: var(--color-text-secondary); }
+ .card small { display: block; margin-bottom: var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
+ .button {
+ height: var(--control-height);
+ padding: 0 var(--space-4);
+ border: 0;
+ border-radius: var(--radius-md);
+ background: var(--color-primary);
+ color: var(--color-on-primary);
+ font: inherit;
+ font-weight: var(--weight-medium);
+ cursor: pointer;
+ transition: background-color var(--duration-fast) var(--ease-standard);
+ }
+ .button:hover { background: var(--color-primary-hover); }
+ .button:focus-visible { outline: var(--focus-width) solid var(--focus-color); outline-offset: var(--focus-offset); }
+
+ /* Consumer overrides: only tokens change, the rules above stay the same. */
+ .theme-compact { --space-3: 0.5rem; --space-4: 0.75rem; --control-height: 2rem; }
+ .theme-round { --radius-md: 1rem; }
+ .theme-accent { --color-primary: #6b4e8a; --color-primary-hover: #573f71; --focus-color: #6b4e8a; }
+ </style>
+</head>
+<body>
+ <main class="stack">
+ <section class="card">
+ <h2>Default tokens</h2>
+ <p>These rules only use <code>var(--token)</code>.</p>
+ <small>Muted metadata text</small>
+ <button class="button" type="button">Primary action</button>
+ </section>
+ <section class="card theme-compact">
+ <h2>More compact</h2>
+ <p>Overrides <code>--space-3</code>, <code>--space-4</code> and <code>--control-height</code>.</p>
+ <button class="button" type="button">Primary action</button>
+ </section>
+ <section class="card theme-round">
+ <h2>Rounder</h2>
+ <p>Overrides <code>--radius-md</code>.</p>
+ <button class="button" type="button">Primary action</button>
+ </section>
+ <section class="card theme-accent">
+ <h2>Different accent</h2>
+ <p>Overrides <code>--color-primary</code> and <code>--color-primary-hover</code>.</p>
+ <button class="button" type="button">Primary action</button>
+ </section>
+ </main>
+</body>
+</html>
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..7ca26cd
--- /dev/null
+++ b/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "synthcss",
+ "version": "0.0.0",
+ "private": true,
+ "description": "A lightweight, opinionated CSS framework built for AI agents and code generators.",
+ "license": "MIT",
+ "type": "module",
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "check:tokens": "node scripts/check-tokens.mjs",
+ "test": "node scripts/check-tokens.mjs && node --test scripts/check-tokens.test.mjs"
+ }
+}
diff --git a/scripts/check-tokens.mjs b/scripts/check-tokens.mjs
new file mode 100644
index 0000000..ed9c707
--- /dev/null
+++ b/scripts/check-tokens.mjs
@@ -0,0 +1,339 @@
+#!/usr/bin/env node
+// Dependency-free verification of src/tokens.css against the token spec and docs/tokens.md.
+// Usage: node scripts/check-tokens.mjs [path/to/tokens.css] [path/to/tokens.md]
+
+import { readFileSync } from "node:fs";
+import { fileURLToPath } from "node:url";
+import { dirname, resolve } from "node:path";
+
+export const REQUIRED_TOKENS = [
+ "--color-background",
+ "--color-surface",
+ "--color-surface-elevated",
+ "--color-text",
+ "--color-text-secondary",
+ "--color-text-muted",
+ "--color-border",
+ "--color-primary",
+ "--color-primary-hover",
+ "--color-on-primary",
+ "--color-success",
+ "--color-warning",
+ "--color-danger",
+ "--color-info",
+ "--space-1",
+ "--space-2",
+ "--space-3",
+ "--space-4",
+ "--space-5",
+ "--space-6",
+ "--font-sans",
+ "--font-mono",
+ "--text-sm",
+ "--text-base",
+ "--text-lg",
+ "--text-xl",
+ "--text-2xl",
+ "--text-3xl",
+ "--weight-normal",
+ "--weight-medium",
+ "--weight-semibold",
+ "--weight-bold",
+ "--leading-tight",
+ "--leading-normal",
+ "--leading-relaxed",
+ "--radius-sm",
+ "--radius-md",
+ "--radius-lg",
+ "--radius-full",
+ "--border-width",
+ "--border-color",
+ "--shadow-sm",
+ "--shadow-md",
+ "--shadow-lg",
+ "--control-height",
+ "--input-height",
+ "--container-width",
+ "--content-width",
+ "--focus-color",
+ "--focus-width",
+ "--focus-offset",
+ "--duration-fast",
+ "--duration-normal",
+ "--duration-slow",
+ "--ease-standard",
+];
+
+export const MAX_TOKENS = 70;
+
+// [foreground, background, minimum ratio]
+export const CONTRAST_PAIRS = [
+ ["--color-text", "--color-background", 4.5],
+ ["--color-text", "--color-surface", 4.5],
+ ["--color-text-secondary", "--color-background", 4.5],
+ ["--color-text-secondary", "--color-surface", 4.5],
+ ["--color-text-muted", "--color-background", 4.5],
+ ["--color-on-primary", "--color-primary", 4.5],
+ ["--focus-color", "--color-background", 3],
+];
+
+const COLOR_NAME_RE =
+ /^--(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|grey|zinc|neutral|stone|black|white|brown)(?:-|$)/;
+
+// ---------------------------------------------------------------------------
+// CSS parsing (just enough for a flat token file)
+// ---------------------------------------------------------------------------
+
+function stripComments(css) {
+ return css.replace(/\/\*[\s\S]*?\*\//g, "");
+}
+
+// Returns top-level blocks as { prelude, body }. Nested at-rule bodies can be parsed again.
+export function parseBlocks(css) {
+ const blocks = [];
+ let depth = 0;
+ let start = 0;
+ let preludeStart = 0;
+ let prelude = "";
+ for (let i = 0; i < css.length; i++) {
+ const ch = css[i];
+ if (ch === "{") {
+ if (depth === 0) {
+ prelude = css.slice(preludeStart, i).trim();
+ start = i + 1;
+ }
+ depth++;
+ } else if (ch === "}") {
+ depth--;
+ if (depth < 0) throw new Error("Unbalanced '}' in CSS");
+ if (depth === 0) {
+ blocks.push({ prelude, body: css.slice(start, i) });
+ preludeStart = i + 1;
+ }
+ } else if (ch === ";" && depth === 0) {
+ preludeStart = i + 1; // skip top-level statements such as @charset / @import
+ }
+ }
+ if (depth !== 0) throw new Error("Unbalanced '{' in CSS");
+ return blocks;
+}
+
+export function parseDeclarations(body) {
+ const decls = [];
+ for (const part of body.split(";")) {
+ const idx = part.indexOf(":");
+ if (idx === -1) {
+ if (part.trim()) decls.push({ prop: part.trim(), value: "" });
+ continue;
+ }
+ decls.push({
+ prop: part.slice(0, idx).trim(),
+ value: part.slice(idx + 1).replace(/\s+/g, " ").trim(),
+ });
+ }
+ return decls;
+}
+
+const normalize = (s) => s.replace(/\s+/g, " ").trim().toLowerCase();
+
+export function parseTokens(rawCss) {
+ const css = stripComments(rawCss);
+ const root = new Map();
+ const reducedMotion = new Map();
+ const otherDeclarations = [];
+ const duplicates = [];
+
+ for (const { prelude, body } of parseBlocks(css)) {
+ const sel = normalize(prelude);
+ if (sel === ":root") {
+ for (const { prop, value } of parseDeclarations(body)) {
+ if (!prop.startsWith("--")) {
+ otherDeclarations.push(`${prop}: ${value}`);
+ continue;
+ }
+ if (root.has(prop)) duplicates.push(prop);
+ root.set(prop, value);
+ }
+ } else if (/^@media\b/.test(sel) && /prefers-reduced-motion\s*:\s*reduce/.test(sel)) {
+ for (const inner of parseBlocks(body)) {
+ if (normalize(inner.prelude) !== ":root") continue;
+ for (const { prop, value } of parseDeclarations(inner.body)) {
+ reducedMotion.set(prop, value);
+ }
+ }
+ } else {
+ otherDeclarations.push(`${prelude} { … }`);
+ }
+ }
+ return { root, reducedMotion, otherDeclarations, duplicates };
+}
+
+// ---------------------------------------------------------------------------
+// Color + contrast (WCAG 2.x)
+// ---------------------------------------------------------------------------
+
+export function resolveValue(name, tokens, seen = new Set()) {
+ if (seen.has(name)) throw new Error(`circular var() reference at ${name}`);
+ seen.add(name);
+ if (!tokens.has(name)) throw new Error(`${name} is not defined`);
+ const value = tokens.get(name).trim();
+ const m = /^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(value);
+ if (!m) return value;
+ if (!tokens.has(m[1]) && m[2] !== undefined) return m[2].trim();
+ return resolveValue(m[1], tokens, seen);
+}
+
+export function parseColor(value) {
+ const v = value.trim().toLowerCase();
+ let m = /^#([0-9a-f]{3,8})$/.exec(v);
+ if (m) {
+ let hex = m[1];
+ if (hex.length === 3 || hex.length === 4) hex = [...hex].map((c) => c + c).join("");
+ if (hex.length !== 6 && hex.length !== 8) return null;
+ const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;
+ return { r: parseInt(hex.slice(0, 2), 16), g: parseInt(hex.slice(2, 4), 16), b: parseInt(hex.slice(4, 6), 16), a };
+ }
+ m = /^rgba?\((.+)\)$/.exec(v);
+ if (m) {
+ const parts = m[1].split(/[\s,/]+/).filter(Boolean);
+ if (parts.length < 3) return null;
+ const ch = (p) => (p.endsWith("%") ? (parseFloat(p) / 100) * 255 : parseFloat(p));
+ const a = parts[3] === undefined ? 1 : parts[3].endsWith("%") ? parseFloat(parts[3]) / 100 : parseFloat(parts[3]);
+ const [r, g, b] = parts.slice(0, 3).map(ch);
+ if ([r, g, b, a].some(Number.isNaN)) return null;
+ return { r, g, b, a };
+ }
+ if (v === "white") return { r: 255, g: 255, b: 255, a: 1 };
+ if (v === "black") return { r: 0, g: 0, b: 0, a: 1 };
+ return null;
+}
+
+function luminance({ r, g, b }) {
+ const lin = (c) => {
+ const s = c / 255;
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
+ };
+ return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
+}
+
+export function contrastRatio(a, b) {
+ const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x);
+ return (hi + 0.05) / (lo + 0.05);
+}
+
+// ---------------------------------------------------------------------------
+// Docs
+// ---------------------------------------------------------------------------
+
+// Tokens documented in markdown tables: rows whose first cell is `--token`.
+export function parseDocumentedTokens(markdown) {
+ const documented = new Set();
+ for (const line of markdown.split("\n")) {
+ const m = /^\s*\|\s*`(--[\w-]+)`\s*\|/.exec(line);
+ if (m) documented.add(m[1]);
+ }
+ return documented;
+}
+
+// ---------------------------------------------------------------------------
+// Checks
+// ---------------------------------------------------------------------------
+
+export function checkTokens(css, markdown) {
+ const errors = [];
+ const notes = [];
+ let parsed;
+ try {
+ parsed = parseTokens(css);
+ } catch (err) {
+ return { errors: [`tokens.css: ${err.message}`], notes };
+ }
+ const { root, reducedMotion, otherDeclarations, duplicates } = parsed;
+
+ for (const name of REQUIRED_TOKENS) {
+ if (!root.has(name)) errors.push(`missing required token ${name} on :root`);
+ }
+ for (const name of duplicates) errors.push(`token ${name} is defined more than once on :root`);
+ if (root.size > MAX_TOKENS) errors.push(`${root.size} tokens defined; the limit is ${MAX_TOKENS}`);
+ for (const name of root.keys()) {
+ if (COLOR_NAME_RE.test(name)) errors.push(`token ${name} is color-named; use a semantic name`);
+ }
+ for (const decl of otherDeclarations) {
+ errors.push(`tokens.css may only contain token definitions on :root, found: ${decl}`);
+ }
+
+ // Reduced motion
+ const durations = [...root.keys()].filter((n) => n.startsWith("--duration-"));
+ for (const name of durations) {
+ const v = reducedMotion.get(name);
+ if (v === undefined) errors.push(`reduced-motion block does not override ${name}`);
+ else if (!/^0(ms|s)?$/.test(v)) errors.push(`reduced-motion block sets ${name} to "${v}", expected 0ms`);
+ }
+
+ // Spacing scale must increase monotonically
+ const spaces = [...root.keys()]
+ .filter((n) => /^--space-\d+$/.test(n))
+ .sort((a, b) => Number(a.slice(8)) - Number(b.slice(8)));
+ for (let i = 1; i < spaces.length; i++) {
+ const prev = parseFloat(root.get(spaces[i - 1]));
+ const cur = parseFloat(root.get(spaces[i]));
+ if (!(cur > prev)) errors.push(`spacing scale is not increasing at ${spaces[i]}`);
+ }
+
+ // Contrast
+ for (const [fg, bg, min] of CONTRAST_PAIRS) {
+ let fgColor, bgColor;
+ try {
+ fgColor = parseColor(resolveValue(fg, root));
+ bgColor = parseColor(resolveValue(bg, root));
+ } catch (err) {
+ errors.push(`contrast ${fg} on ${bg}: ${err.message}`);
+ continue;
+ }
+ if (!fgColor || !bgColor) {
+ errors.push(`contrast ${fg} on ${bg}: could not parse color value`);
+ continue;
+ }
+ if (fgColor.a < 1 || bgColor.a < 1) {
+ errors.push(`contrast ${fg} on ${bg}: colors must be opaque to be checked`);
+ continue;
+ }
+ const ratio = contrastRatio(fgColor, bgColor);
+ const line = `${fg} on ${bg}: ${ratio.toFixed(2)}:1 (min ${min}:1)`;
+ if (ratio < min) errors.push(`contrast too low, ${line}`);
+ else notes.push(line);
+ }
+
+ // Docs
+ if (markdown !== undefined) {
+ const documented = parseDocumentedTokens(markdown);
+ for (const name of root.keys()) {
+ if (!documented.has(name)) errors.push(`token ${name} is not documented in docs/tokens.md`);
+ }
+ for (const name of documented) {
+ if (!root.has(name)) errors.push(`docs/tokens.md documents ${name}, which is not defined in tokens.css`);
+ }
+ }
+
+ return { errors, notes, count: root.size };
+}
+
+// ---------------------------------------------------------------------------
+// CLI
+// ---------------------------------------------------------------------------
+
+const isMain = process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url);
+
+if (isMain) {
+ const repo = resolve(dirname(fileURLToPath(import.meta.url)), "..");
+ const cssPath = resolve(process.argv[2] ?? `${repo}/src/tokens.css`);
+ const docsPath = resolve(process.argv[3] ?? `${repo}/docs/tokens.md`);
+ const { errors, notes, count } = checkTokens(readFileSync(cssPath, "utf8"), readFileSync(docsPath, "utf8"));
+ for (const n of notes) console.log(` ok ${n}`);
+ if (errors.length) {
+ for (const e of errors) console.error(` FAIL ${e}`);
+ console.error(`\ncheck-tokens: ${errors.length} problem(s) found.`);
+ process.exit(1);
+ }
+ console.log(`\ncheck-tokens: ${count} tokens defined, documented and passing.`);
+}
diff --git a/scripts/check-tokens.test.mjs b/scripts/check-tokens.test.mjs
new file mode 100644
index 0000000..62fa926
--- /dev/null
+++ b/scripts/check-tokens.test.mjs
@@ -0,0 +1,58 @@
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { checkTokens, contrastRatio, parseColor } from "./check-tokens.mjs";
+
+const css = readFileSync(new URL("../src/tokens.css", import.meta.url), "utf8");
+const docs = readFileSync(new URL("../docs/tokens.md", import.meta.url), "utf8");
+
+const errorsFor = (c, d) => checkTokens(c, d).errors;
+
+test("repository tokens and docs pass", () => {
+ assert.deepEqual(errorsFor(css, docs), []);
+});
+
+test("fails when a required token is missing", () => {
+ const broken = css.replace(/^\s*--color-surface-elevated:.*$/m, "");
+ const errors = errorsFor(broken, docs);
+ assert.ok(errors.some((e) => e.includes("missing required token --color-surface-elevated")), errors.join("\n"));
+});
+
+test("fails when a defined token is undocumented", () => {
+ const broken = css.replace("--ease-standard:", "--ease-emphasized: ease-out;\n --ease-standard:");
+ const errors = errorsFor(broken, docs);
+ assert.ok(errors.some((e) => e.includes("--ease-emphasized is not documented")), errors.join("\n"));
+});
+
+test("fails when a documented token does not exist", () => {
+ const broken = docs.replace("| `--space-6` |", "| `--space-7` | `3rem` | Extra. |\n| `--space-6` |");
+ const errors = errorsFor(css, broken);
+ assert.ok(errors.some((e) => e.includes("documents --space-7")), errors.join("\n"));
+});
+
+test("fails when reduced motion does not zero a duration", () => {
+ const broken = css.replace(/--duration-slow: 0ms;/, "--duration-slow: 100ms;");
+ assert.ok(errorsFor(broken, docs).some((e) => e.includes("--duration-slow")));
+ const missing = css.replace(/--duration-normal: 0ms;/, "");
+ assert.ok(errorsFor(missing, docs).some((e) => e.includes("does not override --duration-normal")));
+});
+
+test("fails when contrast is below threshold", () => {
+ const broken = css.replace(/--color-text-muted: #[0-9a-f]+;/, "--color-text-muted: #a0a0a0;");
+ const errors = errorsFor(broken, docs);
+ assert.ok(errors.some((e) => e.startsWith("contrast too low, --color-text-muted")), errors.join("\n"));
+});
+
+test("fails on color-named tokens and non-token declarations", () => {
+ const broken = css.replace("--ease-standard:", "--blue-500: #0000ff;\n --ease-standard:") + "\nbody { color: red; }\n";
+ const errors = errorsFor(broken, docs);
+ assert.ok(errors.some((e) => e.includes("--blue-500 is color-named")), errors.join("\n"));
+ assert.ok(errors.some((e) => e.includes("only contain token definitions")), errors.join("\n"));
+});
+
+test("contrast math matches WCAG reference values", () => {
+ const ratio = (a, b) => contrastRatio(parseColor(a), parseColor(b));
+ assert.equal(ratio("#000", "#fff").toFixed(2), "21.00");
+ assert.equal(ratio("#777777", "#ffffff").toFixed(2), "4.48");
+ assert.equal(ratio("rgb(255 255 255)", "#ffffff").toFixed(2), "1.00");
+});
diff --git a/src/tokens.css b/src/tokens.css
new file mode 100644
index 0000000..cea0d60
--- /dev/null
+++ b/src/tokens.css
@@ -0,0 +1,100 @@
+/*
+ * SynthCSS design tokens
+ *
+ * The single source of truth for every visual decision in SynthCSS.
+ * Components and layout primitives consume these through var(--token).
+ * Override any token on :root in your own stylesheet to restyle the UI.
+ *
+ * Reference: docs/tokens.md
+ */
+
+:root {
+ /* Color: neutral light theme */
+ --color-background: #ffffff;
+ --color-surface: #f6f7f9;
+ --color-surface-elevated: #ffffff;
+ --color-text: #1b1f24;
+ --color-text-secondary: #3d4651;
+ --color-text-muted: #5c6672;
+ --color-border: #d5dae0;
+ --color-primary: #3b5778;
+ --color-primary-hover: #2f4762;
+ --color-on-primary: #ffffff;
+ --color-success: #2f7a4f;
+ --color-warning: #9a5b0c;
+ --color-danger: #b3362e;
+ --color-info: #2f6694;
+
+ /* Spacing */
+ --space-1: 0.25rem;
+ --space-2: 0.5rem;
+ --space-3: 0.75rem;
+ --space-4: 1rem;
+ --space-5: 1.5rem;
+ --space-6: 2rem;
+
+ /* Typography: families */
+ --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
+ Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
+ "Liberation Mono", "Courier New", monospace;
+
+ /* Typography: sizes */
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-lg: 1.125rem;
+ --text-xl: 1.25rem;
+ --text-2xl: 1.5rem;
+ --text-3xl: 1.875rem;
+
+ /* Typography: weights */
+ --weight-normal: 400;
+ --weight-medium: 500;
+ --weight-semibold: 600;
+ --weight-bold: 700;
+
+ /* Typography: line heights */
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* Radius */
+ --radius-sm: 0.25rem;
+ --radius-md: 0.375rem;
+ --radius-lg: 0.75rem;
+ --radius-full: 9999px;
+
+ /* Borders */
+ --border-width: 1px;
+ --border-color: var(--color-border);
+
+ /* Shadows */
+ --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
+ --shadow-md: 0 2px 6px rgb(16 24 40 / 0.07), 0 1px 2px rgb(16 24 40 / 0.04);
+ --shadow-lg: 0 8px 24px rgb(16 24 40 / 0.08), 0 2px 6px rgb(16 24 40 / 0.04);
+
+ /* Sizing */
+ --control-height: 2.5rem;
+ --input-height: 2.5rem;
+ --container-width: 72rem;
+ --content-width: 42rem;
+
+ /* Focus */
+ --focus-color: var(--color-primary);
+ --focus-width: 2px;
+ --focus-offset: 2px;
+
+ /* Motion */
+ --duration-fast: 120ms;
+ --duration-normal: 200ms;
+ --duration-slow: 320ms;
+ --ease-standard: cubic-bezier(0.2, 0, 0, 1);
+}
+
+@media (prefers-reduced-motion: reduce) {
+ :root {
+ --duration-fast: 0ms;
+ --duration-normal: 0ms;
+ --duration-slow: 0ms;
+ }
+}
No comments yet.