Purple for shadcn/ui

Purple is a shadcn/ui theme built around a muted yellow primary color (#b8b393) with muted light yellow accents (#dcd8c1). The light mode uses a neutral background (#fcfbf8). Dark mode keeps the muted yellow primary (#b8b393) on a neutral background (#070703).

Color palette

TokenLightDark
Background
#fcfbf8snow
#070703black
Foreground
#121002black
#ffffffwhite
Card
#fcfbf8snow
#070703black
Card foreground
#121002black
#ffffffwhite
Popover
#fcfbf8snow
#070703black
Popover foreground
#121002black
#ffffffwhite
Primary
#b8b393tan
#b8b393tan
Primary foreground
#0f0f0ablack
#0f0f0ablack
Secondary
#e6e4dbgainsboro
#1f1f1eblack
Secondary foreground
#54513bdarkolivegreen
#b9b9b6silver
Muted
#ecece9linen
#161513black
Muted foreground
#5b5948darkolivegreen
#b7b5a4darkgray
Accent
#dcd8c1lightgrey
#38362edarkslategray
Accent foreground
#454127darkolivegreen
#d1cfc7lightgrey
Destructive
#6f1e0cmaroon
#e73e18orangered
Destructive foreground
#f7c1b5lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b8b393tan
#b8b393tan

Contrast

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

Light mode
Text on background18.44:1AAA
Text on card18.44:1AAA
Primary button9.11:1AAA
Secondary button6.31:1AA
Muted text5.96:1AA
Accent7.20:1AAA
Destructive7.11:1AAA
Dark mode
Text on background20.18:1AAA
Text on card20.18:1AAA
Primary button9.11:1AAA
Secondary button8.38:1AAA
Muted text8.80:1AAA
Accent7.73:1AAA
Destructive4.12:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.004 99.401);
  --foreground: oklch(0.171 0.03 102.285);
  --muted: oklch(0.942 0.003 99.393);
  --muted-foreground: oklch(0.461 0.027 100.109);
  --popover: oklch(0.988 0.004 99.401);
  --popover-foreground: oklch(0.171 0.03 102.285);
  --card: oklch(0.988 0.004 99.401);
  --card-foreground: oklch(0.171 0.03 102.285);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.764 0.045 100.12);
  --primary-foreground: oklch(0.166 0.009 100.091);
  --secondary: oklch(0.919 0.013 99.545);
  --secondary-foreground: oklch(0.431 0.035 100.354);
  --accent: oklch(0.88 0.032 99.844);
  --accent-foreground: oklch(0.37 0.041 100.591);
  --destructive: oklch(0.364 0.117 33.877);
  --destructive-foreground: oklch(0.857 0.065 32.881);
  --ring: oklch(0.764 0.045 100.12);
  --chart-1: oklch(0.764 0.045 100.12);
  --chart-2: oklch(0.919 0.013 99.545);
  --chart-3: oklch(0.88 0.032 99.844);
  --chart-4: oklch(0.939 0.01 99.491);
  --chart-5: oklch(0.77 0.051 100.203);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.126 0.013 102.329);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.197 0.005 99.694);
  --muted-foreground: oklch(0.769 0.024 99.776);
  --popover: oklch(0.126 0.013 102.329);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.126 0.013 102.329);
  --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.764 0.045 100.12);
  --primary-foreground: oklch(0.166 0.009 100.091);
  --secondary: oklch(0.239 0.002 99.464);
  --secondary-foreground: oklch(0.784 0.003 99.407);
  --accent: oklch(0.333 0.014 99.907);
  --accent-foreground: oklch(0.854 0.011 99.527);
  --destructive: oklch(0.614 0.21 33.473);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.764 0.045 100.12);
  --chart-1: oklch(0.764 0.045 100.12);
  --chart-2: oklch(0.239 0.002 99.464);
  --chart-3: oklch(0.333 0.014 99.907);
  --chart-4: oklch(0.272 0.002 99.472);
  --chart-5: oklch(0.77 0.051 100.203);
}