Theming
Color roles, light and dark, fonts and corners
A DressCode theme is a set of values. It fills in the same color roles for every theme, maps them onto shadcn/ui's variables, and adds its fonts and corners. Nothing in your components refers to a theme by name, so switching themes changes values only.
Color roles
Every theme fills in these roles. Most of the screen is page and surface; the main color goes on actions; the band is one full-width section per page; the highlight is for small marks. Each theme's page lists its hex values, for example Sorbet.
| Role | Variable | Used for |
|---|---|---|
| Page | --background | The page behind everything |
| Surface | --card | Cards, menus and the sidebar |
| Line | --border | Borders and dividers |
| Ink | --foreground | Headings and body text |
| Muted | --muted-foreground | Hints, captions and secondary text |
| Primary | --primary | The main button |
| On primary | --primary-foreground | Text on the main button |
| Accent | --ring | Links, focus rings and the first chart series |
| Danger | --destructive | Errors and destructive actions |
| Highlight | --dc-highlight | Selected rows, tags and marked words |
| On highlight | --dc-highlight-fg | Text on the highlight |
| Band | --dc-band | The one full-width colored section |
| On band | --dc-band-fg | Text on the band |
| Band button | --dc-band-primary | The main button when it sits on the band |
| On band button | --dc-band-primary-fg | Text on that button |
The rest of shadcn's variables (--secondary, --muted, --accent, --input, the chart and sidebar colors) are derived from these, so stock components have everything they read.
Light and dark
Every role has a light and a dark value. The light set sits on :root, the dark set on .dark, and every text and control pair passes WCAG AA contrast in both. Dark versions keep the theme's character: Sorbet keeps its lilac band and orange button, Hi-Vis its yellow band on carbon.
Fonts and corners
Each theme brings one to three families from Google Fonts, loaded with next/font: --font-sans for text, --font-heading for headings where the theme has a display face, and --font-mono for figures where it has a mono. --radius sets the controls; cards and dialogs use --dc-radius-card.
| Theme | Fonts | Corners |
|---|---|---|
| Mono | Geist | 10px controls, 14px cards |
| Cobalt | Inter Tight and Inter | 8px controls, 12px cards |
| Matcha | Fraunces and Instrument Sans | 10px controls, 16px cards |
| Harbor | Manrope | 10px controls, 14px cards |
| Pop | Bricolage Grotesque and DM Sans | 10px controls, 14px cards |
| Midnight | Geist | 8px controls, 12px cards |
| Klein | Instrument Serif and DM Sans | 6px controls, 10px cards |
| Sorbet | Plus Jakarta Sans | 12px controls, 18px cards |
| Hi-Vis | Barlow Condensed and Barlow | 4px controls, 8px cards |
Template classes
The theme also adds a few classes. The Orbit templates use them; your own pages can too.
dc-themeThe page: background, text color and the theme's body font.dc-hA heading in the theme's display font, weight and tracking.dc-numFigures in the theme's number font, tabular.dc-cardA card: surface, hairline (an ink outline in Pop) and the theme's shadow.dc-bandThe one full-width colored section; text and the main button switch to the band's pair.dc-pill, dc-pill-hl, dc-pill-dangerSmall status pills: plain, highlighted and for problems.dc-brutalOn <html> or a wrapper in Pop: buttons get the ink outline and the hard shadow.
Changing it
The values live in your CSS, so change them there. To use your own main color, override the variables that carry it, in both modes:
/* app/globals.css, below what the theme added */
:root {
--primary: #8a1c3a; /* your main button */
--ring: #8a1c3a; /* focus rings */
--dc-accent: #8a1c3a; /* links and active items in the templates */
}
.dark {
--primary: #e07a95;
--ring: #e07a95;
--dc-accent: #e07a95;
}Keep it readable
Text on a fill needs a 4.5:1 contrast and a control's edge 3:1. The themes are checked with tools/dresscode-contrast.mjs; run it on your own values the same way.