Sorrowful for shadcn/ui

Sorrowful is a shadcn/ui theme built around a purple primary color (#cc5dda) with muted light purple accents (#dfd7e0). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the purple primary (#cc5dda) on a purple-tinted background (#0d070e).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#0d070eblack
Foreground
#040104black
#ffffffwhite
Card
#fdfcfdwhite
#0d070eblack
Card foreground
#040104black
#ffffffwhite
Popover
#fdfcfdwhite
#0d070eblack
Popover foreground
#040104black
#ffffffwhite
Primary
#cc5ddamediumorchid
#cc5ddamediumorchid
Primary foreground
#040104black
#040104black
Secondary
#dfd7e0gainsboro
#2f2d2fdarkslategray
Secondary foreground
#493a4bdarkslategray
#c8c6c8silver
Muted
#f1e8f2lavender
#160d17black
Muted foreground
#614f64dimgray
#ae9bb0darkgray
Accent
#dfd7e0gainsboro
#2f2d2fdarkslategray
Accent foreground
#493a4bdarkslategray
#c8c6c8silver
Destructive
#862209darkred
#f04c24orangered
Destructive foreground
#fbd0c6peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#cc5ddamediumorchid
#cc5ddamediumorchid

Contrast

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

Light mode
Text on background20.24:1AAA
Text on card20.24:1AAA
Primary button6.06:1AA
Secondary button7.48:1AAA
Muted text6.26:1AA
Accent7.48:1AAA
Destructive6.66:1AA
Dark mode
Text on background19.95:1AAA
Text on card19.95:1AAA
Primary button6.06:1AA
Secondary button8.05:1AAA
Muted text7.35:1AAA
Accent8.05:1AAA
Destructive3.64:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 322.123);
  --foreground: oklch(0.083 0.027 324.524);
  --muted: oklch(0.941 0.016 322.169);
  --muted-foreground: oklch(0.453 0.042 322.412);
  --popover: oklch(0.991 0.003 322.123);
  --popover-foreground: oklch(0.083 0.027 324.524);
  --card: oklch(0.991 0.003 322.123);
  --card-foreground: oklch(0.083 0.027 324.524);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.661 0.206 322.853);
  --primary-foreground: oklch(0.084 0.022 324.12);
  --secondary: oklch(0.887 0.015 322.172);
  --secondary-foreground: oklch(0.37 0.035 322.422);
  --accent: oklch(0.887 0.015 322.172);
  --accent-foreground: oklch(0.37 0.035 322.422);
  --destructive: oklch(0.412 0.138 34.231);
  --destructive-foreground: oklch(0.893 0.05 34.351);
  --ring: oklch(0.661 0.206 322.853);
  --chart-1: oklch(0.661 0.206 322.853);
  --chart-2: oklch(0.887 0.015 322.172);
  --chart-3: oklch(0.887 0.015 322.172);
  --chart-4: oklch(0.912 0.012 322.158);
  --chart-5: oklch(0.662 0.214 322.856);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.14 0.018 322.736);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.175 0.024 322.536);
  --muted-foreground: oklch(0.713 0.037 322.288);
  --popover: oklch(0.14 0.018 322.736);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.14 0.018 322.736);
  --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.661 0.206 322.853);
  --primary-foreground: oklch(0.084 0.022 324.12);
  --secondary: oklch(0.299 0.004 322.158);
  --secondary-foreground: oklch(0.828 0.004 322.128);
  --accent: oklch(0.299 0.004 322.158);
  --accent-foreground: oklch(0.828 0.004 322.128);
  --destructive: oklch(0.643 0.206 34.628);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.661 0.206 322.853);
  --chart-1: oklch(0.661 0.206 322.853);
  --chart-2: oklch(0.299 0.004 322.158);
  --chart-3: oklch(0.299 0.004 322.158);
  --chart-4: oklch(0.33 0.005 322.16);
  --chart-5: oklch(0.662 0.214 322.856);
}