Pessimistic for shadcn/ui

Pessimistic is a shadcn/ui theme built around a green primary color (#64ae24) with muted light green accents (#e0e6db). The light mode uses a neutral background (#ffffff). Dark mode keeps the green primary (#64ae24) on a green-tinted background (#070c04).

Color palette

TokenLightDark
Background
#ffffffwhite
#070c04black
Foreground
#000000black
#f7f9f6whitesmoke
Card
#fcfcfcsnow
#0a1005black
Card foreground
#000000black
#fafbf9snow
Popover
#fcfcfcsnow
#0a1005black
Popover foreground
#000000black
#fafbf9snow
Primary
#64ae24olivedrab
#64ae24olivedrab
Primary foreground
#020401black
#020401black
Secondary
#e0e6dbgainsboro
#33382edarkslategray
Secondary foreground
#46553adarkolivegreen
#ccd1c7lightgrey
Muted
#edf2e9linen
#12160dblack
Muted foreground
#63685edimgray
#9ba197darkgray
Accent
#e0e6dbgainsboro
#33382edarkslategray
Accent foreground
#46553adarkolivegreen
#ccd1c7lightgrey
Destructive
#5e1c08maroon
#ef6339tomato
Destructive foreground
#f7b5a1lightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#64ae24olivedrab
#64ae24olivedrab

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.43:1AAA
Secondary button6.30:1AA
Muted text5.01:1AA
Accent6.30:1AA
Destructive7.32:1AAA
Dark mode
Text on background18.66:1AAA
Text on card18.60:1AAA
Primary button7.43:1AAA
Secondary button7.77:1AAA
Muted text6.91:1AA
Accent7.77:1AAA
Destructive6.52:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.954 0.013 129.92);
  --muted-foreground: oklch(0.511 0.017 130.116);
  --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.676 0.18 134.299);
  --primary-foreground: oklch(0.102 0.018 128.338);
  --secondary: oklch(0.918 0.017 129.97);
  --secondary-foreground: oklch(0.429 0.047 130.963);
  --accent: oklch(0.918 0.017 129.97);
  --accent-foreground: oklch(0.429 0.047 130.963);
  --destructive: oklch(0.33 0.101 36.537);
  --destructive-foreground: oklch(0.829 0.083 37.617);
  --ring: oklch(0.676 0.18 134.299);
  --chart-1: oklch(0.676 0.18 134.299);
  --chart-2: oklch(0.918 0.017 129.97);
  --chart-3: oklch(0.918 0.017 129.97);
  --chart-4: oklch(0.938 0.013 129.92);
  --chart-5: oklch(0.683 0.186 134.521);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.145 0.022 128.748);
  --foreground: oklch(0.98 0.005 129.834);
  --muted: oklch(0.193 0.019 130.825);
  --muted-foreground: oklch(0.7 0.015 130.007);
  --popover: oklch(0.161 0.026 129.884);
  --popover-foreground: oklch(0.987 0.003 129.817);
  --card: oklch(0.161 0.026 129.884);
  --card-foreground: oklch(0.987 0.003 129.817);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.676 0.18 134.299);
  --primary-foreground: oklch(0.102 0.018 128.338);
  --secondary: oklch(0.331 0.017 130.314);
  --secondary-foreground: oklch(0.853 0.014 129.945);
  --accent: oklch(0.331 0.017 130.314);
  --accent-foreground: oklch(0.853 0.014 129.945);
  --destructive: oklch(0.671 0.182 37.226);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.676 0.18 134.299);
  --chart-1: oklch(0.676 0.18 134.299);
  --chart-2: oklch(0.331 0.017 130.314);
  --chart-3: oklch(0.331 0.017 130.314);
  --chart-4: oklch(0.362 0.019 130.33);
  --chart-5: oklch(0.683 0.186 134.521);
}