Granola for shadcn/ui

Granola is a shadcn/ui theme built around a deep green primary color (#0c1e0b) with deep green accents (#0b1e14). The light mode uses a neutral background (#fbfefb). Dark mode keeps the deep green primary (#0c1e0b) on a green-tinted background (#050f05).

Color palette

TokenLightDark
Background
#fbfefbwhite
#050f05black
Foreground
#000000black
#f8fcf8mintcream
Card
#f8fcf8mintcream
#071307black
Card foreground
#000000black
#fcfdfcwhite
Popover
#fbfefbwhite
#050f05black
Popover foreground
#000000black
#f8fcf8mintcream
Primary
#0c1e0bblack
#0c1e0bblack
Primary foreground
#45b143limegreen
#45b143limegreen
Secondary
#151e0bblack
#151e0bblack
Secondary foreground
#7cb143yellowgreen
#7cb143yellowgreen
Muted
#f0f6eahoneydew
#0f1509black
Muted foreground
#545850dimgray
#abafa7darkgray
Accent
#0b1e14black
#0b1e14black
Accent foreground
#43b179mediumseagreen
#43b179mediumseagreen
Destructive
#6f1b06maroon
#f5623dtomato
Destructive foreground
#fbbcadlightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0c1e0bblack
#0c1e0bblack

Contrast

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

Light mode
Text on background20.64:1AAA
Text on card20.28:1AAA
Primary button6.34:1AA
Secondary button6.75:1AA
Muted text6.58:1AA
Accent6.46:1AA
Destructive7.00:1AAA
Dark mode
Text on background18.79:1AAA
Text on card18.64:1AAA
Primary button6.34:1AA
Secondary button6.75:1AA
Muted text8.31:1AAA
Accent6.46:1AA
Destructive6.68:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.004 145.072);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.964 0.016 127.99);
  --muted-foreground: oklch(0.455 0.014 128.163);
  --popover: oklch(0.994 0.004 145.072);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.987 0.008 145.044);
  --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.212 0.042 143.562);
  --primary-foreground: oklch(0.676 0.179 143.018);
  --secondary: oklch(0.219 0.036 130.026);
  --secondary-foreground: oklch(0.702 0.152 131.182);
  --accent: oklch(0.214 0.031 159.665);
  --accent-foreground: oklch(0.684 0.132 157.359);
  --destructive: oklch(0.361 0.122 34.395);
  --destructive-foreground: oklch(0.849 0.076 34.474);
  --ring: oklch(0.212 0.042 143.562);
  --chart-1: oklch(0.212 0.042 143.562);
  --chart-2: oklch(0.219 0.036 130.026);
  --chart-3: oklch(0.214 0.031 159.665);
  --chart-4: oklch(0.261 0.046 130.304);
  --chart-5: oklch(0.213 0.045 143.479);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.155 0.028 143.629);
  --foreground: oklch(0.986 0.006 145.06);
  --muted: oklch(0.186 0.024 129.453);
  --muted-foreground: oklch(0.748 0.013 127.989);
  --popover: oklch(0.155 0.028 143.629);
  --popover-foreground: oklch(0.986 0.006 145.06);
  --card: oklch(0.17 0.032 143.596);
  --card-foreground: oklch(0.993 0.003 145.081);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.212 0.042 143.562);
  --primary-foreground: oklch(0.676 0.179 143.018);
  --secondary: oklch(0.219 0.036 130.026);
  --secondary-foreground: oklch(0.702 0.152 131.182);
  --accent: oklch(0.214 0.031 159.665);
  --accent-foreground: oklch(0.684 0.132 157.359);
  --destructive: oklch(0.678 0.188 35.148);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.212 0.042 143.562);
  --chart-1: oklch(0.212 0.042 143.562);
  --chart-2: oklch(0.219 0.036 130.026);
  --chart-3: oklch(0.214 0.031 159.665);
  --chart-4: oklch(0.261 0.046 130.304);
  --chart-5: oklch(0.213 0.045 143.479);
}