Happy for shadcn/ui

Happy is a shadcn/ui theme built around a neutral gray primary color (#5d6365) with neutral gray accents (#655f5d). The light mode uses a neutral background (#f7fbfd). Dark mode keeps the neutral gray primary (#5d6365) on a cyan-tinted background (#050c0f).

Color palette

TokenLightDark
Background
#f7fbfdghostwhite
#050c0fblack
Foreground
#04090cblack
#ffffffwhite
Card
#f2fafcaliceblue
#070f13black
Card foreground
#020608black
#ffffffwhite
Popover
#f2fafcaliceblue
#070f13black
Popover foreground
#020608black
#ffffffwhite
Primary
#5d6365dimgray
#5d6365dimgray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#655f5ddimgray
#655f5ddimgray
Secondary foreground
#fafafasnow
#fafafasnow
Muted
#f3eeedlinen
#120e0cblack
Muted foreground
#535150darkslategray
#afadacdarkgray
Accent
#655f5ddimgray
#655f5ddimgray
Accent foreground
#fafafasnow
#fafafasnow
Destructive
#d34209chocolate
#f65b1eorangered
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5d6365dimgray
#5d6365dimgray

Contrast

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

Light mode
Text on background19.24:1AAA
Text on card19.19:1AAA
Primary button6.13:1AA
Secondary button5.99:1AA
Muted text6.87:1AA
Accent5.99:1AA
Destructive4.62:1AA
Dark mode
Text on background19.66:1AAA
Text on card19.29:1AAA
Primary button6.13:1AA
Secondary button5.99:1AA
Muted text8.58:1AAA
Accent5.99:1AA
Destructive6.41:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.986 0.006 223.188);
  --foreground: oklch(0.135 0.013 218.671);
  --muted: oklch(0.953 0.005 43.079);
  --muted-foreground: oklch(0.436 0.003 43.059);
  --popover: oklch(0.979 0.009 223.219);
  --popover-foreground: oklch(0.118 0.012 217.966);
  --card: oklch(0.979 0.009 223.219);
  --card-foreground: oklch(0.118 0.012 217.966);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.494 0.008 223.297);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.491 0.008 42.989);
  --secondary-foreground: oklch(0.985 0 43.127);
  --accent: oklch(0.491 0.008 42.989);
  --accent-foreground: oklch(0.985 0 43.127);
  --destructive: oklch(0.582 0.19 37.317);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.494 0.008 223.297);
  --chart-1: oklch(0.494 0.008 223.297);
  --chart-2: oklch(0.491 0.008 42.989);
  --chart-3: oklch(0.491 0.008 42.989);
  --chart-4: oklch(0.518 0.008 42.988);
  --chart-5: oklch(0.496 0.014 223.438);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.149 0.014 222.002);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.169 0.008 42.765);
  --muted-foreground: oklch(0.748 0.003 43.093);
  --popover: oklch(0.163 0.016 223.776);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.163 0.016 223.776);
  --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.494 0.008 223.297);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.491 0.008 42.989);
  --secondary-foreground: oklch(0.985 0 43.127);
  --accent: oklch(0.491 0.008 42.989);
  --accent-foreground: oklch(0.985 0 43.127);
  --destructive: oklch(0.669 0.201 38.949);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.494 0.008 223.297);
  --chart-1: oklch(0.494 0.008 223.297);
  --chart-2: oklch(0.491 0.008 42.989);
  --chart-3: oklch(0.491 0.008 42.989);
  --chart-4: oklch(0.518 0.008 42.988);
  --chart-5: oklch(0.496 0.014 223.438);
}