Earnest for shadcn/ui

Earnest is a shadcn/ui theme built around a green primary color (#5e991e) with pink accents (#991e5e). The light mode uses a neutral background (#fcfefb). Dark mode keeps the green primary (#5e991e) on a green-tinted background (#0a0f06).

Color palette

TokenLightDark
Background
#fcfefbwhite
#0a0f06black
Foreground
#000000black
#fafbf9snow
Card
#fafdf7mintcream
#0d1307black
Card foreground
#000000black
#fcfdfcwhite
Popover
#fafdf7mintcream
#0d1307black
Popover foreground
#000000black
#fcfdfcwhite
Primary
#5e991eolivedrab
#5e991eolivedrab
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#1e5e99teal
#1e5e99teal
Secondary foreground
#eef5fcaliceblue
#eef5fcaliceblue
Muted
#d6dbe1gainsboro
#1e2429darkslategray
Muted foreground
#4f5254darkslategray
#abadb0darkgray
Accent
#991e5epurple
#991e5epurple
Accent foreground
#fceef5lavenderblush
#fceef5lavenderblush
Destructive
#962008darkred
#e9310corangered
Destructive foreground
#fddad3mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5e991eolivedrab
#5e991eolivedrab

Contrast

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

Light mode
Text on background20.71:1AAA
Text on card20.43:1AAA
Primary button3.45:1AA Large
Secondary button6.13:1AA
Muted text5.66:1AA
Accent6.89:1AA
Destructive6.44:1AA
Dark mode
Text on background18.67:1AAA
Text on card18.54:1AAA
Primary button3.45:1AA Large
Secondary button6.13:1AA
Muted text6.97:1AA
Accent6.89:1AA
Destructive4.29:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.004 127.837);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.89 0.009 246.087);
  --muted-foreground: oklch(0.436 0.005 246.101);
  --popover: oklch(0.99 0.008 127.886);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.99 0.008 127.886);
  --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.62 0.161 132.731);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.473 0.115 250.568);
  --secondary-foreground: oklch(0.967 0.012 246.105);
  --accent: oklch(0.463 0.167 354.703);
  --accent-foreground: oklch(0.962 0.017 344.743);
  --destructive: oklch(0.441 0.157 32.603);
  --destructive-foreground: oklch(0.916 0.04 31.187);
  --ring: oklch(0.62 0.161 132.731);
  --chart-1: oklch(0.62 0.161 132.731);
  --chart-2: oklch(0.473 0.115 250.568);
  --chart-3: oklch(0.463 0.167 354.703);
  --chart-4: oklch(0.5 0.123 250.645);
  --chart-5: oklch(0.627 0.166 132.961);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.159 0.022 128.191);
  --foreground: oklch(0.986 0.003 127.82);
  --muted: oklch(0.257 0.013 246.528);
  --muted-foreground: oklch(0.748 0.004 246.035);
  --popover: oklch(0.175 0.025 129.196);
  --popover-foreground: oklch(0.993 0.001 127.804);
  --card: oklch(0.175 0.025 129.196);
  --card-foreground: oklch(0.993 0.001 127.804);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.62 0.161 132.731);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.473 0.115 250.568);
  --secondary-foreground: oklch(0.967 0.012 246.105);
  --accent: oklch(0.463 0.167 354.703);
  --accent-foreground: oklch(0.962 0.017 344.743);
  --destructive: oklch(0.605 0.222 32.274);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.62 0.161 132.731);
  --chart-1: oklch(0.62 0.161 132.731);
  --chart-2: oklch(0.473 0.115 250.568);
  --chart-3: oklch(0.463 0.167 354.703);
  --chart-4: oklch(0.5 0.123 250.645);
  --chart-5: oklch(0.627 0.166 132.961);
}