Purple theme for shadcn/ui

Purple theme is a shadcn/ui theme built around a vivid purple primary color (#e015ef) with vivid green accents (#24ef15). The light mode uses a neutral background (#fdfbfd). Dark mode keeps the vivid purple primary (#bf00dc) on a blue-tinted background (#01041f).

Color palette

TokenLightDark
Background
#fdfbfdsnow
#01041fblack
Foreground
#150416black
#a802cadarkviolet
Card
#fcf8fcsnow
#000000black
Card foreground
#100311black
#9600d2darkviolet
Popover
#fcf8fcsnow
#000000black
Popover foreground
#100311black
#a600c8darkviolet
Primary
#e015efmagenta
#bf00dcdarkviolet
Primary foreground
#ffffffwhite
#000000black
Secondary
#24ef15lime
#d609f5magenta
Secondary foreground
#073404darkgreen
#000000black
Muted
#d8e4d8gainsboro
#1e0327black
Muted foreground
#3c4f3bdarkslategray
#480e68indigo
Accent
#24ef15lime
#c000ffdarkviolet
Accent foreground
#073404darkgreen
#000000black
Destructive
#c35113chocolate
#ed1010red
Destructive foreground
#ffffffwhite
#121111black
Border
#ebeaeclavender
#000000black
Input
#ebeaeclavender
#6809cadarkviolet
Ring
#e015efmagenta
#cd30edmediumorchid

Contrast

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

Light mode
Text on background19.29:1AAA
Text on card19.12:1AAA
Primary button3.79:1AA Large
Secondary button8.92:1AAA
Muted text6.75:1AA
Accent8.92:1AAA
Destructive4.66:1AA
Dark mode
Text on background3.39:1AA Large
Text on card3.22:1AA Large
Primary button4.23:1AA Large
Secondary button5.21:1AA
Muted text1.39:1Fail
Accent4.69:1AA
Destructive4.21:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 323.653);
  --foreground: oklch(0.149 0.048 325.225);
  --muted: oklch(0.907 0.021 143.513);
  --muted-foreground: oklch(0.406 0.042 143.078);
  --popover: oklch(0.983 0.007 323.67);
  --popover-foreground: oklch(0.136 0.042 325.348);
  --card: oklch(0.983 0.007 323.67);
  --card-foreground: oklch(0.136 0.042 325.348);
  --border: oklch(0.938 0.003 323.654);
  --input: oklch(0.938 0.003 323.654);
  --primary: oklch(0.65 0.297 324.879);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.827 0.275 142.217);
  --secondary-foreground: oklch(0.286 0.09 141.84);
  --accent: oklch(0.827 0.275 142.217);
  --accent-foreground: oklch(0.286 0.09 141.84);
  --destructive: oklch(0.575 0.161 43.396);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.65 0.297 324.879);
  --chart-1: oklch(0.65 0.297 324.879);
  --chart-2: oklch(0.827 0.275 142.217);
  --chart-3: oklch(0.827 0.275 142.217);
  --chart-4: oklch(0.832 0.27 142.156);
  --chart-5: oklch(0.656 0.301 324.836);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.129 0.062 264.561);
  --foreground: oklch(0.537 0.259 318.56);
  --muted: oklch(0.182 0.076 316.88);
  --muted-foreground: oklch(0.318 0.145 309.069);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.532 0.257 318.494);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.517 0.26 310.92);
  --border: oklch(0 0 0);
  --input: oklch(0.452 0.243 295.129);
  --primary: oklch(0.583 0.279 320.784);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.636 0.301 320.966);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.611 0.304 313.334);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.598 0.24 28.764);
  --destructive-foreground: oklch(0.178 0.001 17.264);
  --ring: oklch(0.633 0.274 319.875);
  --chart-1: oklch(0.583 0.279 320.784);
  --chart-2: oklch(0.636 0.301 320.966);
  --chart-3: oklch(0.611 0.304 313.334);
  --chart-4: oklch(0.645 0.299 321.307);
  --chart-5: oklch(0.588 0.282 320.682);
}