Consonant for shadcn/ui

Consonant is a shadcn/ui theme built around a muted green primary color (#b6caa0) with muted green accents (#a1caa0). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted green primary (#b6caa0) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#030401black
#f7f9f6whitesmoke
Card
#fcfcfcsnow
#030303black
Card foreground
#000000black
#fafbf9snow
Popover
#fcfcfcsnow
#030303black
Popover foreground
#000000black
#fafbf9snow
Primary
#b6caa0silver
#b6caa0silver
Primary foreground
#1c2414black
#1c2414black
Secondary
#cac9a0tan
#cac9a0tan
Secondary foreground
#242414black
#242414black
Muted
#ebebe0beige
#1f1f14black
Muted foreground
#454545darkslategray
#bababasilver
Accent
#a1caa0darkseagreen
#a1caa0darkseagreen
Accent foreground
#142414black
#142414black
Destructive
#c2210ffirebrick
#ef422etomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b6caa0silver
#b6caa0silver

Contrast

WCAG 2 contrast ratios between each background and its foreground color.

Light mode
Text on background20.55:1AAA
Text on card20.54:1AAA
Primary button9.08:1AAA
Secondary button9.25:1AAA
Muted text7.96:1AAA
Accent8.86:1AAA
Destructive5.95:1AA
Dark mode
Text on background19.83:1AAA
Text on card19.92:1AAA
Primary button9.08:1AAA
Secondary button9.25:1AAA
Muted text8.58:1AAA
Accent8.86:1AAA
Destructive3.82:1AA Large

CSS variables

Paste this into your globals.css to use Consonant in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.102 0.018 126.588);
  --muted: oklch(0.936 0.014 105.881);
  --muted-foreground: oklch(0.39 0 165.964);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.812 0.061 128.698);
  --primary-foreground: oklch(0.247 0.03 129.365);
  --secondary: oklch(0.826 0.055 106.732);
  --secondary-foreground: oklch(0.254 0.027 107.345);
  --accent: oklch(0.798 0.072 144.441);
  --accent-foreground: oklch(0.241 0.036 143.973);
  --destructive: oklch(0.525 0.198 30.509);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.812 0.061 128.698);
  --chart-1: oklch(0.812 0.061 128.698);
  --chart-2: oklch(0.826 0.055 106.732);
  --chart-3: oklch(0.798 0.072 144.441);
  --chart-4: oklch(0.844 0.049 106.602);
  --chart-5: oklch(0.817 0.067 128.793);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.98 0.005 127.846);
  --muted: oklch(0.235 0.019 106.976);
  --muted-foreground: oklch(0.789 0 171.254);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(0.987 0.003 127.827);
  --card: oklch(0.092 0 180);
  --card-foreground: oklch(0.987 0.003 127.827);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.812 0.061 128.698);
  --primary-foreground: oklch(0.247 0.03 129.365);
  --secondary: oklch(0.826 0.055 106.732);
  --secondary-foreground: oklch(0.254 0.027 107.345);
  --accent: oklch(0.798 0.072 144.441);
  --accent-foreground: oklch(0.241 0.036 143.973);
  --destructive: oklch(0.633 0.213 30.238);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.812 0.061 128.698);
  --chart-1: oklch(0.812 0.061 128.698);
  --chart-2: oklch(0.826 0.055 106.732);
  --chart-3: oklch(0.798 0.072 144.441);
  --chart-4: oklch(0.844 0.049 106.602);
  --chart-5: oklch(0.817 0.067 128.793);
}