Themes and environment
Theme supplies scoped tokens; Direction supplies logical direction. Host
appearance, text scaling, and reduced motion still affect rendering.
Token families
| Family | Values / bounds |
|---|---|
| colors | Hex #RRGGBB / #RRGGBBAA, or light/dark variants |
| radii | Finite 0–256 logical units |
| fonts | Finite 8–256 logical units |
| recipes | Base/control-state presentation assignments |
Token names are lowercase letters/digits/hyphens, begin with a lowercase letter, and are at most 64 characters. Each dictionary allows at most 128 entries.
Example
<Theme bind-tokens="{colors:{'rc-brand':{light:'#165C43',dark:'#8FE3BC'}}}">
<Text text="Scoped color" class="text-rc-brand" />
</Theme>
Default native palette
Native defaults use Tailwind’s color palette: zinc for backgrounds, surfaces, text, and borders; blue for interactive emphasis; red for destructive actions; green for success; and amber for warnings.
| Role | Light | Dark |
|---|---|---|
background | zinc-50 | zinc-950 |
card, surface | white | zinc-900 |
accent, ring | blue-600 | blue-400 |
on-accent | white | blue-950 |
danger | red-600 | red-400 |
on-danger | white | red-950 |
success | green-700 | green-300 |
on-success | white | green-950 |
warning | amber-700 | amber-300 |
Use padding around a card to expose the containing background. The preview canvas uses the default background role so unstyled roots and card examples stay distinct.
Native and Components roles
Native accent / on-accent and Components rc-primary /
rc-primary-foreground have separate ownership. Native primary retains its
text-color meaning. Override foreground/background pairs together; aliases are
not automatically linked by one-sided overrides. ui:Theme installs library
colors, fonts, radii, and recipes. Unknown rc-* tokens/recipes fail validation.
Direction and policy
<Direction value="rtl">
<Column class="ps-4"><Text text="Logical padding" /></Column>
</Direction>
Direction accepts ltr / rtl. Logical padding and inline translation follow it;
physical left/right/X utilities stay physical. Scoped motion accepts system,
reduced, and off and cannot force more motion than the host allows.