refract v0.1 · beta
Grammar reference / Override axes

Override axes

variants, modes, and responsive all carry override sets — they differ in what the engine does with them. modes / responsive (and recipe states) are arrays of overrides over one spine: WHEN (mode/state/breakpoint) · WHERE (target) · WHAT (the override set). variants is a map, because the name mints an identity.

the three axes
variants: {                                       // MAP — each key mints a NEW named token
  "[variant name]": { /* override set */ },
},
modes: [                                          // LIST — a conditional re-declaration per mode
  { mode: "[mode name]", /* override set */ },
  { mode: "[mode name]", target: "[variant name]", /* … */ }, // target → scope into a variant's var
],
responsive: [                                     // LIST — override set + routing
  { breakpoint: "[breakpoint name]", query: "min|max|exact", ref: "[variant name]" },
  { breakpoint: "[breakpoint name]", mode: "[mode name]", /* override set */ },
]
AxisShapeEffect
variantsmapEach entry mints a new named token referenceable anywhere. Base optional → inherits. See Variants & targets.
modeslistA conditional re-declaration of the property's vars per mode (from the registry); target scopes it into a variant's var. Adapters realize it as prefers-color-scheme / [data-theme].
responsivelistOverride at a breakpoint (+ query/orientation/mode). ref (read) and target (write) compose. See Responsive.
WHERE — target. On a mode it scopes the override onto a variant's var; on a recipe state it scopes onto a <item>-<variant> sibling — so two same-condition entries can behave differently. Omit → the base var / base rule.
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.