Happiness for shadcn/ui

Happiness is a shadcn/ui theme built around a vivid light yellow primary color (#fcfce8) with vivid light purple accents (#fce8fc). The light mode uses a neutral background (#fefefb). Dark mode keeps the vivid light yellow primary (#fcfce8) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fefefbwhite
#000000black
Foreground
#111103black
#fcfcf8snow
Card
#fefefbwhite
#000000black
Card foreground
#111103black
#fcfcf8snow
Popover
#fefefbwhite
#000000black
Popover foreground
#111103black
#fcfcf8snow
Primary
#fcfce8oldlace
#fcfce8oldlace
Primary foreground
#444308darkolivegreen
#444308darkolivegreen
Secondary
#e8fcfcazure
#e8fcfcazure
Secondary foreground
#084443darkslategray
#084443darkslategray
Muted
#dee3e3gainsboro
#1c2121black
Muted foreground
#464e4edarkslategray
#b1b9b9silver
Accent
#fce8fclavenderblush
#fce8fclavenderblush
Accent foreground
#430844indigo
#430844indigo
Destructive
#5f1407maroon
#db2e0forangered
Destructive foreground
#f8ada0lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fcfce8oldlace
#fcfce8oldlace

Contrast

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

Light mode
Text on background18.74:1AAA
Text on card18.74:1AAA
Primary button9.86:1AAA
Secondary button10.32:1AAA
Muted text6.58:1AA
Accent13.34:1AAA
Destructive7.20:1AAA
Dark mode
Text on background20.41:1AAA
Text on card20.41:1AAA
Primary button9.86:1AAA
Secondary button10.32:1AAA
Muted text8.12:1AAA
Accent13.34:1AAA
Destructive4.75:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.003 105.671);
  --foreground: oklch(0.174 0.029 108.325);
  --muted: oklch(0.912 0.006 195.86);
  --muted-foreground: oklch(0.416 0.01 195.577);
  --popover: oklch(0.995 0.003 105.671);
  --popover-foreground: oklch(0.174 0.029 108.325);
  --card: oklch(0.995 0.003 105.671);
  --card-foreground: oklch(0.174 0.029 108.325);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.986 0.026 106.076);
  --primary-foreground: oklch(0.374 0.076 108.537);
  --secondary: oklch(0.977 0.021 195.601);
  --secondary-foreground: oklch(0.353 0.057 193.126);
  --accent: oklch(0.953 0.034 325.345);
  --accent-foreground: oklch(0.278 0.115 327.387);
  --destructive: oklch(0.322 0.11 32.453);
  --destructive-foreground: oklch(0.816 0.091 30.277);
  --ring: oklch(0.986 0.026 106.076);
  --chart-1: oklch(0.986 0.026 106.076);
  --chart-2: oklch(0.977 0.021 195.601);
  --chart-3: oklch(0.953 0.034 325.345);
  --chart-4: oklch(0.991 0.008 195.824);
  --chart-5: oklch(0.987 0.027 106.092);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.989 0.004 105.695);
  --muted: oklch(0.244 0.008 195.407);
  --muted-foreground: oklch(0.779 0.008 195.789);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.989 0.004 105.695);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.989 0.004 105.695);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.986 0.026 106.076);
  --primary-foreground: oklch(0.374 0.076 108.537);
  --secondary: oklch(0.977 0.021 195.601);
  --secondary-foreground: oklch(0.353 0.057 193.126);
  --accent: oklch(0.953 0.034 325.345);
  --accent-foreground: oklch(0.278 0.115 327.387);
  --destructive: oklch(0.58 0.212 31.925);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.986 0.026 106.076);
  --chart-1: oklch(0.986 0.026 106.076);
  --chart-2: oklch(0.977 0.021 195.601);
  --chart-3: oklch(0.953 0.034 325.345);
  --chart-4: oklch(0.991 0.008 195.824);
  --chart-5: oklch(0.987 0.027 106.092);
}