Customization/Colours and modes

Colours and modes

One brand colour runs through every button, link, selection and chart, and every colour has a light and a dark value. Pick a built-in theme colour, set your own, or add a whole palette.

DashboardPreview
The Dashboard with the Neutral theme colour, the default
The Dashboard with the Neutral theme colour, the default

How colour tokens work

Colours are --ac-* variables in src/app/globals.css: one set for light mode on :root and one for dark mode on .dark. Tailwind turns each into a utility, and components only use those:

UtilityUsed for
bg-appBg, bg-sidebarBg, bg-panelBg, bg-cardSurfaces
text-textPrimary, -Secondary, -Muted, -SubtleText
border-borderDarkHairline borders
bg-brand, text-brandText, bg-brandSoftButtons, links, selection and highlights

Theme colours

Accordee comes with seven: Neutral (the default, near-black ink), Blue, Violet, Rose, Orange, Green and Teal. People pick one in Themes at the foot of the sidebar, or in Settings › Preferences. Each is a small block with a light and a dark value:

src/app/globals.css
html[data-accent="blue"] {
  --ac-brand: #2563eb;       /* buttons, highlights, first chart colour */
  --ac-brand-text: #1d4ed8;  /* links and brand-coloured text */
}
html.dark[data-accent="blue"] {
  --ac-brand: #3b82f6;
  --ac-brand-text: #60a5fa;
}

From those two values the rest follows: the soft selection fill, the focus ring, the first chart series and the shades of the ageing chart are all mixed from --ac-brand.

Your own brand colour

  • The quickest way: set --ac-brand and --ac-brand-text on :root and .dark to your colour. Everyone sees it, and you can remove the Theme colour choice.
  • Keep the picker: change one of the preset blocks to your colour and rename it in ACCENTS in components/providers/theme-provider.tsx.
  • Add your own palette: add an id to the Accent type and an entry to ACCENTS (label and swatch), then a light and a dark html[data-accent="…"] block. It appears in Themes and Settings with the others.

For a different neutral palette (warmer greys, a tinted sidebar), change the surface and text tokens on :root and .dark, like --ac-sidebar-bg and --ac-text-muted.

Light and dark mode

The app starts in Light. People can choose Light, Dark or System (follows the device) in Themes or Settings › Preferences. The choice is saved in the browser and applied before the page first appears, so there's never a flash of the wrong mode.

Dark mode is the dark class on <html>. Because every token has a dark value, anything you build from the tokens gets dark mode for free.

Keep text readable

Brand colours often work on buttons but not as text. That's why there are two tokens: --ac-brand-text is a deeper shade in light mode and a lighter one in dark mode, so links stay readable on both backgrounds.

When you add a colour, check its text against the page in both modes: aim for a contrast of at least 4.5:1 for normal text (any contrast checker will tell you). Button labels on bg-brand are white, so very light brand colours need a darker shade.