refract v0.1 · beta
Grammar reference / Top-level registries

Top-level registries

A handful of top-level keys are registries — declared once, referenced by name everywhere else (the name is typo-validated, like a scale). Everything else at the top level is a subsystem slice.

Reading these pages. [bracketed] = an author-chosen name; reserved words (base, variants, modes, ref, …) are literal; "value" / 0 = a leaf value. This is the generic shape — the subsystem pages carry the worked examples.
RawTheme (top level)
{
  breakpoints: { "[breakpoint name]": 0 },                // name → min-width px
  containers:  { "[container name]": { type: "inline-size", sizes: { "[size name]": 0 } } },
  modes:       [ "[mode name]" ],                       // appearance-mode registry (defaults to ["dark","light"])
  extends:     { prefix: "[parent var prefix]" },        // for external tokens (default "dt")

  "[subsystem]": { /* … a subsystem slice … */ },       // colors / typography / layout / …
}
RegistryShapeReferenced by
breakpointsname → pxA responsive entry's breakpoint (Responsive). Omit for the engine defaults.
containersname → { type?, sizes }A recipe { container, size } override (Container queries). type defaults to inline-size.
modesstring[]A property modes entry's mode (Override axes). An undeclared mode throws. dark/light bind to prefers-color-scheme; any other name is a [data-theme] toggle.
extends.prefixstringThe parent theme's CSS-variable prefix, used to lower a path-form external token (Values).
Registries are validated up-front — a responsive breakpoint, container name, or mode that isn't declared is a build error, not silent output.
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.