General for shadcn/ui

General is a shadcn/ui theme built around a muted green primary color (#b8c7b9) with muted purple accents (#c7b8c5). The light mode uses a neutral background (#f8fbf9). Dark mode keeps the muted green primary (#b8c7b9) on a green-tinted background (#040b05).

Color palette

TokenLightDark
Background
#f8fbf9mintcream
#040b05black
Foreground
#020d03black
#ffffffwhite
Card
#f5faf6whitesmoke
#050f06black
Card foreground
#010902black
#ffffffwhite
Popover
#f5faf6whitesmoke
#050f06black
Popover foreground
#010902black
#ffffffwhite
Primary
#b8c7b9silver
#b8c7b9silver
Primary foreground
#222b23darkslategray
#222b23darkslategray
Secondary
#c7b8c5silver
#c7b8c5silver
Secondary foreground
#2b222adarkslategray
#2b222adarkslategray
Muted
#f5eaf4whitesmoke
#150a13black
Muted foreground
#5f535edimgray
#aca0abdarkgray
Accent
#c7b8c5silver
#c7b8c5silver
Accent foreground
#2b222adarkslategray
#2b222adarkslategray
Destructive
#813109saddlebrown
#ef611achocolate
Destructive foreground
#fbd4c1peachpuff
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b8c7b9silver
#b8c7b9silver

Contrast

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

Light mode
Text on background19.05:1AAA
Text on card19.06:1AAA
Primary button8.27:1AAA
Secondary button8.09:1AAA
Muted text6.23:1AA
Accent8.09:1AAA
Destructive6.44:1AA
Dark mode
Text on background19.86:1AAA
Text on card19.45:1AAA
Primary button8.27:1AAA
Secondary button8.09:1AAA
Muted text7.72:1AAA
Accent8.09:1AAA
Destructive6.40:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.986 0.005 149.074);
  --foreground: oklch(0.143 0.033 147.442);
  --muted: oklch(0.949 0.017 329.34);
  --muted-foreground: oklch(0.458 0.024 329.721);
  --popover: oklch(0.98 0.007 149.043);
  --popover-foreground: oklch(0.124 0.028 147.57);
  --card: oklch(0.98 0.007 149.043);
  --card-foreground: oklch(0.124 0.028 147.57);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.814 0.025 148.765);
  --primary-foreground: oklch(0.277 0.02 148.265);
  --secondary: oklch(0.798 0.025 329.497);
  --secondary-foreground: oklch(0.264 0.02 329.982);
  --accent: oklch(0.798 0.025 329.497);
  --accent-foreground: oklch(0.264 0.02 329.982);
  --destructive: oklch(0.422 0.12 42.191);
  --destructive-foreground: oklch(0.898 0.051 48.136);
  --ring: oklch(0.814 0.025 148.765);
  --chart-1: oklch(0.814 0.025 148.765);
  --chart-2: oklch(0.798 0.025 329.497);
  --chart-3: oklch(0.798 0.025 329.497);
  --chart-4: oklch(0.823 0.022 329.442);
  --chart-5: oklch(0.816 0.031 148.673);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.139 0.022 148.03);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.165 0.026 330.847);
  --muted-foreground: oklch(0.718 0.021 329.473);
  --popover: oklch(0.156 0.026 147.706);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.156 0.026 147.706);
  --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.814 0.025 148.765);
  --primary-foreground: oklch(0.277 0.02 148.265);
  --secondary: oklch(0.798 0.025 329.497);
  --secondary-foreground: oklch(0.264 0.02 329.982);
  --accent: oklch(0.798 0.025 329.497);
  --accent-foreground: oklch(0.264 0.02 329.982);
  --destructive: oklch(0.666 0.19 42.119);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.814 0.025 148.765);
  --chart-1: oklch(0.814 0.025 148.765);
  --chart-2: oklch(0.798 0.025 329.497);
  --chart-3: oklch(0.798 0.025 329.497);
  --chart-4: oklch(0.823 0.022 329.442);
  --chart-5: oklch(0.816 0.031 148.673);
}