Educational Purple Emperor for shadcn/ui

Educational Purple Emperor is a shadcn/ui theme built around a violet primary color (#6638b8) with muted light blue accents (#f3f4f6). The light mode uses a neutral background (#f9fafb). Dark mode keeps the violet primary (#916ce7) on a neutral background (#050505).

Color palette

TokenLightDark
Background
#f9fafbghostwhite
#050505black
Foreground
#111827black
#e6e6e6gainsboro
Card
#ffffffwhite
#191919black
Card foreground
#111827black
#e6e6e6gainsboro
Popover
#ffffffwhite
#101010black
Popover foreground
#111827black
#e6e6e6gainsboro
Primary
#6638b8rebeccapurple
#916ce7mediumpurple
Primary foreground
#ffffffwhite
#e6e6e6gainsboro
Secondary
#ffffffwhite
#000000black
Secondary foreground
#111827black
#e6e6e6gainsboro
Muted
#e5e7eblavender
#131615black
Muted foreground
#6b7280slategray
#999999darkgray
Accent
#f3f4f6whitesmoke
#282828darkslategray
Accent foreground
#111827black
#999999darkgray
Destructive
#dd3327crimson
#c62a1ffirebrick
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#232323black
Input
#e5e7eblavender
#2d2d2ddarkslategray
Ring
#c2ade6lightsteelblue
#c2ade6lightsteelblue

Contrast

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

Light mode
Text on background16.97:1AAA
Text on card17.73:1AAA
Primary button7.43:1AAA
Secondary button17.73:1AAA
Muted text3.90:1AA Large
Accent16.11:1AAA
Destructive4.58:1AA
Dark mode
Text on background16.33:1AAA
Text on card14.08:1AAA
Primary button3.05:1AA Large
Secondary button16.82:1AAA
Muted text6.38:1AA
Accent5.17:1AA
Destructive5.59:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.985 0.002 247.839);
  --foreground: oklch(0.21 0.032 264.665);
  --muted: oklch(0.928 0.006 264.531);
  --muted-foreground: oklch(0.551 0.023 264.364);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.21 0.032 264.665);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.21 0.032 264.665);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.471 0.19 294.423);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(1 0 180);
  --secondary-foreground: oklch(0.21 0.032 264.665);
  --accent: oklch(0.967 0.003 264.542);
  --accent-foreground: oklch(0.21 0.032 264.665);
  --destructive: oklch(0.588 0.208 29.123);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.785 0.083 301.386);
  --chart-1: oklch(0.785 0.083 301.386);
  --chart-2: oklch(0.629 0.105 202.249);
  --chart-3: oklch(0.779 0.147 79.96);
  --chart-4: oklch(0.612 0.209 6.142);
  --chart-5: oklch(0.528 0.194 262.447);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.115 0 171.254);
  --foreground: oklch(0.925 0 180);
  --muted: oklch(0.197 0.006 169.664);
  --muted-foreground: oklch(0.683 0 180);
  --popover: oklch(0.173 0 160.017);
  --popover-foreground: oklch(0.925 0 180);
  --card: oklch(0.213 0 168.69);
  --card-foreground: oklch(0.925 0 180);
  --border: oklch(0.256 0 180);
  --input: oklch(0.297 0 180);
  --primary: oklch(0.626 0.179 294.53);
  --primary-foreground: oklch(0.925 0 180);
  --secondary: oklch(0 0 0);
  --secondary-foreground: oklch(0.925 0 180);
  --accent: oklch(0.277 0 172.875);
  --accent-foreground: oklch(0.683 0 180);
  --destructive: oklch(0.539 0.193 29.241);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.785 0.083 301.386);
  --chart-1: oklch(0.878 0.047 301.984);
  --chart-2: oklch(0.751 0.087 201.179);
  --chart-3: oklch(0.81 0.128 82.946);
  --chart-4: oklch(0.656 0.179 2.735);
  --chart-5: oklch(0.595 0.166 263.156);
}