Impure for shadcn/ui

Impure is a shadcn/ui theme built around a violet primary color (#522fa2) with green accents (#2fa252). The light mode uses a neutral background (#f9f8fc). Dark mode keeps the violet primary (#522fa2) on a violet-tinted background (#09070e).

Color palette

TokenLightDark
Background
#f9f8fcghostwhite
#09070eblack
Foreground
#080411black
#f9f9fbghostwhite
Card
#f9f8fcghostwhite
#09070eblack
Card foreground
#080411black
#f9f9fbghostwhite
Popover
#f9f8fcghostwhite
#09070eblack
Popover foreground
#080411black
#f9f9fbghostwhite
Primary
#522fa2rebeccapurple
#522fa2rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a2522fsienna
#a2522fsienna
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e9e8e7linen
#181616black
Muted foreground
#625d5bdimgray
#a49f9ddarkgray
Accent
#2fa252seagreen
#2fa252seagreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#6b0201maroon
#ef0501red
Destructive foreground
#ffa09flightsalmon
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#522fa2rebeccapurple
#522fa2rebeccapurple

Contrast

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

Light mode
Text on background19.11:1AAA
Text on card19.11:1AAA
Primary button9.19:1AAA
Secondary button5.56:1AA
Muted text5.29:1AA
Accent3.27:1AA Large
Destructive6.61:1AA
Dark mode
Text on background19.07:1AAA
Text on card19.07:1AAA
Primary button9.19:1AAA
Secondary button5.56:1AA
Muted text6.86:1AA
Accent3.27:1AA Large
Destructive4.49:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.007 299.926);
  --foreground: oklch(0.122 0.034 298.662);
  --muted: oklch(0.931 0.002 44.96);
  --muted-foreground: oklch(0.482 0.008 44.823);
  --popover: oklch(0.98 0.007 299.926);
  --popover-foreground: oklch(0.122 0.034 298.662);
  --card: oklch(0.98 0.007 299.926);
  --card-foreground: oklch(0.122 0.034 298.662);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.419 0.174 290.674);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.529 0.117 42.807);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.63 0.155 149.238);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.332 0.134 29.512);
  --destructive-foreground: oklch(0.801 0.113 20.923);
  --ring: oklch(0.419 0.174 290.674);
  --chart-1: oklch(0.419 0.174 290.674);
  --chart-2: oklch(0.529 0.117 42.807);
  --chart-3: oklch(0.63 0.155 149.238);
  --chart-4: oklch(0.556 0.124 42.773);
  --chart-5: oklch(0.417 0.181 289.906);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.134 0.016 299.379);
  --foreground: oklch(0.983 0.003 299.988);
  --muted: oklch(0.204 0.003 44.839);
  --muted-foreground: oklch(0.707 0.007 44.881);
  --popover: oklch(0.134 0.016 299.379);
  --popover-foreground: oklch(0.983 0.003 299.988);
  --card: oklch(0.134 0.016 299.379);
  --card-foreground: oklch(0.983 0.003 299.988);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.419 0.174 290.674);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.529 0.117 42.807);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.63 0.155 149.238);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.598 0.244 29.339);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.419 0.174 290.674);
  --chart-1: oklch(0.419 0.174 290.674);
  --chart-2: oklch(0.529 0.117 42.807);
  --chart-3: oklch(0.63 0.155 149.238);
  --chart-4: oklch(0.556 0.124 42.773);
  --chart-5: oklch(0.417 0.181 289.906);
}