Cheerful for shadcn/ui

Cheerful is a shadcn/ui theme built around a vivid purple primary color (#f26ec8) with vivid red accents (#f26e86). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid purple primary (#f26ec8) on a neutral background (#040103).

Color palette

TokenLightDark
Background
#ffffffwhite
#040103black
Foreground
#0d020ablack
#fbf9fasnow
Card
#ffffffwhite
#040103black
Card foreground
#0d020ablack
#fbf9fasnow
Popover
#ffffffwhite
#040103black
Popover foreground
#0d020ablack
#fbf9fasnow
Primary
#f26ec8hotpink
#f26ec8hotpink
Primary foreground
#2a041eblack
#2a041eblack
Secondary
#da6ef2orchid
#da6ef2orchid
Secondary foreground
#23042ablack
#23042ablack
Muted
#dfd5e1gainsboro
#281e2adarkslategray
Muted foreground
#57435bdarkslategray
#b7a4bcdarkgray
Accent
#f26e86lightcoral
#f26e86lightcoral
Accent foreground
#2a040bblack
#2a040bblack
Destructive
#6c1309maroon
#ee4c3atomato
Destructive foreground
#f8b7aflightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#f26ec8hotpink
#f26ec8hotpink

Contrast

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

Light mode
Text on background20.38:1AAA
Text on card20.38:1AAA
Primary button6.90:1AA
Secondary button6.67:1AA
Muted text6.26:1AA
Accent6.55:1AA
Destructive7.13:1AAA
Dark mode
Text on background19.80:1AAA
Text on card19.80:1AAA
Primary button6.90:1AA
Secondary button6.67:1AA
Muted text6.94:1AA
Accent6.55:1AA
Destructive3.66:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.119 0.036 337.918);
  --muted: oklch(0.885 0.02 320.011);
  --muted-foreground: oklch(0.413 0.046 320.08);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.119 0.036 337.918);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.119 0.036 337.918);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.724 0.19 341.331);
  --primary-foreground: oklch(0.198 0.073 343.215);
  --secondary: oklch(0.713 0.209 319.991);
  --secondary-foreground: oklch(0.193 0.08 319.799);
  --accent: oklch(0.703 0.162 10.839);
  --accent-foreground: oklch(0.19 0.064 13.776);
  --destructive: oklch(0.347 0.124 30.462);
  --destructive-foreground: oklch(0.837 0.077 26.011);
  --ring: oklch(0.724 0.19 341.331);
  --chart-1: oklch(0.724 0.19 341.331);
  --chart-2: oklch(0.713 0.209 319.991);
  --chart-3: oklch(0.703 0.162 10.839);
  --chart-4: oklch(0.737 0.19 320.05);
  --chart-5: oklch(0.725 0.196 341.494);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.017 336.997);
  --foreground: oklch(0.984 0.002 336.602);
  --muted: oklch(0.251 0.027 320.077);
  --muted-foreground: oklch(0.743 0.04 320.039);
  --popover: oklch(0.085 0.017 336.997);
  --popover-foreground: oklch(0.984 0.002 336.602);
  --card: oklch(0.085 0.017 336.997);
  --card-foreground: oklch(0.984 0.002 336.602);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.724 0.19 341.331);
  --primary-foreground: oklch(0.198 0.073 343.215);
  --secondary: oklch(0.713 0.209 319.991);
  --secondary-foreground: oklch(0.193 0.08 319.799);
  --accent: oklch(0.703 0.162 10.839);
  --accent-foreground: oklch(0.19 0.064 13.776);
  --destructive: oklch(0.642 0.201 29.883);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.724 0.19 341.331);
  --chart-1: oklch(0.724 0.19 341.331);
  --chart-2: oklch(0.713 0.209 319.991);
  --chart-3: oklch(0.703 0.162 10.839);
  --chart-4: oklch(0.737 0.19 320.05);
  --chart-5: oklch(0.725 0.196 341.494);
}