Lean for shadcn/ui

Lean is a shadcn/ui theme built around a neutral gray primary color (#2c2c30) with neutral gray accents (#2c302c). The light mode uses a neutral background (#f8f9fb). Dark mode keeps the neutral gray primary (#2c2c30) on an indigo-tinted background (#04040c).

Color palette

TokenLightDark
Background
#f8f9fbghostwhite
#04040cblack
Foreground
#020312black
#ffffffwhite
Card
#f8f9fbghostwhite
#04040cblack
Card foreground
#020312black
#ffffffwhite
Popover
#f8f9fbghostwhite
#04040cblack
Popover foreground
#020312black
#ffffffwhite
Primary
#2c2c30darkslategray
#2c2c30darkslategray
Primary foreground
#c5c5c9silver
#c5c5c9silver
Secondary
#302c2cdarkslategray
#302c2cdarkslategray
Secondary foreground
#c9c5c5silver
#c9c5c5silver
Muted
#ead6d8gainsboro
#291516black
Muted foreground
#534647darkslategray
#b9acaddarkgray
Accent
#2c302cdarkslategray
#2c302cdarkslategray
Accent foreground
#c5c9c5silver
#c5c9c5silver
Destructive
#5c270amaroon
#dc5d18chocolate
Destructive foreground
#f5c0a3lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#2c2c30darkslategray
#2c2c30darkslategray

Contrast

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

Light mode
Text on background19.42:1AAA
Text on card19.42:1AAA
Primary button8.05:1AAA
Secondary button8.06:1AAA
Muted text6.48:1AA
Accent8.01:1AAA
Destructive7.42:1AAA
Dark mode
Text on background20.43:1AAA
Text on card20.43:1AAA
Primary button8.05:1AAA
Secondary button8.06:1AAA
Muted text7.91:1AAA
Accent8.01:1AAA
Destructive3.72:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.981 0.004 283.039);
  --foreground: oklch(0.112 0.039 272.822);
  --muted: oklch(0.894 0.022 12.953);
  --muted-foreground: oklch(0.407 0.019 13.405);
  --popover: oklch(0.981 0.004 283.039);
  --popover-foreground: oklch(0.112 0.039 272.822);
  --card: oklch(0.981 0.004 283.039);
  --card-foreground: oklch(0.112 0.039 272.822);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.295 0.006 282.746);
  --primary-foreground: oklch(0.824 0.006 282.986);
  --secondary: oklch(0.297 0.005 12.803);
  --secondary-foreground: oklch(0.826 0.005 12.554);
  --accent: oklch(0.303 0.008 143.495);
  --accent-foreground: oklch(0.832 0.008 143.587);
  --destructive: oklch(0.342 0.087 45.19);
  --destructive-foreground: oklch(0.847 0.072 49.656);
  --ring: oklch(0.295 0.006 282.746);
  --chart-1: oklch(0.295 0.006 282.746);
  --chart-2: oklch(0.297 0.005 12.803);
  --chart-3: oklch(0.303 0.008 143.495);
  --chart-4: oklch(0.327 0.006 12.817);
  --chart-5: oklch(0.292 0.011 282.452);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.113 0.021 277.956);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.222 0.033 15.807);
  --muted-foreground: oklch(0.755 0.016 12.869);
  --popover: oklch(0.113 0.021 277.956);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.113 0.021 277.956);
  --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.295 0.006 282.746);
  --primary-foreground: oklch(0.824 0.006 282.986);
  --secondary: oklch(0.297 0.005 12.803);
  --secondary-foreground: oklch(0.826 0.005 12.554);
  --accent: oklch(0.303 0.008 143.495);
  --accent-foreground: oklch(0.832 0.008 143.587);
  --destructive: oklch(0.632 0.175 43.539);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.295 0.006 282.746);
  --chart-1: oklch(0.295 0.006 282.746);
  --chart-2: oklch(0.297 0.005 12.803);
  --chart-3: oklch(0.303 0.008 143.495);
  --chart-4: oklch(0.327 0.006 12.817);
  --chart-5: oklch(0.292 0.011 282.452);
}