Theming
Customize the design system to match your brand.
How theming works
The design system uses CSS variables for all visual tokens. Two files control the theme:
tokens.css— defines raw CSS variables in:root(light) and.darkscopestheme.css— bridges those variables to Tailwind v4 utility classes via@theme inline
tokens.css holds the Retents brand values and is the single source of truth for colors, radius and fonts. When to use each theme per channel (site, product, email, print) is described in Brand → Temas.
Quick customization
Override any variable after importing the defaults:
@import "tailwindcss";
@import "@retents/ui/tokens.css";
@import "@retents/ui/theme.css";
@source "./node_modules/@retents/ui/src/**/*.tsx";
@layer base {
:root {
--radius: 12px; /* Example: tighter corners */
}
}Available tokens
Colors
These are the Retents brand values: this package is the source of truth for every visual value. The full palette with hex codes is in Colors.
| Token | Light default | Dark default | Usage |
|---|---|---|---|
--background | 0 0% 100% (#ffffff) | 0 0% 0% (#000000) | Page background |
--foreground | 0 0% 4% (#0a0a0a) | 0 0% 97.6% (#f9f9f9) | Default text |
--card | 0 0% 98% (#f9f9f9) | 0 0% 3.9% (#0a0a0a) | Surfaces |
--popover | 0 0% 95% (#f3f3f3) | 0 0% 6.7% (#111111) | Elevated surfaces |
--primary | 18 91% 41% (#c94208) | 21 91% 48% (#e7580f) | Brand orange |
--secondary | 0 0% 96% | 0 0% 7.5% (#131313) | Secondary elements |
--muted-foreground | 0 0% 42% (#6b6b6b) | 0 0% 53% (#878787) | Supporting text |
--destructive | 0 72.2% 93.6% | 0 75% 60% | Error/danger |
--border | 0 0% 92% (#ebebeb) | 0 0% 7.8% (#141414) | Default borders |
--input | 0 0% 92% | 0 0% 7.8% | Input backgrounds |
--ring | 18 91% 41% | 21 91% 48% | Focus rings |
Radius
| Token | Default |
|---|---|
--radius | 16px (surfaces); controls use --radius - 6px = 10px |
Consumer setup
The @source directive is essential for Tailwind v4 to scan component files and generate the right utility classes:
@source "./node_modules/@retents/ui/src/**/*.tsx";Dark mode
Dark mode is class-based. Toggle by adding class="dark" to <html>:
// With next-themes
<html className={theme === "dark" ? "dark" : ""}>All tokens automatically switch to their .dark variants.
Using tokens in JavaScript
For non-Tailwind consumers:
import { colors, radius } from "@retents/ui/tokens"
console.log(colors.primary.DEFAULT) // "hsl(var(--primary))"
console.log(radius.lg) // "var(--radius)"