Pessimistic for shadcn/ui

Pessimistic is a shadcn/ui theme built around a yellow primary color (#c2b151) with green accents (#9bc251). The light mode uses a neutral background (#fefefb). Dark mode keeps the yellow primary (#c2b151) on a neutral background (#080702).

Color palette

TokenLightDark
Background
#fefefbwhite
#080702black
Foreground
#131106black
#faf9f5whitesmoke
Card
#fefefbwhite
#080702black
Card foreground
#131106black
#faf9f5whitesmoke
Popover
#fefefbwhite
#080702black
Popover foreground
#131106black
#faf9f5whitesmoke
Primary
#c2b151darkkhaki
#c2b151darkkhaki
Primary foreground
#353013darkslategray
#353013darkslategray
Secondary
#c27951peru
#c27951peru
Secondary foreground
#000000black
#000000black
Muted
#e3e0degainsboro
#211e1cblack
Muted foreground
#635a54dimgray
#aba19cdarkgray
Accent
#9bc251yellowgreen
#9bc251yellowgreen
Accent foreground
#293513darkgreen
#293513darkgreen
Destructive
#981006darkred
#f74336tomato
Destructive foreground
#fdd6d3mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c2b151darkkhaki
#c2b151darkkhaki

Contrast

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

Light mode
Text on background18.68:1AAA
Text on card18.68:1AAA
Primary button6.13:1AA
Secondary button6.13:1AA
Muted text5.10:1AA
Accent6.33:1AA
Destructive6.53:1AA
Dark mode
Text on background19.11:1AAA
Text on card19.11:1AAA
Primary button6.13:1AA
Secondary button6.13:1AA
Muted text6.56:1AA
Accent6.33:1AA
Destructive3.62:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.996 0.004 98.373);
  --foreground: oklch(0.178 0.022 99.9);
  --muted: oklch(0.908 0.004 50.607);
  --muted-foreground: oklch(0.474 0.015 50.271);
  --popover: oklch(0.996 0.004 98.373);
  --popover-foreground: oklch(0.178 0.022 99.9);
  --card: oklch(0.996 0.004 98.373);
  --card-foreground: oklch(0.178 0.022 99.9);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.756 0.118 99.416);
  --primary-foreground: oklch(0.306 0.046 99.463);
  --secondary: oklch(0.645 0.107 48.432);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.762 0.148 125.898);
  --accent-foreground: oklch(0.308 0.057 125.654);
  --destructive: oklch(0.433 0.168 29.81);
  --destructive-foreground: oklch(0.908 0.044 22.824);
  --ring: oklch(0.756 0.118 99.416);
  --chart-1: oklch(0.756 0.118 99.416);
  --chart-2: oklch(0.645 0.107 48.432);
  --chart-3: oklch(0.762 0.148 125.898);
  --chart-4: oklch(0.668 0.099 48.761);
  --chart-5: oklch(0.764 0.123 99.362);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.128 0.017 102.17);
  --foreground: oklch(0.982 0.006 98.405);
  --muted: oklch(0.237 0.005 50.386);
  --muted-foreground: oklch(0.716 0.013 50.422);
  --popover: oklch(0.128 0.017 102.17);
  --popover-foreground: oklch(0.982 0.006 98.405);
  --card: oklch(0.128 0.017 102.17);
  --card-foreground: oklch(0.982 0.006 98.405);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.756 0.118 99.416);
  --primary-foreground: oklch(0.306 0.046 99.463);
  --secondary: oklch(0.645 0.107 48.432);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.762 0.148 125.898);
  --accent-foreground: oklch(0.308 0.057 125.654);
  --destructive: oklch(0.647 0.218 28.759);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.756 0.118 99.416);
  --chart-1: oklch(0.756 0.118 99.416);
  --chart-2: oklch(0.645 0.107 48.432);
  --chart-3: oklch(0.762 0.148 125.898);
  --chart-4: oklch(0.668 0.099 48.761);
  --chart-5: oklch(0.764 0.123 99.362);
}