Themes
Pick a base and an accent.
A base tints the surfaces, text and lines; an accent sets the primary colour and the focus ring. Every pairing is checked for readable contrast in light and dark.
Base · surfaces, text and lines
Accent · primary colour and focus ring
Project settings
Changes apply to the next deployment.
In your project
npx ermineui theme slate blueOr paste the CSS at the end of your theme stylesheet
:root {
/* Surfaces and text */
--er-background: light-dark(oklch(1 0 0), oklch(0.145 0.042 264.7));
--er-foreground: light-dark(oklch(0.145 0.042 264.7), oklch(0.985 0.003 247.9));
--er-card: light-dark(oklch(1 0 0), oklch(0.205 0.042 265.8));
--er-card-foreground: light-dark(oklch(0.145 0.042 264.7), oklch(0.985 0.003 247.9));
--er-popover: light-dark(oklch(1 0 0), oklch(0.225 0.042 265.8));
--er-popover-foreground: light-dark(oklch(0.145 0.042 264.7), oklch(0.985 0.003 247.9));
/* Actions (an accent theme replaces the primary colour and the ring) */
--er-primary: light-dark(oklch(0.205 0.042 265.8), oklch(0.922 0.014 255.5));
--er-primary-foreground: light-dark(oklch(0.985 0.003 247.9), oklch(0.205 0.042 265.8));
--er-secondary: light-dark(oklch(0.965 0.007 247.9), oklch(0.269 0.041 260));
--er-secondary-foreground: light-dark(oklch(0.205 0.042 265.8), oklch(0.985 0.003 247.9));
--er-muted: light-dark(oklch(0.965 0.007 247.9), oklch(0.269 0.041 260));
--er-muted-foreground: light-dark(oklch(0.5 0.044 257.3), oklch(0.708 0.04 256.8));
--er-accent: light-dark(oklch(0.965 0.007 247.9), oklch(0.3 0.042 260));
--er-accent-foreground: light-dark(oklch(0.205 0.042 265.8), oklch(0.985 0.003 247.9));
/* Lines and focus */
--er-border: light-dark(oklch(0.915 0.015 255.5), oklch(1 0 0 / 12%));
--er-input: light-dark(oklch(0.87 0.022 252.9), oklch(1 0 0 / 18%));
--er-ring: light-dark(oklch(0.45 0.043 257.3), oklch(0.75 0.035 256.8));
}
:root {
--er-primary: light-dark(oklch(0.546 0.215 262), oklch(0.707 0.15 254));
--er-primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.2 0.05 262));
--er-ring: light-dark(oklch(0.546 0.215 262), oklch(0.707 0.15 254));
}Using a theme
In a new project
Pass the pair to init, and the theme stylesheet it copies starts with them applied.
npx ermineui init --theme slate,bluepnpm dlx ermineui init --theme slate,blueyarn dlx ermineui init --theme slate,bluebunx ermineui init --theme slate,blueIn a project already set up
Name a base, an accent, or both. Picking one kind keeps the other, so the second line below keeps the slate base and swaps the accent. --reset removes both, back to your stylesheet's own colours. Run theme on its own to list the themes and see which ones you are using.
npx ermineui theme slate blue
npx ermineui theme rose
npx ermineui theme --resetpnpm dlx ermineui theme slate blue
pnpm dlx ermineui theme rose
pnpm dlx ermineui theme --resetyarn dlx ermineui theme slate blue
yarn dlx ermineui theme rose
yarn dlx ermineui theme --resetbunx ermineui theme slate blue
bunx ermineui theme rose
bunx ermineui theme --resetWhat changes in your stylesheet
Each theme goes at the end of your theme stylesheet as a :root block of --er-* variables, between two marker comments. The next theme command replaces only what sits between those markers, so the rest of the file, including your own edits, stays as it is. This is the block for blue:
/* ermine theme accent: blue. "ermine theme" replaces this block when you pick another accent.
To fine-tune a colour, set it again in a rule after this block. */
:root {
--er-primary: light-dark(oklch(0.546 0.215 262), oklch(0.707 0.15 254));
--er-primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.2 0.05 262));
--er-ring: light-dark(oklch(0.546 0.215 262), oklch(0.707 0.15 254));
}
/* end ermine theme accent */Every component reads these variables, so nothing else needs changing. Dark mode works as before: each value holds a light and a dark colour in light-dark().
Adjusting a colour
Don't edit inside the markers, because the next theme command replaces that block. Set the variable again in a rule after it:
/* After the theme's block, so it wins */
:root {
--er-primary: light-dark(oklch(0.5 0.22 262), oklch(0.75 0.14 254));
}Without the command line
Choose a pair in the picker above, open Or paste the CSS, and paste the CSS at the end of your theme stylesheet. Put the base before the accent, because both set the primary colour and the later one wins. To theme only one section, change :root to a selector for that section:
/* The rose accent for one part of the page only */
.campaign {
--er-primary: light-dark(oklch(0.56 0.21 17), oklch(0.73 0.15 12));
--er-primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.2 0.05 17));
--er-ring: light-dark(oklch(0.56 0.21 17), oklch(0.73 0.15 12));
}From an AI coding tool
Tools connected to ermine mcp can apply themes with its set_theme tool. Ask for "the slate base with a blue accent" and the tool writes the same blocks the command does.
Bases
neutral: Pure greys with no tint. The default.blush: Greys with a soft pink tint.stone: Warm, slightly brown greys.sand: Warm greys with a soft golden tint.olive: Greys with a soft yellow-green tint.sage: Greys with a soft green tint.mist: Cool greys with a soft blue-green tint.slate: Cool, blue-tinted greys.zinc: Greys with the faintest violet cast.mauve: Greys with a soft purple tint.
Accents
rose: The primary colour and focus ring in rose.red: The primary colour and focus ring in red.orange: The primary colour and focus ring in orange.amber: The primary colour and focus ring in amber.green: The primary colour and focus ring in green.teal: The primary colour and focus ring in teal.cyan: The primary colour and focus ring in cyan.blue: The primary colour and focus ring in blue.indigo: The primary colour and focus ring in indigo.violet: The primary colour and focus ring in violet.fuchsia: The primary colour and focus ring in fuchsia.pink: The primary colour and focus ring in pink.
With no accent, the primary colour is the base's own near-black (near-white in the dark theme).