@sub-design/tokens
v0.14.0
Published
Three layers, per the delivery-0 token inventory:
Readme
@sub-design/tokens
Three layers, per the delivery-0 token inventory:
| File | Layer | Contents |
| --- | --- | --- |
| reference.css | 1 | Raw palettes and scales (--ref-*). Never consumed by components. |
| contract.css | 2 + 3 | Semantic roles and component tokens. The full list of variables @sub-design/ui reads. |
Rules
- Components read only layer 2 and 3 variables. A
--ref-*reference inside a component is a bug — it hard-codes a palette into portable code. - A component token is justified only by a repeated, durable difference
between brands.
--button-radiusqualifies (6px rectangle vs. pill). Duplicating every CSS property as a token does not. - Focus geometry lives in layer 2, not layer 3. It is an accessibility guarantee rather than a brand decision, so brands do not get to shrink it.
Color format
Authored in OKLCH. Every consuming product targets a 2023+ browser baseline
where oklch() is supported, and NOKL already ships OKLCH in production.
Open question carried from delivery 0: whether future GoodSync desktop surfaces
embed a WebView, and on which Chromium. That is the only scenario that would
require a fallback output. Because the values live in this one place, adding an
sRGB fallback later is a build-step change, not a re-authoring of themes.
