Playful for shadcn/ui

Playful is a shadcn/ui theme built around a muted blue primary color (#4a535e) with muted light blue accents (#ced3d9). The light mode uses a neutral background (#f6fafd). Dark mode keeps the muted blue primary (#4a535e) on a neutral background (#010204).

Color palette

TokenLightDark
Background
#f6fafdghostwhite
#010204black
Foreground
#030c17black
#fcfcfdwhite
Card
#f6fafdghostwhite
#010204black
Card foreground
#030c17black
#fcfcfdwhite
Popover
#f6fafdghostwhite
#010204black
Popover foreground
#030c17black
#fcfcfdwhite
Primary
#4a535edarkslategray
#4a535edarkslategray
Primary foreground
#ebedeflavender
#ebedeflavender
Secondary
#e5e5e6gainsboro
#2b2b2cdarkslategray
Secondary foreground
#4b4c4edarkslategray
#c4c4c5silver
Muted
#f1f2f4whitesmoke
#0b0d0eblack
Muted foreground
#555758dimgray
#a7a8aadarkgray
Accent
#ced3d9lightgrey
#363a3fdarkslategray
Accent foreground
#343a42darkslategray
#d0d3d7lightgrey
Destructive
#ab2a03firebrick
#fc6436tomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4a535edarkslategray
#4a535edarkslategray

Contrast

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

Light mode
Text on background18.70:1AAA
Text on card18.70:1AAA
Primary button6.61:1AA
Secondary button6.84:1AA
Muted text6.48:1AA
Accent7.64:1AAA
Destructive6.86:1AA
Dark mode
Text on background20.19:1AAA
Text on card20.19:1AAA
Primary button6.61:1AA
Secondary button8.09:1AAA
Muted text8.19:1AAA
Accent7.59:1AAA
Destructive7.02:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.006 251.5);
  --foreground: oklch(0.151 0.028 247.856);
  --muted: oklch(0.961 0.003 251.473);
  --muted-foreground: oklch(0.454 0.004 251.516);
  --popover: oklch(0.983 0.006 251.5);
  --popover-foreground: oklch(0.151 0.028 247.856);
  --card: oklch(0.983 0.006 251.5);
  --card-foreground: oklch(0.151 0.028 247.856);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.44 0.021 251.807);
  --primary-foreground: oklch(0.945 0.004 251.483);
  --secondary: oklch(0.923 0.001 251.458);
  --secondary-foreground: oklch(0.417 0.003 251.514);
  --accent: oklch(0.866 0.009 251.537);
  --accent-foreground: oklch(0.346 0.016 251.788);
  --destructive: oklch(0.488 0.17 34.747);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.44 0.021 251.807);
  --chart-1: oklch(0.44 0.021 251.807);
  --chart-2: oklch(0.923 0.001 251.458);
  --chart-3: oklch(0.866 0.009 251.537);
  --chart-4: oklch(0.946 0.001 251.456);
  --chart-5: oklch(0.438 0.027 251.889);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.089 0.009 244.263);
  --foreground: oklch(0.992 0.001 251.456);
  --muted: oklch(0.156 0.004 251.657);
  --muted-foreground: oklch(0.731 0.003 251.487);
  --popover: oklch(0.089 0.009 244.263);
  --popover-foreground: oklch(0.992 0.001 251.456);
  --card: oklch(0.089 0.009 244.263);
  --card-foreground: oklch(0.992 0.001 251.456);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.44 0.021 251.807);
  --primary-foreground: oklch(0.945 0.004 251.483);
  --secondary: oklch(0.29 0.001 251.479);
  --secondary-foreground: oklch(0.821 0.001 251.461);
  --accent: oklch(0.348 0.011 251.682);
  --accent-foreground: oklch(0.867 0.006 251.509);
  --destructive: oklch(0.691 0.195 37.045);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.44 0.021 251.807);
  --chart-1: oklch(0.44 0.021 251.807);
  --chart-2: oklch(0.29 0.001 251.479);
  --chart-3: oklch(0.348 0.011 251.682);
  --chart-4: oklch(0.321 0.001 251.48);
  --chart-5: oklch(0.438 0.027 251.889);
}