Cooperative for shadcn/ui

Cooperative is a shadcn/ui theme built around a muted deep green primary color (#4d5634) with muted deep violet accents (#3c3456). The light mode uses a neutral background (#fcfdf7). Dark mode keeps the muted deep green primary (#4d5634) on a green-tinted background (#0c0d07).

Color palette

TokenLightDark
Background
#fcfdf7snow
#0c0d07black
Foreground
#000000black
#f8f8f6whitesmoke
Card
#fafcf2floralwhite
#0f1109black
Card foreground
#000000black
#fafbf9snow
Popover
#fafcf2floralwhite
#0f1109black
Popover foreground
#000000black
#fafbf9snow
Primary
#4d5634darkolivegreen
#4d5634darkolivegreen
Primary foreground
#e2e6d6gainsboro
#e2e6d6gainsboro
Secondary
#3c3456darkslategray
#3c3456darkslategray
Secondary foreground
#dad6e6gainsboro
#dad6e6gainsboro
Muted
#d8d5e2gainsboro
#201d2ablack
Muted foreground
#615f67dimgray
#9a98a0darkgray
Accent
#3c3456darkslategray
#3c3456darkslategray
Accent foreground
#dad6e6gainsboro
#dad6e6gainsboro
Destructive
#cb1710firebrick
#e21912red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4d5634darkolivegreen
#4d5634darkolivegreen

Contrast

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

Light mode
Text on background20.53:1AAA
Text on card20.30:1AAA
Primary button6.11:1AA
Secondary button8.13:1AAA
Muted text4.34:1AA Large
Accent8.13:1AAA
Destructive5.73:1AA
Dark mode
Text on background18.32:1AAA
Text on card18.35:1AAA
Primary button6.11:1AA
Secondary button8.13:1AAA
Muted text5.78:1AA
Accent8.13:1AAA
Destructive4.77:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.992 0.009 117.981);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.879 0.018 297.465);
  --muted-foreground: oklch(0.492 0.013 297.364);
  --popover: oklch(0.987 0.013 118.06);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.987 0.013 118.06);
  --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.436 0.054 120.117);
  --primary-foreground: oklch(0.918 0.023 118.26);
  --secondary: oklch(0.349 0.06 294.6);
  --secondary-foreground: oklch(0.883 0.023 297.363);
  --accent: oklch(0.349 0.06 294.6);
  --accent-foreground: oklch(0.883 0.023 297.363);
  --destructive: oklch(0.536 0.21 29.045);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.436 0.054 120.117);
  --chart-1: oklch(0.436 0.054 120.117);
  --chart-2: oklch(0.349 0.06 294.6);
  --chart-3: oklch(0.349 0.06 294.6);
  --chart-4: oklch(0.374 0.065 294.532);
  --chart-5: oklch(0.442 0.06 120.357);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.156 0.014 118.901);
  --foreground: oklch(0.979 0.002 117.869);
  --muted: oklch(0.241 0.025 295.971);
  --muted-foreground: oklch(0.682 0.012 297.519);
  --popover: oklch(0.171 0.016 119.463);
  --popover-foreground: oklch(0.986 0.002 117.854);
  --card: oklch(0.171 0.016 119.463);
  --card-foreground: oklch(0.986 0.002 117.854);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.436 0.054 120.117);
  --primary-foreground: oklch(0.918 0.023 118.26);
  --secondary: oklch(0.349 0.06 294.6);
  --secondary-foreground: oklch(0.883 0.023 297.363);
  --accent: oklch(0.349 0.06 294.6);
  --accent-foreground: oklch(0.883 0.023 297.363);
  --destructive: oklch(0.581 0.228 29.086);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.436 0.054 120.117);
  --chart-1: oklch(0.436 0.054 120.117);
  --chart-2: oklch(0.349 0.06 294.6);
  --chart-3: oklch(0.349 0.06 294.6);
  --chart-4: oklch(0.374 0.065 294.532);
  --chart-5: oklch(0.442 0.06 120.357);
}