Drafty for shadcn/ui

Drafty is a shadcn/ui theme built around a muted deep violet primary color (#18161d) with muted deep green accents (#1b1d16). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the muted deep violet primary (#18161d) on a neutral background (#040307).

Color palette

TokenLightDark
Background
#fcfbfewhite
#040307black
Foreground
#000000black
#fcfcfdwhite
Card
#f8f7fdghostwhite
#06050bblack
Card foreground
#000000black
#ffffffwhite
Popover
#f8f7fdghostwhite
#06050bblack
Popover foreground
#000000black
#ffffffwhite
Primary
#18161dblack
#18161dblack
Primary foreground
#aea8bddarkgray
#aea8bddarkgray
Secondary
#1b1d16black
#1b1d16black
Secondary foreground
#b7bda8darkgray
#b7bda8darkgray
Muted
#e9eddebeige
#1d2112black
Muted foreground
#60615cdimgray
#a2a39edarkgray
Accent
#1b1d16black
#1b1d16black
Accent foreground
#b7bda8darkgray
#b7bda8darkgray
Destructive
#b81c00firebrick
#ff330forangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#18161dblack
#18161dblack

Contrast

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

Light mode
Text on background20.34:1AAA
Text on card19.70:1AAA
Primary button7.80:1AAA
Secondary button8.79:1AAA
Muted text5.25:1AA
Accent8.79:1AAA
Destructive6.58:1AA
Dark mode
Text on background20.04:1AAA
Text on card20.34:1AAA
Primary button7.80:1AAA
Secondary button8.79:1AAA
Muted text6.44:1AA
Accent8.79:1AAA
Destructive3.66:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.004 298.492);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.94 0.021 118.965);
  --muted-foreground: oklch(0.49 0.009 118.889);
  --popover: oklch(0.979 0.008 298.416);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.979 0.008 298.416);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.205 0.014 297.338);
  --primary-foreground: oklch(0.743 0.031 297.833);
  --secondary: oklch(0.226 0.014 119.631);
  --secondary-foreground: oklch(0.789 0.03 119.238);
  --accent: oklch(0.226 0.014 119.631);
  --accent-foreground: oklch(0.789 0.03 119.238);
  --destructive: oklch(0.501 0.192 31.642);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.205 0.014 297.338);
  --chart-1: oklch(0.205 0.014 297.338);
  --chart-2: oklch(0.226 0.014 119.631);
  --chart-3: oklch(0.226 0.014 119.631);
  --chart-4: oklch(0.262 0.017 119.72);
  --chart-5: oklch(0.203 0.017 297.048);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.104 0.015 298.472);
  --foreground: oklch(0.991 0.002 298.528);
  --muted: oklch(0.24 0.029 120.771);
  --muted-foreground: oklch(0.714 0.008 118.768);
  --popover: oklch(0.119 0.017 298.439);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.119 0.017 298.439);
  --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.205 0.014 297.338);
  --primary-foreground: oklch(0.743 0.031 297.833);
  --secondary: oklch(0.226 0.014 119.631);
  --secondary-foreground: oklch(0.789 0.03 119.238);
  --accent: oklch(0.226 0.014 119.631);
  --accent-foreground: oklch(0.789 0.03 119.238);
  --destructive: oklch(0.647 0.24 31.769);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.205 0.014 297.338);
  --chart-1: oklch(0.205 0.014 297.338);
  --chart-2: oklch(0.226 0.014 119.631);
  --chart-3: oklch(0.226 0.014 119.631);
  --chart-4: oklch(0.262 0.017 119.72);
  --chart-5: oklch(0.203 0.017 297.048);
}