Drab for shadcn/ui

Drab is a shadcn/ui theme built around a neutral gray primary color (#373839) with muted light blue accents (#c5c8ce). The light mode uses a neutral background (#ffffff). Dark mode keeps the neutral gray primary (#373839) on a neutral background (#030507).

Color palette

TokenLightDark
Background
#ffffffwhite
#030507black
Foreground
#010205black
#fcfcfdwhite
Card
#ffffffwhite
#030507black
Card foreground
#010205black
#fcfcfdwhite
Popover
#ffffffwhite
#030507black
Popover foreground
#010205black
#fcfcfdwhite
Primary
#373839darkslategray
#373839darkslategray
Primary foreground
#d0d1d2lightgrey
#d0d1d2lightgrey
Secondary
#e0e0e1gainsboro
#2a2f37darkslategray
Secondary foreground
#474748darkslategray
#c2c7d0silver
Muted
#dce1e9gainsboro
#161a23black
Muted foreground
#434b5bdarkslategray
#a4acbcdarkgray
Accent
#c5c8cesilver
#333e52darkslategray
Accent foreground
#2c2f35darkslategray
#d3d9e4gainsboro
Destructive
#c83f04firebrick
#e64805orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#373839darkslategray
#373839darkslategray

Contrast

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

Light mode
Text on background20.74:1AAA
Text on card20.74:1AAA
Primary button7.70:1AAA
Secondary button7.04:1AAA
Muted text6.68:1AA
Accent7.99:1AAA
Destructive5.04:1AA
Dark mode
Text on background19.94:1AAA
Text on card19.94:1AAA
Primary button7.70:1AAA
Secondary button7.96:1AAA
Muted text7.63:1AAA
Accent7.61:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.082 0.015 251.016);
  --muted: oklch(0.909 0.012 263.026);
  --muted-foreground: oklch(0.413 0.028 262.8);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.082 0.015 251.016);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.082 0.015 251.016);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.34 0.003 263.039);
  --primary-foreground: oklch(0.86 0.002 263.05);
  --secondary: oklch(0.908 0.001 263.052);
  --secondary-foreground: oklch(0.398 0.002 263.046);
  --accent: oklch(0.832 0.009 263.031);
  --accent-foreground: oklch(0.305 0.011 262.951);
  --destructive: oklch(0.561 0.182 37.858);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.34 0.003 263.039);
  --chart-1: oklch(0.34 0.003 263.039);
  --chart-2: oklch(0.908 0.001 263.052);
  --chart-3: oklch(0.832 0.009 263.031);
  --chart-4: oklch(0.931 0 263.053);
  --chart-5: oklch(0.337 0.007 263.006);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.111 0.009 258.318);
  --foreground: oklch(0.992 0.001 263.051);
  --muted: oklch(0.218 0.018 262.717);
  --muted-foreground: oklch(0.744 0.024 262.966);
  --popover: oklch(0.111 0.009 258.318);
  --popover-foreground: oklch(0.992 0.001 263.051);
  --card: oklch(0.111 0.009 258.318);
  --card-foreground: oklch(0.992 0.001 263.051);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.34 0.003 263.039);
  --primary-foreground: oklch(0.86 0.002 263.05);
  --secondary: oklch(0.303 0.016 262.876);
  --secondary-foreground: oklch(0.83 0.014 263.018);
  --accent: oklch(0.362 0.037 262.588);
  --accent-foreground: oklch(0.884 0.016 263.014);
  --destructive: oklch(0.621 0.203 37.576);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.34 0.003 263.039);
  --chart-1: oklch(0.34 0.003 263.039);
  --chart-2: oklch(0.303 0.016 262.876);
  --chart-3: oklch(0.362 0.037 262.588);
  --chart-4: oklch(0.332 0.018 262.867);
  --chart-5: oklch(0.337 0.007 263.006);
}