Retents UI

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 .dark scopes
  • theme.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:

app/globals.css
@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.

TokenLight defaultDark defaultUsage
--background0 0% 100% (#ffffff)0 0% 0% (#000000)Page background
--foreground0 0% 4% (#0a0a0a)0 0% 97.6% (#f9f9f9)Default text
--card0 0% 98% (#f9f9f9)0 0% 3.9% (#0a0a0a)Surfaces
--popover0 0% 95% (#f3f3f3)0 0% 6.7% (#111111)Elevated surfaces
--primary18 91% 41% (#c94208)21 91% 48% (#e7580f)Brand orange
--secondary0 0% 96%0 0% 7.5% (#131313)Secondary elements
--muted-foreground0 0% 42% (#6b6b6b)0 0% 53% (#878787)Supporting text
--destructive0 72.2% 93.6%0 75% 60%Error/danger
--border0 0% 92% (#ebebeb)0 0% 7.8% (#141414)Default borders
--input0 0% 92%0 0% 7.8%Input backgrounds
--ring18 91% 41%21 91% 48%Focus rings

Radius

TokenDefault
--radius16px (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)"

On this page