Cheerful for shadcn/ui

Cheerful is a shadcn/ui theme built around a vivid light violet primary color (#bca8f5) with near-white accents (#ebebeb). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the vivid light violet primary (#bca8f5) on a violet-tinted background (#07050a).

Color palette

TokenLightDark
Background
#fcfbfewhite
#07050ablack
Foreground
#090416black
#f7f6f9whitesmoke
Card
#fcfbfewhite
#07050ablack
Card foreground
#090416black
#f7f6f9whitesmoke
Popover
#fcfbfewhite
#07050ablack
Popover foreground
#090416black
#f7f6f9whitesmoke
Primary
#bca8f5lightsteelblue
#bca8f5lightsteelblue
Primary foreground
#220b60midnightblue
#220b60midnightblue
Secondary
#ebebeblinen
#23202cdarkslategray
Secondary foreground
#525252darkslategray
#bab5c9silver
Muted
#f6eaealinen
#0d0915black
Muted foreground
#524242darkslategray
#b1adbddarkgray
Accent
#ebebeblinen
#23202cdarkslategray
Accent foreground
#525252darkslategray
#bab5c9silver
Destructive
#a9210ffirebrick
#ec3e27orangered
Destructive foreground
#fdeeeclinen
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#bca8f5lightsteelblue
#bca8f5lightsteelblue

Contrast

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

Light mode
Text on background19.61:1AAA
Text on card19.61:1AAA
Primary button7.82:1AAA
Secondary button6.53:1AA
Muted text8.04:1AAA
Accent6.53:1AA
Destructive6.40:1AA
Dark mode
Text on background18.83:1AAA
Text on card18.83:1AAA
Primary button7.82:1AAA
Secondary button7.99:1AAA
Muted text8.96:1AAA
Accent7.99:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 298.516);
  --foreground: oklch(0.129 0.042 295.063);
  --muted: oklch(0.946 0.013 17.38);
  --muted-foreground: oklch(0.396 0.023 18.149);
  --popover: oklch(0.99 0.003 298.516);
  --popover-foreground: oklch(0.129 0.042 295.063);
  --card: oklch(0.99 0.003 298.516);
  --card-foreground: oklch(0.129 0.042 295.063);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.777 0.111 295.975);
  --primary-foreground: oklch(0.258 0.135 283.806);
  --secondary: oklch(0.939 0 180);
  --secondary-foreground: oklch(0.437 0 180);
  --accent: oklch(0.939 0 180);
  --accent-foreground: oklch(0.437 0 180);
  --destructive: oklch(0.477 0.174 31.022);
  --destructive-foreground: oklch(0.961 0.017 26.563);
  --ring: oklch(0.777 0.111 295.975);
  --chart-1: oklch(0.777 0.111 295.975);
  --chart-2: oklch(0.939 0 180);
  --chart-3: oklch(0.939 0 180);
  --chart-4: oklch(0.962 0 180);
  --chart-5: oklch(0.774 0.115 295.86);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.122 0.013 298.499);
  --foreground: oklch(0.974 0.004 298.489);
  --muted: oklch(0.153 0.025 295.592);
  --muted-foreground: oklch(0.756 0.023 298.023);
  --popover: oklch(0.122 0.013 298.499);
  --popover-foreground: oklch(0.974 0.004 298.489);
  --card: oklch(0.122 0.013 298.499);
  --card-foreground: oklch(0.974 0.004 298.489);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.777 0.111 295.975);
  --primary-foreground: oklch(0.258 0.135 283.806);
  --secondary: oklch(0.253 0.023 296.934);
  --secondary-foreground: oklch(0.784 0.029 297.914);
  --accent: oklch(0.253 0.023 296.934);
  --accent-foreground: oklch(0.784 0.029 297.914);
  --destructive: oklch(0.624 0.214 30.997);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.777 0.111 295.975);
  --chart-1: oklch(0.777 0.111 295.975);
  --chart-2: oklch(0.253 0.023 296.934);
  --chart-3: oklch(0.253 0.023 296.934);
  --chart-4: oklch(0.282 0.027 296.849);
  --chart-5: oklch(0.774 0.115 295.86);
}