The Best Theme for shadcn/ui

The Best Theme is a shadcn/ui theme built around a neutral gray primary color (#cccccc) with muted deep blue accents (#32414e). The light mode uses a blue-tinted background (#141a1f). Dark mode keeps the neutral gray primary (#cccccc) on a blue-tinted background (#141a1f).

Color palette

TokenLightDark
Background
#141a1fblack
#141a1fblack
Foreground
#cccccclightgrey
#cccccclightgrey
Card
#101519black
#101519black
Card foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Popover
#0e1216black
#0e1216black
Popover foreground
#e6e6e6gainsboro
#e6e6e6gainsboro
Primary
#cccccclightgrey
#cccccclightgrey
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#22272bdarkslategray
#22272bdarkslategray
Muted foreground
#9ba7b0darkgray
#9ba7b0darkgray
Accent
#32414edarkslategray
#32414edarkslategray
Accent foreground
#d0dae1gainsboro
#d0dae1gainsboro
Destructive
#ed5e45tomato
#ed5e45tomato
Destructive foreground
#000000black
#000000black
Border
#22272bdarkslategray
#22272bdarkslategray
Input
#282e33darkslategray
#282e33darkslategray
Ring
#cccccclightgrey
#cccccclightgrey

Contrast

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

Light mode
Text on background10.91:1AAA
Text on card13.02:1AAA
Primary button7.86:1AAA
Secondary button7.37:1AAA
Muted text6.15:1AA
Accent7.38:1AAA
Destructive6.29:1AA
Dark mode
Text on background10.91:1AAA
Text on card13.02:1AAA
Primary button7.86:1AAA
Secondary button7.37:1AAA
Muted text6.15:1AA
Accent7.38:1AAA
Destructive6.29:1AA

CSS variables

Paste this into your globals.css to use The Best Theme in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.214 0.014 243.073);
  --foreground: oklch(0.845 0 164.055);
  --muted: oklch(0.268 0.011 242.723);
  --muted-foreground: oklch(0.722 0.019 242.55);
  --popover: oklch(0.18 0.01 242.949);
  --popover-foreground: oklch(0.923 0 153.435);
  --card: oklch(0.192 0.011 242.996);
  --card-foreground: oklch(0.885 0 180);
  --border: oklch(0.268 0.011 242.723);
  --input: oklch(0.299 0.012 242.749);
  --primary: oklch(0.845 0 164.055);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.368 0.03 243.34);
  --accent-foreground: oklch(0.882 0.014 242.411);
  --destructive: oklch(0.662 0.181 32.127);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.845 0 164.055);
  --chart-1: oklch(0.845 0 164.055);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.368 0.03 243.34);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.843 0.003 17.225);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.214 0.014 243.073);
  --foreground: oklch(0.845 0 164.055);
  --muted: oklch(0.268 0.011 242.723);
  --muted-foreground: oklch(0.722 0.019 242.55);
  --popover: oklch(0.18 0.01 242.949);
  --popover-foreground: oklch(0.923 0 153.435);
  --card: oklch(0.192 0.011 242.996);
  --card-foreground: oklch(0.885 0 180);
  --border: oklch(0.268 0.011 242.723);
  --input: oklch(0.299 0.012 242.749);
  --primary: oklch(0.845 0 164.055);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.368 0.03 243.34);
  --accent-foreground: oklch(0.882 0.014 242.411);
  --destructive: oklch(0.662 0.181 32.127);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.845 0 164.055);
  --chart-1: oklch(0.845 0 164.055);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.368 0.03 243.34);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.843 0.003 17.225);
}