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.

RoleVariableUsed for
Page--backgroundThe page behind everything
Surface--cardCards, menus and the sidebar
Line--borderBorders and dividers
Ink--foregroundHeadings and body text
Muted--muted-foregroundHints, captions and secondary text
Primary--primaryThe main button
On primary--primary-foregroundText on the main button
Accent--ringLinks, focus rings and the first chart series
Danger--destructiveErrors and destructive actions
Highlight--dc-highlightSelected rows, tags and marked words
On highlight--dc-highlight-fgText on the highlight
Band--dc-bandThe one full-width colored section
On band--dc-band-fgText on the band
Band button--dc-band-primaryThe main button when it sits on the band
On band button--dc-band-primary-fgText 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.

ThemeFontsCorners
MonoGeist10px controls, 14px cards
CobaltInter Tight and Inter8px controls, 12px cards
MatchaFraunces and Instrument Sans10px controls, 16px cards
HarborManrope10px controls, 14px cards
PopBricolage Grotesque and DM Sans10px controls, 14px cards
MidnightGeist8px controls, 12px cards
KleinInstrument Serif and DM Sans6px controls, 10px cards
SorbetPlus Jakarta Sans12px controls, 18px cards
Hi-VisBarlow Condensed and Barlow4px 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
/* 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.