Conservation for shadcn/ui

Conservation is a shadcn/ui theme built around a vivid deep green primary color (#0c2602) with muted light green accents (#dee5dc). The light mode uses a neutral background (#f9fdf7). Dark mode keeps the vivid deep green primary (#0c2602) on a neutral background (#020401).

Color palette

TokenLightDark
Background
#f9fdf7mintcream
#020401black
Foreground
#000000black
#ffffffwhite
Card
#f6fbf3whitesmoke
#040703black
Card foreground
#000000black
#ffffffwhite
Popover
#f6fbf3whitesmoke
#040703black
Popover foreground
#000000black
#ffffffwhite
Primary
#0c2602black
#0c2602black
Primary foreground
#48e60flimegreen
#48e60flimegreen
Secondary
#dee5dcgainsboro
#161914black
Secondary foreground
#42523ddarkslategray
#acb9a7darkgray
Muted
#e5efe1beige
#141e10black
Muted foreground
#474847darkslategray
#b7b8b7silver
Accent
#dee5dcgainsboro
#161914black
Accent foreground
#42523ddarkslategray
#acb9a7darkgray
Destructive
#913503saddlebrown
#f05705orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0c2602black
#0c2602black

Contrast

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

Light mode
Text on background20.35:1AAA
Text on card20.03:1AAA
Primary button9.70:1AAA
Secondary button6.52:1AA
Muted text7.75:1AAA
Accent6.52:1AA
Destructive7.75:1AAA
Dark mode
Text on background20.60:1AAA
Text on card20.22:1AAA
Primary button9.70:1AAA
Secondary button8.63:1AAA
Muted text8.65:1AAA
Accent8.63:1AAA
Destructive3.45:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.008 137.208);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.94 0.02 137.241);
  --muted-foreground: oklch(0.401 0.003 137.205);
  --popover: oklch(0.982 0.012 137.218);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.982 0.012 137.218);
  --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.24 0.069 138.027);
  --primary-foreground: oklch(0.811 0.259 140.244);
  --secondary: oklch(0.914 0.014 137.226);
  --secondary-foreground: oklch(0.419 0.04 137.443);
  --accent: oklch(0.914 0.014 137.226);
  --accent-foreground: oklch(0.419 0.04 137.443);
  --destructive: oklch(0.454 0.135 41.978);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.24 0.069 138.027);
  --chart-1: oklch(0.24 0.069 138.027);
  --chart-2: oklch(0.914 0.014 137.226);
  --chart-3: oklch(0.914 0.014 137.226);
  --chart-4: oklch(0.936 0.011 137.216);
  --chart-5: oklch(0.242 0.071 138.008);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.097 0.013 135.86);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.219 0.029 137.574);
  --muted-foreground: oklch(0.782 0.002 137.196);
  --popover: oklch(0.123 0.017 135.86);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.123 0.017 135.86);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.24 0.069 138.027);
  --primary-foreground: oklch(0.811 0.259 140.244);
  --secondary: oklch(0.21 0.011 137.322);
  --secondary-foreground: oklch(0.77 0.028 137.277);
  --accent: oklch(0.21 0.011 137.322);
  --accent-foreground: oklch(0.77 0.028 137.277);
  --destructive: oklch(0.654 0.201 40.612);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.24 0.069 138.027);
  --chart-1: oklch(0.24 0.069 138.027);
  --chart-2: oklch(0.21 0.011 137.322);
  --chart-3: oklch(0.21 0.011 137.322);
  --chart-4: oklch(0.244 0.014 137.336);
  --chart-5: oklch(0.242 0.071 138.008);
}