Purple for shadcn/ui

Purple is a shadcn/ui theme built around a vivid violet primary color (#4a0ca7) with vivid green accents (#0ca74a). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid violet primary (#4a0ca7) on a violet-tinted background (#090410).

Color palette

TokenLightDark
Background
#ffffffwhite
#090410black
Foreground
#0b0415black
#f7f5f9whitesmoke
Card
#fcfcfcsnow
#0b0514black
Card foreground
#090311black
#faf9fbghostwhite
Popover
#ffffffwhite
#090410black
Popover foreground
#0b0415black
#f7f5f9whitesmoke
Primary
#4a0ca7indigo
#4a0ca7indigo
Primary foreground
#f0e7fdlavender
#f0e7fdlavender
Secondary
#a74a0csaddlebrown
#a74a0csaddlebrown
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#f1e6dfantiquewhite
#20150eblack
Muted foreground
#695f59dimgray
#a69d96darkgray
Accent
#0ca74aseagreen
#0ca74aseagreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#6a250cmaroon
#e85e2cchocolate
Destructive foreground
#f6c3b1lightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4a0ca7indigo
#4a0ca7indigo

Contrast

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

Light mode
Text on background20.14:1AAA
Text on card19.89:1AAA
Primary button9.25:1AAA
Secondary button5.80:1AA
Muted text5.07:1AA
Accent3.16:1AA Large
Destructive7.12:1AAA
Dark mode
Text on background18.69:1AAA
Text on card19.10:1AAA
Primary button9.25:1AAA
Secondary button5.80:1AA
Muted text6.70:1AA
Accent3.16:1AA Large
Destructive6.04:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.134 0.04 301.914);
  --muted: oklch(0.932 0.016 56.203);
  --muted-foreground: oklch(0.494 0.015 56.003);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.134 0.04 301.914);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.124 0.035 303.729);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.382 0.209 289.605);
  --primary-foreground: oklch(0.942 0.031 303.873);
  --secondary: oklch(0.521 0.139 46.921);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.637 0.176 149.158);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.363 0.105 38.721);
  --destructive-foreground: oklch(0.859 0.064 40.92);
  --ring: oklch(0.382 0.209 289.605);
  --chart-1: oklch(0.382 0.209 289.605);
  --chart-2: oklch(0.521 0.139 46.921);
  --chart-3: oklch(0.637 0.176 149.158);
  --chart-4: oklch(0.553 0.148 46.732);
  --chart-5: oklch(0.384 0.212 288.858);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.126 0.031 303.765);
  --foreground: oklch(0.974 0.006 304.264);
  --muted: oklch(0.208 0.023 54.791);
  --muted-foreground: oklch(0.701 0.014 56.155);
  --popover: oklch(0.126 0.031 303.765);
  --popover-foreground: oklch(0.974 0.006 304.264);
  --card: oklch(0.137 0.036 302.033);
  --card-foreground: oklch(0.982 0.004 304.291);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.382 0.209 289.605);
  --primary-foreground: oklch(0.942 0.031 303.873);
  --secondary: oklch(0.521 0.139 46.921);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.637 0.176 149.158);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.651 0.182 39.012);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.382 0.209 289.605);
  --chart-1: oklch(0.382 0.209 289.605);
  --chart-2: oklch(0.521 0.139 46.921);
  --chart-3: oklch(0.637 0.176 149.158);
  --chart-4: oklch(0.553 0.148 46.732);
  --chart-5: oklch(0.384 0.212 288.858);
}