lt;prefix>-…, .<prefix>-…). Surfaces: theme.scss · .classes." /> lt;prefix>-…, .<prefix>-…). Surfaces: theme.scss · .classes." />
refract v0.1 · beta
Adapters / SCSS

SCSS adapter createScssAdapter

Emits Sass source — $variables + classes ($<prefix>-…, .<prefix>-…). Surfaces: theme.scss · .classes.

OptionTypeDefaultDescription
prefixstring"dt"Identifier prefix for $variables and class names.
inlinebooleanfalseInline resolved values instead of $var references.
indentnumber2Indentation width (spaces).
layerstring | booleanWrap all emitted SCSS in a named cascade @layer (truerefract) — compiles to a CSS @layer for deterministic precedence below unlayered app CSS. The SCSS twin of the CSS adapter's layer.
theme.ts
import { createScssAdapter } from "@theme-registry/refract-scss";

const theme = createTheme(raw, { adapter: createScssAdapter({ indent: 2 }) });
theme.scss; // → $dt-colors-brand: …;  .dt-components-buttons-primary { … }

Tokens lower to compile-time $variables (not :root custom properties), and rule-sets nest state / breakpoint overrides idiomatically with & and @media. Synthesized colour steps are baked as concrete values — the same class surface as CSS, from a Sass source:

theme.scss (emitted)
// tokens → $variables (tonal steps synthesized at build)
$dt-colors-brand: rgb(76, 110, 245);
$dt-colors-brand-light: rgb(145, 167, 255);
$dt-colors-brand-dark: rgb(59, 91, 219);
$dt-colors-brand-text: rgb(255, 255, 255);

// recipes → classes; state overrides nest with &
.dt-components-buttons-primary {
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  &:hover { transform: translateY(-1px); }
}
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.