Contagion for shadcn/ui

Contagion is a shadcn/ui theme built around a light blue primary color (#ecf2f8) with light green accents (#f2f8ec). The light mode uses a neutral background (#f7fafd). Dark mode keeps the light blue primary (#ecf2f8) on a blue-tinted background (#050a0f).

Color palette

TokenLightDark
Background
#f7fafdghostwhite
#050a0fblack
Foreground
#020508black
#f6f7f9whitesmoke
Card
#f7fafdghostwhite
#050a0fblack
Card foreground
#020508black
#f6f7f9whitesmoke
Popover
#f7fafdghostwhite
#050a0fblack
Popover foreground
#020508black
#f6f7f9whitesmoke
Primary
#ecf2f8whitesmoke
#ecf2f8whitesmoke
Primary foreground
#2e5984darkslateblue
#2e5984darkslateblue
Secondary
#f8ecf2lavenderblush
#f8ecf2lavenderblush
Secondary foreground
#842e59brown
#842e59brown
Muted
#e7dae0gainsboro
#25181fblack
Muted foreground
#65535cdimgray
#ac9aa3darkgray
Accent
#f2f8echoneydew
#f2f8echoneydew
Accent foreground
#263914darkgreen
#263914darkgreen
Destructive
#741106maroon
#f3311borangered
Destructive foreground
#fbb9b1lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#ecf2f8whitesmoke
#ecf2f8whitesmoke

Contrast

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

Light mode
Text on background19.48:1AAA
Text on card19.48:1AAA
Primary button6.48:1AA
Secondary button7.27:1AAA
Muted text5.25:1AA
Accent11.60:1AAA
Destructive6.92:1AA
Dark mode
Text on background18.51:1AAA
Text on card18.51:1AAA
Primary button6.48:1AA
Secondary button7.27:1AAA
Muted text6.43:1AA
Accent11.60:1AAA
Destructive3.98:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.006 247.882);
  --foreground: oklch(0.112 0.014 238.891);
  --muted: oklch(0.9 0.017 345.637);
  --muted-foreground: oklch(0.462 0.028 346.658);
  --popover: oklch(0.983 0.006 247.882);
  --popover-foreground: oklch(0.112 0.014 238.891);
  --card: oklch(0.983 0.006 247.882);
  --card-foreground: oklch(0.112 0.014 238.891);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.959 0.011 247.936);
  --primary-foreground: oklch(0.455 0.085 250.216);
  --secondary: oklch(0.955 0.015 345.561);
  --secondary-foreground: oklch(0.441 0.126 352.524);
  --accent: oklch(0.972 0.017 128.661);
  --accent-foreground: oklch(0.317 0.063 131.308);
  --destructive: oklch(0.362 0.134 30.649);
  --destructive-foreground: oklch(0.844 0.078 26.007);
  --ring: oklch(0.959 0.011 247.936);
  --chart-1: oklch(0.959 0.011 247.936);
  --chart-2: oklch(0.955 0.015 345.561);
  --chart-3: oklch(0.972 0.017 128.661);
  --chart-4: oklch(0.982 0.006 345.306);
  --chart-5: oklch(0.959 0.011 247.943);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.142 0.015 244.338);
  --foreground: oklch(0.976 0.003 247.849);
  --muted: oklch(0.228 0.025 347.776);
  --muted-foreground: oklch(0.705 0.025 346.048);
  --popover: oklch(0.142 0.015 244.338);
  --popover-foreground: oklch(0.976 0.003 247.849);
  --card: oklch(0.142 0.015 244.338);
  --card-foreground: oklch(0.976 0.003 247.849);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.959 0.011 247.936);
  --primary-foreground: oklch(0.455 0.085 250.216);
  --secondary: oklch(0.955 0.015 345.561);
  --secondary-foreground: oklch(0.441 0.126 352.524);
  --accent: oklch(0.972 0.017 128.661);
  --accent-foreground: oklch(0.317 0.063 131.308);
  --destructive: oklch(0.625 0.23 30.518);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.959 0.011 247.936);
  --chart-1: oklch(0.959 0.011 247.936);
  --chart-2: oklch(0.955 0.015 345.561);
  --chart-3: oklch(0.972 0.017 128.661);
  --chart-4: oklch(0.982 0.006 345.306);
  --chart-5: oklch(0.959 0.011 247.943);
}