Spandex for shadcn/ui

Spandex is a shadcn/ui theme built around a deep purple primary color (#5d1f60) with deep teal accents (#1f605d). The light mode uses a neutral background (#fcf8fc). Dark mode keeps the deep purple primary (#5d1f60) on a purple-tinted background (#0a050a).

Color palette

TokenLightDark
Background
#fcf8fcsnow
#0a050ablack
Foreground
#040104black
#ffffffwhite
Card
#faf4fbghostwhite
#0e070eblack
Card foreground
#000000black
#ffffffwhite
Popover
#fcf8fcsnow
#0a050ablack
Popover foreground
#040104black
#ffffffwhite
Primary
#5d1f60indigo
#5d1f60indigo
Primary foreground
#eac5ecthistle
#eac5ecthistle
Secondary
#605d1fdarkolivegreen
#605d1fdarkolivegreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#f3f3ecwhitesmoke
#13120cblack
Muted foreground
#434342darkslategray
#bdbdbcsilver
Accent
#1f605ddarkslategray
#1f605ddarkslategray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#c9520dchocolate
#eb600fchocolate
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5d1f60indigo
#5d1f60indigo

Contrast

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

Light mode
Text on background19.71:1AAA
Text on card19.41:1AAA
Primary button7.46:1AAA
Secondary button6.80:1AA
Muted text8.88:1AAA
Accent7.24:1AAA
Destructive4.46:1AA Large
Dark mode
Text on background20.21:1AAA
Text on card19.95:1AAA
Primary button7.46:1AAA
Secondary button6.80:1AA
Muted text9.95:1AAA
Accent7.24:1AAA
Destructive6.19:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.007 324.172);
  --foreground: oklch(0.084 0.027 326.333);
  --muted: oklch(0.962 0.009 104.129);
  --muted-foreground: oklch(0.382 0.002 104.066);
  --popover: oklch(0.983 0.007 324.172);
  --popover-foreground: oklch(0.084 0.027 326.333);
  --card: oklch(0.974 0.011 324.193);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.363 0.125 325.716);
  --primary-foreground: oklch(0.868 0.066 324.559);
  --secondary: oklch(0.468 0.082 106.291);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.448 0.065 190.405);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.587 0.167 43.586);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.363 0.125 325.716);
  --chart-1: oklch(0.363 0.125 325.716);
  --chart-2: oklch(0.468 0.082 106.291);
  --chart-3: oklch(0.448 0.065 190.405);
  --chart-4: oklch(0.507 0.09 106.299);
  --chart-5: oklch(0.364 0.13 325.754);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.018 325.187);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.182 0.013 105.112);
  --muted-foreground: oklch(0.799 0.002 104.009);
  --popover: oklch(0.127 0.018 325.187);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.14 0.021 325.02);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.363 0.125 325.716);
  --primary-foreground: oklch(0.868 0.066 324.559);
  --secondary: oklch(0.468 0.082 106.291);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.448 0.065 190.405);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.657 0.189 43.3);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.363 0.125 325.716);
  --chart-1: oklch(0.363 0.125 325.716);
  --chart-2: oklch(0.468 0.082 106.291);
  --chart-3: oklch(0.448 0.065 190.405);
  --chart-4: oklch(0.507 0.09 106.299);
  --chart-5: oklch(0.364 0.13 325.754);
}