Pessimistic for shadcn/ui

Pessimistic is a shadcn/ui theme built around a light green primary color (#d1e7ca) with light green accents (#cae7d1). The light mode uses a neutral background (#fcfdfc). Dark mode keeps the light green primary (#d1e7ca) on a green-tinted background (#080e06).

Color palette

TokenLightDark
Background
#fcfdfcwhite
#080e06black
Foreground
#071004black
#fcfdfbsnow
Card
#f9fcf8mintcream
#0a1108black
Card foreground
#050c03black
#ffffffwhite
Popover
#f9fcf8mintcream
#0a1108black
Popover foreground
#050c03black
#ffffffwhite
Primary
#d1e7calightgrey
#d1e7calightgrey
Primary foreground
#345828darkolivegreen
#345828darkolivegreen
Secondary
#e0e7cagainsboro
#e0e7cagainsboro
Secondary foreground
#4c5828darkolivegreen
#4c5828darkolivegreen
Muted
#eef2e3beige
#181c0dblack
Muted foreground
#4d4d4cdarkslategray
#b3b3b2darkgray
Accent
#cae7d1lightgrey
#cae7d1lightgrey
Accent foreground
#285834darkslategray
#285834darkslategray
Destructive
#951709darkred
#e3230dorangered
Destructive foreground
#fcd8d4mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d1e7calightgrey
#d1e7calightgrey

Contrast

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

Light mode
Text on background19.01:1AAA
Text on card19.10:1AAA
Primary button6.23:1AA
Secondary button6.03:1AA
Muted text7.43:1AAA
Accent6.27:1AA
Destructive6.60:1AA
Dark mode
Text on background19.12:1AAA
Text on card19.09:1AAA
Primary button6.23:1AA
Secondary button6.03:1AA
Muted text8.28:1AAA
Accent6.27:1AA
Destructive4.67:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.993 0.003 137.767);
  --foreground: oklch(0.16 0.03 136.663);
  --muted: oklch(0.954 0.02 118.193);
  --muted-foreground: oklch(0.42 0.003 117.932);
  --popover: oklch(0.987 0.005 137.772);
  --popover-foreground: oklch(0.143 0.026 136.118);
  --card: oklch(0.987 0.005 137.772);
  --card-foreground: oklch(0.143 0.026 136.118);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.905 0.045 137.852);
  --primary-foreground: oklch(0.42 0.086 138.393);
  --secondary: oklch(0.916 0.039 118.589);
  --secondary-foreground: oklch(0.438 0.073 121.085);
  --accent: oklch(0.902 0.043 153.049);
  --accent-foreground: oklch(0.416 0.08 149.836);
  --destructive: oklch(0.432 0.163 30.52);
  --destructive-foreground: oklch(0.911 0.042 25.427);
  --ring: oklch(0.905 0.045 137.852);
  --chart-1: oklch(0.905 0.045 137.852);
  --chart-2: oklch(0.916 0.039 118.589);
  --chart-3: oklch(0.902 0.043 153.049);
  --chart-4: oklch(0.933 0.031 118.423);
  --chart-5: oklch(0.907 0.049 137.86);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.154 0.019 137.073);
  --foreground: oklch(0.994 0.003 137.768);
  --muted: oklch(0.217 0.027 120.172);
  --muted-foreground: oklch(0.767 0.002 117.875);
  --popover: oklch(0.169 0.022 137.768);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.169 0.022 137.768);
  --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.905 0.045 137.852);
  --primary-foreground: oklch(0.42 0.086 138.393);
  --secondary: oklch(0.916 0.039 118.589);
  --secondary-foreground: oklch(0.438 0.073 121.085);
  --accent: oklch(0.902 0.043 153.049);
  --accent-foreground: oklch(0.416 0.08 149.836);
  --destructive: oklch(0.586 0.225 30.45);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.905 0.045 137.852);
  --chart-1: oklch(0.905 0.045 137.852);
  --chart-2: oklch(0.916 0.039 118.589);
  --chart-3: oklch(0.902 0.043 153.049);
  --chart-4: oklch(0.933 0.031 118.423);
  --chart-5: oklch(0.907 0.049 137.86);
}