Naive for shadcn/ui

Naive is a shadcn/ui theme built around a muted violet primary color (#b592c3) with muted green accents (#a0c392). The light mode uses a neutral background (#fbf8fc). Dark mode keeps the muted violet primary (#b592c3) on a neutral background (#060308).

Color palette

TokenLightDark
Background
#fbf8fcghostwhite
#060308black
Foreground
#09040cblack
#fbf8fcghostwhite
Card
#f9f4fawhitesmoke
#09040bblack
Card foreground
#060208black
#fdfbfdsnow
Popover
#f9f4fawhitesmoke
#09040bblack
Popover foreground
#060208black
#fdfbfdsnow
Primary
#b592c3darkgray
#b592c3darkgray
Primary foreground
#140d17black
#140d17black
Secondary
#a0c392darkseagreen
#a0c392darkseagreen
Secondary foreground
#10170dblack
#10170dblack
Muted
#e2eddegainsboro
#162112black
Muted foreground
#5b6e53dimgray
#98ac91darkseagreen
Accent
#a0c392darkseagreen
#a0c392darkseagreen
Accent foreground
#10170dblack
#10170dblack
Destructive
#a41204darkred
#f91f0bred
Destructive foreground
#fedfdcmistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b592c3darkgray
#b592c3darkgray

Contrast

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

Light mode
Text on background19.25:1AAA
Text on card19.00:1AAA
Primary button7.18:1AAA
Secondary button9.34:1AAA
Muted text4.57:1AA
Accent9.34:1AAA
Destructive6.30:1AA
Dark mode
Text on background19.49:1AAA
Text on card19.71:1AAA
Primary button7.18:1AAA
Secondary button9.34:1AAA
Muted text6.86:1AA
Accent9.34:1AAA
Destructive4.02:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.006 316.591);
  --foreground: oklch(0.121 0.025 318.167);
  --muted: oklch(0.934 0.023 136.682);
  --muted-foreground: oklch(0.516 0.048 136.917);
  --popover: oklch(0.973 0.009 316.581);
  --popover-foreground: oklch(0.106 0.022 318.388);
  --card: oklch(0.973 0.009 316.581);
  --card-foreground: oklch(0.106 0.022 318.388);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.71 0.08 316.275);
  --primary-foreground: oklch(0.173 0.024 316.187);
  --secondary: oklch(0.78 0.077 136.944);
  --secondary-foreground: oklch(0.193 0.023 137.03);
  --accent: oklch(0.78 0.077 136.944);
  --accent-foreground: oklch(0.193 0.023 137.03);
  --destructive: oklch(0.458 0.179 30.201);
  --destructive-foreground: oklch(0.929 0.035 23.983);
  --ring: oklch(0.71 0.08 316.275);
  --chart-1: oklch(0.71 0.08 316.275);
  --chart-2: oklch(0.78 0.077 136.944);
  --chart-3: oklch(0.78 0.077 136.944);
  --chart-4: oklch(0.8 0.07 136.898);
  --chart-5: oklch(0.707 0.088 316.236);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.107 0.02 318.239);
  --foreground: oklch(0.982 0.006 316.591);
  --muted: oklch(0.232 0.031 137.104);
  --muted-foreground: oklch(0.721 0.044 136.803);
  --popover: oklch(0.122 0.023 318.085);
  --popover-foreground: oklch(0.991 0.003 316.6);
  --card: oklch(0.122 0.023 318.085);
  --card-foreground: oklch(0.991 0.003 316.6);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.71 0.08 316.275);
  --primary-foreground: oklch(0.173 0.024 316.187);
  --secondary: oklch(0.78 0.077 136.944);
  --secondary-foreground: oklch(0.193 0.023 137.03);
  --accent: oklch(0.78 0.077 136.944);
  --accent-foreground: oklch(0.193 0.023 137.03);
  --destructive: oklch(0.625 0.245 30.048);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.71 0.08 316.275);
  --chart-1: oklch(0.71 0.08 316.275);
  --chart-2: oklch(0.78 0.077 136.944);
  --chart-3: oklch(0.78 0.077 136.944);
  --chart-4: oklch(0.8 0.07 136.898);
  --chart-5: oklch(0.707 0.088 316.236);
}