Shades of Purple for shadcn/ui

Shades of Purple is a shadcn/ui theme built around a vivid yellow primary color (#fad000) with indigo accents (#484488). The light mode uses an indigo-tinted background (#2d2b55). Dark mode keeps the vivid yellow primary (#fad000) on an indigo-tinted background (#2d2b55).

Color palette

TokenLightDark
Background
#2d2b55darkslategray
#2d2b55darkslategray
Foreground
#ffffffwhite
#ffffffwhite
Card
#29274emidnightblue
#29274emidnightblue
Card foreground
#ffffffwhite
#ffffffwhite
Popover
#27264bmidnightblue
#27264bmidnightblue
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#fad000gold
#fad000gold
Primary foreground
#2e2600black
#2e2600black
Secondary
#534d2ddarkolivegreen
#534d2ddarkolivegreen
Secondary foreground
#e4e0cdgainsboro
#e4e0cdgainsboro
Muted
#424153darkslategray
#424153darkslategray
Muted foreground
#c4c3d0silver
#c4c3d0silver
Accent
#484488darkslateblue
#484488darkslateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#da1f16crimson
#da1f16crimson
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#3d3b5edarkslategray
#3d3b5edarkslategray
Input
#434168darkslategray
#434168darkslategray
Ring
#fad000gold
#fad000gold

Contrast

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

Light mode
Text on background13.26:1AAA
Text on card14.00:1AAA
Primary button10.12:1AAA
Secondary button6.46:1AA
Muted text5.70:1AA
Accent8.52:1AAA
Destructive5.00:1AA
Dark mode
Text on background13.26:1AAA
Text on card14.00:1AAA
Primary button10.12:1AAA
Secondary button6.46:1AA
Muted text5.70:1AA
Accent8.52:1AAA
Destructive5.00:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.313 0.074 283.536);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.384 0.03 287.185);
  --muted-foreground: oklch(0.822 0.018 288.301);
  --popover: oklch(0.289 0.066 283.705);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.297 0.069 283.645);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.37 0.06 285.363);
  --input: oklch(0.394 0.065 285.302);
  --primary: oklch(0.869 0.178 94.261);
  --primary-foreground: oklch(0.27 0.056 97.716);
  --secondary: oklch(0.416 0.049 98.29);
  --secondary-foreground: oklch(0.906 0.026 97.622);
  --accent: oklch(0.426 0.109 283.012);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.569 0.218 29.281);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.869 0.178 94.261);
  --chart-1: oklch(0.869 0.178 94.261);
  --chart-2: oklch(0.416 0.049 98.29);
  --chart-3: oklch(0.426 0.109 283.012);
  --chart-4: oklch(0.45 0.054 98.292);
  --chart-5: oklch(0.877 0.18 94.014);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.313 0.074 283.536);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.384 0.03 287.185);
  --muted-foreground: oklch(0.822 0.018 288.301);
  --popover: oklch(0.289 0.066 283.705);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.297 0.069 283.645);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.37 0.06 285.363);
  --input: oklch(0.394 0.065 285.302);
  --primary: oklch(0.869 0.178 94.261);
  --primary-foreground: oklch(0.27 0.056 97.716);
  --secondary: oklch(0.416 0.049 98.29);
  --secondary-foreground: oklch(0.906 0.026 97.622);
  --accent: oklch(0.426 0.109 283.012);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.569 0.218 29.281);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.869 0.178 94.261);
  --chart-1: oklch(0.869 0.178 94.261);
  --chart-2: oklch(0.416 0.049 98.29);
  --chart-3: oklch(0.426 0.109 283.012);
  --chart-4: oklch(0.45 0.054 98.292);
  --chart-5: oklch(0.877 0.18 94.014);
}