Skip to main content
SebasVergaraP

Control engineer and full-stack WordPress developer.

Design token pipeline

One source of truth for colour, type and space, compiled to CSS custom properties and to theme.json without either drifting.

A token layer only works if there is exactly one place a value is written down. This is the pipeline that keeps the palette, the type scale and the spacing rhythm in a single file, and derives everything else from it.

The problem

WordPress exposes theme.json presets as --wp--preset--* custom properties. Hand-maintaining a second list of aliases alongside them guarantees drift, and drift in a colour token is invisible until it is a contrast failure.

Result

  • Colour literals exist in exactly two files, and both are generated.
  • Adding a token is a one-line change, not a search and replace.
  • Contrast ratios are asserted in a test rather than reviewed by eye.

All projects