refract v0.1 · beta
Grammar reference / Properties

Properties

A property is a uniform map of named fields (each → a CSS variable) plus the three override axes. The reserved field base is the primary value → the unsuffixed --<prop> var; any other name is an extra → --<prop>-<field>.

a property
// (a) bare form — shorthand for { base: value }. Single-primary-field props only.
"[property name]": "value",

// (b) full form — a field map + the override axes.
"[property name]": {
  base: "value",               // the primary field → the unsuffixed var
  "[field name]": "value",       // an extra field → the --…-[field] var

  variants:   { "[variant name]": { /* override set */ } },  // §4 · a NEW named token per variant
  modes:      [ { mode: "[mode name]", /* override set */ } ], // §4 · a conditional re-declaration per mode
  responsive: [ { breakpoint: "[breakpoint name]", /* override set + routing */ } ],
}
  • One uniform field map. Every field is the same kind (a name → a var); base is just the reserved primary. Adapters emit one variable per field.
  • Object-leaf props omit base. shadow / transitions compose the primary value from flat leaves (Effects), so the bare form isn't available for them.
  • The axes carry override sets. variants, modes, and responsive each hold an override set — see Override axes for what each does.
Subsystem-specific keys ride on top of this shape — colours' steps / harmony, layout's ratio / steps, animation's keyframes. See each subsystem page.
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.