# Tokens

[CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) on `:root`, prefixed `--dui-`, in two tiers. Semantic tokens are the public API, and the only ones base, layout and component CSS use (`npm run lint:tokens` checks). To theme, override them ([Theming](https://domestic-ui.odonckers.dev/principles/theming.md)).

## Token files

- [Primitive tokens](https://domestic-ui.odonckers.dev/tokens/primitives.md): 190 tokens, internal.
- [Semantic tokens](https://domestic-ui.odonckers.dev/tokens/semantic.md): 201 tokens, public theming API.

## Tiers

From [Theming](https://domestic-ui.odonckers.dev/principles/theming.md):

| Tier | File | Named by | Example | Public? |
| --- | --- | --- | --- | --- |
| Primitive | `css/tokens/primitives.css` | What it is | `--dui-color-indigo-9: oklch(53% 0.215 272);` `--dui-space-5: 1rem;` | No. Internal, may change in any release. |
| Semantic | `css/tokens/semantic.css` | What it is for | `--dui-color-accent: light-dark(var(--dui-color-neutral-12), var(--dui-color-neutral-dark-12));` | **Yes.** The stable theming API. |
