dark purple for shadcn/ui

dark purple is a shadcn/ui theme built around a violet primary color (#744de0) with muted light violet accents (#ccc6dd). The light mode uses a neutral background (#ffffff). Dark mode keeps the violet primary (#744de0) on a neutral background (#040307).

Color palette

TokenLightDark
Background
#ffffffwhite
#040307black
Foreground
#020104black
#ffffffwhite
Card
#fcfcfcsnow
#06050bblack
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfcsnow
#06050bblack
Popover foreground
#000000black
#ffffffwhite
Primary
#744de0slateblue
#744de0slateblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#dedbe6gainsboro
#292730darkslategray
Secondary foreground
#413a55darkslategray
#c2becasilver
Muted
#e5e2eelavender
#14111dblack
Muted foreground
#524d60dimgray
#a49fb2darkgray
Accent
#ccc6ddthistle
#3d384ddarkslategray
Accent foreground
#322a46darkslategray
#d9d6e1gainsboro
Destructive
#b02d0cfirebrick
#f0542dtomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e9e8edlavender
#221f28black
Input
#e9e8edlavender
#221f28black
Ring
#744de0slateblue
#744de0slateblue

Contrast

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

Light mode
Text on background20.81:1AAA
Text on card20.54:1AAA
Primary button5.40:1AA
Secondary button7.81:1AAA
Muted text6.36:1AA
Accent8.12:1AAA
Destructive6.48:1AA
Dark mode
Text on background20.54:1AAA
Text on card20.32:1AAA
Primary button5.40:1AA
Secondary button8.06:1AAA
Muted text7.24:1AAA
Accent7.84:1AAA
Destructive3.48:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.079 0.016 298.437);
  --muted: oklch(0.919 0.016 298.267);
  --muted-foreground: oklch(0.433 0.032 297.273);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.934 0.007 298.441);
  --input: oklch(0.934 0.007 298.441);
  --primary: oklch(0.547 0.211 289.865);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.896 0.016 298.253);
  --secondary-foreground: oklch(0.367 0.047 296.263);
  --accent: oklch(0.837 0.032 297.89);
  --accent-foreground: oklch(0.307 0.05 295.545);
  --destructive: oklch(0.502 0.173 33.967);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.547 0.211 289.865);
  --chart-1: oklch(0.547 0.211 289.865);
  --chart-2: oklch(0.896 0.016 298.253);
  --chart-3: oklch(0.837 0.032 297.89);
  --chart-4: oklch(0.922 0.012 298.34);
  --chart-5: oklch(0.543 0.218 289.312);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.104 0.014 298.478);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.188 0.023 296.324);
  --muted-foreground: oklch(0.712 0.028 297.878);
  --popover: oklch(0.12 0.016 298.458);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.12 0.016 298.458);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.247 0.016 297.399);
  --input: oklch(0.247 0.016 297.399);
  --primary: oklch(0.547 0.211 289.865);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.279 0.016 297.552);
  --secondary-foreground: oklch(0.809 0.017 298.207);
  --accent: oklch(0.354 0.037 296.699);
  --accent-foreground: oklch(0.881 0.016 298.252);
  --destructive: oklch(0.654 0.199 34.905);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.547 0.211 289.865);
  --chart-1: oklch(0.547 0.211 289.865);
  --chart-2: oklch(0.279 0.016 297.552);
  --chart-3: oklch(0.354 0.037 296.699);
  --chart-4: oklch(0.308 0.018 297.511);
  --chart-5: oklch(0.543 0.218 289.312);
}