refract v0.1 · beta
Grammar reference / Override sets

Override sets

The value carried by each entry of variants / modes / responsive is an override set — one of three forms. The two object forms are mutually exclusive: base/fields and ref never coexist.

override set forms
// (a) bare — just the primary value (variants / modes only)
"value"

// (b) literal object — the same field map as a property; omitted fields INHERIT the property's
{ "[field name]": "value" }

// (c) derivation — read `ref`, then fold the `modifiers` chain over it (mutually exclusive with b)
{ ref: "[source token]", modifiers: [ { "[fn]": "[args]" } ] }
  • ref defaults to the own base. Omit it to derive from the property's own primary value; name another variant/step, or a cross-property token path — resolved post-build and re-derived on override().
  • modifiers is an ordered chain. Single-key dials applied left-to-right (colours' { darken } / { lighten } / { alpha } / { adjust } — see Colors). No modifiers = a plain ref swap.
  • Base is optional and inherits. A literal set may override only an extra field, leaving the primary as-is.
The same { ref, modifiers } derivation is the value form for a variant, a mode, and a responsive entry — one grammar across all three axes.
Technical documentation for @theme-registry/refract · all output is compiled client-side by the real library (CSS adapter). The chrome is theme-aware; the render panes carry each preset's own world. · MIT licensed.