Happy for shadcn/ui

Happy is a shadcn/ui theme built around a vivid purple primary color (#d566eb) with vivid pink accents (#eb66bf). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid purple primary (#d566eb) on a purple-tinted background (#0a040b).

Color palette

TokenLightDark
Background
#ffffffwhite
#0a040bblack
Foreground
#0f0411black
#fdfcfdwhite
Card
#fcfcfcsnow
#0d060fblack
Card foreground
#0b030dblack
#ffffffwhite
Popover
#fcfcfcsnow
#0d060fblack
Popover foreground
#0b030dblack
#ffffffwhite
Primary
#d566eborchid
#d566eborchid
Primary foreground
#17041bblack
#17041bblack
Secondary
#9266ebmediumpurple
#9266ebmediumpurple
Secondary foreground
#000000black
#000000black
Muted
#dfdce4gainsboro
#1d1b23black
Muted foreground
#403c49darkslategray
#bab6c3silver
Accent
#eb66bfhotpink
#eb66bfhotpink
Accent foreground
#1b0413black
#1b0413black
Destructive
#731f0dmaroon
#e95a3atomato
Destructive foreground
#f7c5balightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d566eborchid
#d566eborchid

Contrast

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

Light mode
Text on background20.08:1AAA
Text on card19.89:1AAA
Primary button6.45:1AA
Secondary button5.30:1AA
Muted text7.92:1AAA
Accent6.67:1AA
Destructive7.06:1AAA
Dark mode
Text on background19.80:1AAA
Text on card20.02:1AAA
Primary button6.45:1AA
Secondary button5.30:1AA
Muted text8.59:1AAA
Accent6.67:1AA
Destructive5.98:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.134 0.038 321.64);
  --muted: oklch(0.9 0.011 301.294);
  --muted-foreground: oklch(0.365 0.023 300.463);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.12 0.033 322.283);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.12 0.033 322.283);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.692 0.214 320.693);
  --primary-foreground: oklch(0.158 0.057 321.144);
  --secondary: oklch(0.619 0.193 295.574);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.701 0.192 342.454);
  --accent-foreground: oklch(0.16 0.052 342.203);
  --destructive: oklch(0.373 0.12 33.891);
  --destructive-foreground: oklch(0.866 0.06 32.845);
  --ring: oklch(0.692 0.214 320.693);
  --chart-1: oklch(0.692 0.214 320.693);
  --chart-2: oklch(0.619 0.193 295.574);
  --chart-3: oklch(0.701 0.192 342.454);
  --chart-4: oklch(0.651 0.177 296.544);
  --chart-5: oklch(0.693 0.22 320.673);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.124 0.022 321.886);
  --foreground: oklch(0.991 0.003 320.536);
  --muted: oklch(0.227 0.016 300.375);
  --muted-foreground: oklch(0.784 0.019 301.1);
  --popover: oklch(0.137 0.025 321.239);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.137 0.025 321.239);
  --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.692 0.214 320.693);
  --primary-foreground: oklch(0.158 0.057 321.144);
  --secondary: oklch(0.619 0.193 295.574);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.701 0.192 342.454);
  --accent-foreground: oklch(0.16 0.052 342.203);
  --destructive: oklch(0.65 0.184 34.148);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.692 0.214 320.693);
  --chart-1: oklch(0.692 0.214 320.693);
  --chart-2: oklch(0.619 0.193 295.574);
  --chart-3: oklch(0.701 0.192 342.454);
  --chart-4: oklch(0.651 0.177 296.544);
  --chart-5: oklch(0.693 0.22 320.673);
}