Spry for shadcn/ui

Spry is a shadcn/ui theme built around a purple primary color (#67267d) with green accents (#3c7d26). The light mode uses a neutral background (#ffffff). Dark mode keeps the purple primary (#67267d) on a neutral background (#060307).

Color palette

TokenLightDark
Background
#ffffffwhite
#060307black
Foreground
#000000black
#ffffffwhite
Card
#fcfcfcsnow
#09040bblack
Card foreground
#000000black
#ffffffwhite
Popover
#ffffffwhite
#060307black
Popover foreground
#000000black
#ffffffwhite
Primary
#67267drebeccapurple
#67267drebeccapurple
Primary foreground
#f0e0f5lavender
#f0e0f5lavender
Secondary
#3c7d26forestgreen
#3c7d26forestgreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e1efdcgainsboro
#152310black
Muted foreground
#3c4837darkslategray
#bbc8b7silver
Accent
#3c7d26forestgreen
#3c7d26forestgreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#b01007firebrick
#f0150ared
Destructive foreground
#feeceblinen
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#67267drebeccapurple
#67267drebeccapurple

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.73:1AAA
Secondary button5.06:1AA
Muted text8.06:1AAA
Accent5.06:1AA
Destructive6.28:1AA
Dark mode
Text on background20.51:1AAA
Text on card20.28:1AAA
Primary button7.73:1AAA
Secondary button5.06:1AA
Muted text9.44:1AAA
Accent5.06:1AA
Destructive4.35:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.936 0.028 137.815);
  --muted-foreground: oklch(0.385 0.032 137.92);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --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.405 0.148 316.52);
  --primary-foreground: oklch(0.925 0.034 317.704);
  --secondary: oklch(0.527 0.137 138.899);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.527 0.137 138.899);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.481 0.19 29.492);
  --destructive-foreground: oklch(0.958 0.019 21.153);
  --ring: oklch(0.405 0.148 316.52);
  --chart-1: oklch(0.405 0.148 316.52);
  --chart-2: oklch(0.527 0.137 138.899);
  --chart-3: oklch(0.527 0.137 138.899);
  --chart-4: oklch(0.562 0.147 138.922);
  --chart-5: oklch(0.406 0.154 316.379);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.108 0.018 319.244);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.236 0.039 138.175);
  --muted-foreground: oklch(0.817 0.027 137.819);
  --popover: oklch(0.108 0.018 319.244);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.123 0.021 319.147);
  --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.405 0.148 316.52);
  --primary-foreground: oklch(0.925 0.034 317.704);
  --secondary: oklch(0.527 0.137 138.899);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.527 0.137 138.899);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.605 0.241 29.5);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.405 0.148 316.52);
  --chart-1: oklch(0.405 0.148 316.52);
  --chart-2: oklch(0.527 0.137 138.899);
  --chart-3: oklch(0.527 0.137 138.899);
  --chart-4: oklch(0.562 0.147 138.922);
  --chart-5: oklch(0.406 0.154 316.379);
}