Drab for shadcn/ui

Drab is a shadcn/ui theme built around a neutral gray primary color (#949e9a) with neutral gray accents (#dedede). The light mode uses a neutral background (#f7fdfa). Dark mode keeps the neutral gray primary (#949e9a) on a neutral background (#030705).

Color palette

TokenLightDark
Background
#f7fdfamintcream
#030705black
Foreground
#040c08black
#fbfdfdwhite
Card
#f7fdfamintcream
#030705black
Card foreground
#040c08black
#fbfdfdwhite
Popover
#f7fdfamintcream
#030705black
Popover foreground
#040c08black
#fbfdfdwhite
Primary
#949e9adarkgray
#949e9adarkgray
Primary foreground
#000000black
#000000black
Secondary
#dededegainsboro
#1f2825darkslategray
Secondary foreground
#454545darkslategray
#b5c5besilver
Muted
#ebdbdbgainsboro
#14241eblack
Muted foreground
#4d3d3ddarkslategray
#b2c2bcsilver
Accent
#dededegainsboro
#1f2825darkslategray
Accent foreground
#454545darkslategray
#b5c5besilver
Destructive
#e42f01orangered
#f93301orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#949e9adarkgray
#949e9adarkgray

Contrast

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

Light mode
Text on background19.16:1AAA
Text on card19.16:1AAA
Primary button7.62:1AAA
Secondary button7.11:1AAA
Muted text7.63:1AAA
Accent7.11:1AAA
Destructive4.45:1AA Large
Dark mode
Text on background19.85:1AAA
Text on card19.85:1AAA
Primary button7.62:1AAA
Secondary button8.41:1AAA
Muted text8.68:1AAA
Accent8.41:1AAA
Destructive3.82:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.006 170.442);
  --foreground: oklch(0.141 0.016 170.576);
  --muted: oklch(0.904 0.019 17.502);
  --muted-foreground: oklch(0.376 0.023 18.237);
  --popover: oklch(0.988 0.006 170.442);
  --popover-foreground: oklch(0.141 0.016 170.576);
  --card: oklch(0.988 0.006 170.442);
  --card-foreground: oklch(0.141 0.016 170.576);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.69 0.013 170.073);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.9 0 188.746);
  --secondary-foreground: oklch(0.39 0 165.964);
  --accent: oklch(0.9 0 188.746);
  --accent-foreground: oklch(0.39 0 165.964);
  --destructive: oklch(0.596 0.22 32.828);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.69 0.013 170.073);
  --chart-1: oklch(0.69 0.013 170.073);
  --chart-2: oklch(0.9 0 188.746);
  --chart-3: oklch(0.9 0 188.746);
  --chart-4: oklch(0.923 0 153.435);
  --chart-5: oklch(0.695 0.021 169.744);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.121 0.009 170.789);
  --foreground: oklch(0.994 0.002 170.554);
  --muted: oklch(0.245 0.026 167.043);
  --muted-foreground: oklch(0.801 0.02 169.88);
  --popover: oklch(0.121 0.009 170.789);
  --popover-foreground: oklch(0.994 0.002 170.554);
  --card: oklch(0.121 0.009 170.789);
  --card-foreground: oklch(0.994 0.002 170.554);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.69 0.013 170.073);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.267 0.014 169.075);
  --secondary-foreground: oklch(0.808 0.02 169.917);
  --accent: oklch(0.267 0.014 169.075);
  --accent-foreground: oklch(0.808 0.02 169.917);
  --destructive: oklch(0.635 0.236 32.71);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.69 0.013 170.073);
  --chart-1: oklch(0.69 0.013 170.073);
  --chart-2: oklch(0.267 0.014 169.075);
  --chart-3: oklch(0.267 0.014 169.075);
  --chart-4: oklch(0.3 0.016 168.994);
  --chart-5: oklch(0.695 0.021 169.744);
}