Token system.

Three tiers, one direction of reference. A primitive holds a raw value; a semantic token gives it a role; a component token wires that role to one part of one component. Implementers read the --tasty-* name — the value resolves down the chain.

1 primitive · raw value 2 semantic · role 3 component · part
Tier 1 · Primitive

The only literals

Context-free raw values on numeric scales. No roles, no opinions. Theme lives here (Mocha / Latte re-point the same names).

--tasty-color-blue: #89b4fa
--tasty-size-4: 4px
--tasty-font-size-13: 13px
✗ never referenced by components or app code
Tier 2 · Semantic

Roles & intent

Every value points at a primitive — never a literal. This is what app code and the component layer read.

--tasty-accent-primary: var(--tasty-color-blue)
--tasty-space-md: var(--tasty-size-12)
✓ read these in app code
Tier 3 · Component

Per-component knobs

One token per styled part of one component, pointing at a semantic role. The contract an implementer copies.

--tasty-button-primary-bg: var(--tasty-accent-primary)
✓ re-theme a component by overriding only its tokens

Reading a chain

The blue primitive becomes the primary accent, which the Button's primary background reads. Change --tasty-color-blue once and every consumer downstream follows.

Color chains

1Primitive 2Semantic 3Component tokens

Spacing · sizing · radius chains

1Primitive 2Semantic 3Component tokens

Type & motion chains

1Primitive 2Semantic 3Component tokens