Generous for shadcn/ui

Generous is a shadcn/ui theme built around a muted green primary color (#72a36c) with muted purple accents (#9c6ca3). The light mode uses a neutral background (#fbfefb). Dark mode keeps the muted green primary (#72a36c) on a green-tinted background (#050b04).

Color palette

TokenLightDark
Background
#fbfefbwhite
#050b04black
Foreground
#020401black
#ffffffwhite
Card
#f7fdf7mintcream
#070f06black
Card foreground
#000000black
#ffffffwhite
Popover
#f7fdf7mintcream
#070f06black
Popover foreground
#000000black
#ffffffwhite
Primary
#72a36cgray
#72a36cgray
Primary foreground
#000000black
#000000black
Secondary
#9c6ca3lightslategray
#9c6ca3lightslategray
Secondary foreground
#000000black
#000000black
Muted
#e7d8e9gainsboro
#251627black
Muted foreground
#493a4bdarkslategray
#c3b4c5silver
Accent
#9c6ca3lightslategray
#9c6ca3lightslategray
Accent foreground
#000000black
#000000black
Destructive
#85230fsaddlebrown
#cf3617firebrick
Destructive foreground
#f9d4cdbisque
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#72a36cgray
#72a36cgray

Contrast

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

Light mode
Text on background20.27:1AAA
Text on card20.38:1AAA
Primary button7.14:1AAA
Secondary button5.07:1AA
Muted text7.71:1AAA
Accent5.07:1AA
Destructive6.84:1AA
Dark mode
Text on background19.87:1AAA
Text on card19.48:1AAA
Primary button7.14:1AAA
Secondary button5.07:1AA
Muted text8.71:1AAA
Accent5.07:1AA
Destructive5.03:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.005 142.094);
  --foreground: oklch(0.097 0.016 140.541);
  --muted: oklch(0.899 0.029 322.223);
  --muted-foreground: oklch(0.37 0.035 322.422);
  --popover: oklch(0.988 0.011 142.076);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.988 0.011 142.076);
  --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.665 0.095 141.627);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.6 0.099 322.615);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.6 0.099 322.615);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.412 0.137 33.048);
  --destructive-foreground: oklch(0.899 0.043 31.214);
  --ring: oklch(0.665 0.095 141.627);
  --chart-1: oklch(0.665 0.095 141.627);
  --chart-2: oklch(0.6 0.099 322.615);
  --chart-3: oklch(0.6 0.099 322.615);
  --chart-4: oklch(0.626 0.092 322.569);
  --chart-5: oklch(0.672 0.107 141.58);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.139 0.021 140.768);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.228 0.04 322.645);
  --muted-foreground: oklch(0.788 0.029 322.238);
  --popover: oklch(0.155 0.024 140.949);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.155 0.024 140.949);
  --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.665 0.095 141.627);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.6 0.099 322.615);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.6 0.099 322.615);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.564 0.194 32.877);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.665 0.095 141.627);
  --chart-1: oklch(0.665 0.095 141.627);
  --chart-2: oklch(0.6 0.099 322.615);
  --chart-3: oklch(0.6 0.099 322.615);
  --chart-4: oklch(0.626 0.092 322.569);
  --chart-5: oklch(0.672 0.107 141.58);
}