Generous for shadcn/ui

Generous is a shadcn/ui theme built around a deep violet primary color (#250f61) with deep green accents (#0f6125). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the deep violet primary (#250f61) on a violet-tinted background (#06050b).

Color palette

TokenLightDark
Background
#fcfbfewhite
#06050bblack
Foreground
#05030dblack
#faf9fbghostwhite
Card
#fcfbfewhite
#06050bblack
Card foreground
#05030dblack
#faf9fbghostwhite
Popover
#fcfbfewhite
#06050bblack
Popover foreground
#05030dblack
#faf9fbghostwhite
Primary
#250f61midnightblue
#250f61midnightblue
Primary foreground
#c1b0f3lightsteelblue
#c1b0f3lightsteelblue
Secondary
#61250fmaroon
#61250fmaroon
Secondary foreground
#f3c1b0lightpink
#f3c1b0lightpink
Muted
#e2dcdagainsboro
#251f1dblack
Muted foreground
#514743darkslategray
#bcb2aedarkgray
Accent
#0f6125darkgreen
#0f6125darkgreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#6a260bmaroon
#eb6e3dtomato
Destructive foreground
#f7c4b1lightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#250f61midnightblue
#250f61midnightblue

Contrast

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

Light mode
Text on background19.83:1AAA
Text on card19.83:1AAA
Primary button8.15:1AAA
Secondary button7.33:1AAA
Muted text6.63:1AA
Accent7.61:1AAA
Destructive7.10:1AAA
Dark mode
Text on background19.37:1AAA
Text on card19.37:1AAA
Primary button8.15:1AAA
Secondary button7.33:1AAA
Muted text7.80:1AAA
Accent7.61:1AAA
Destructive6.83:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.004 298.489);
  --foreground: oklch(0.108 0.03 298.039);
  --muted: oklch(0.898 0.007 41.243);
  --muted-foreground: oklch(0.406 0.015 41.071);
  --popover: oklch(0.989 0.004 298.489);
  --popover-foreground: oklch(0.108 0.03 298.039);
  --card: oklch(0.989 0.004 298.489);
  --card-foreground: oklch(0.108 0.03 298.039);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.267 0.132 285.512);
  --primary-foreground: oklch(0.795 0.095 296.406);
  --secondary: oklch(0.349 0.093 39.346);
  --secondary-foreground: oklch(0.851 0.062 40.926);
  --accent: oklch(0.432 0.12 147.238);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.366 0.104 39.736);
  --destructive-foreground: oklch(0.861 0.064 42.634);
  --ring: oklch(0.267 0.132 285.512);
  --chart-1: oklch(0.267 0.132 285.512);
  --chart-2: oklch(0.349 0.093 39.346);
  --chart-3: oklch(0.432 0.12 147.238);
  --chart-4: oklch(0.38 0.104 39.212);
  --chart-5: oklch(0.266 0.135 284.698);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.119 0.017 298.449);
  --foreground: oklch(0.983 0.002 298.532);
  --muted: oklch(0.246 0.01 41.05);
  --muted-foreground: oklch(0.77 0.012 41.186);
  --popover: oklch(0.119 0.017 298.449);
  --popover-foreground: oklch(0.983 0.002 298.532);
  --card: oklch(0.119 0.017 298.449);
  --card-foreground: oklch(0.983 0.002 298.532);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.267 0.132 285.512);
  --primary-foreground: oklch(0.795 0.095 296.406);
  --secondary: oklch(0.349 0.093 39.346);
  --secondary-foreground: oklch(0.851 0.062 40.926);
  --accent: oklch(0.432 0.12 147.238);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.68 0.167 41.013);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.267 0.132 285.512);
  --chart-1: oklch(0.267 0.132 285.512);
  --chart-2: oklch(0.349 0.093 39.346);
  --chart-3: oklch(0.432 0.12 147.238);
  --chart-4: oklch(0.38 0.104 39.212);
  --chart-5: oklch(0.266 0.135 284.698);
}