Analgesia for shadcn/ui

Analgesia is a shadcn/ui theme built around a light indigo primary color (#f1f1f9) with muted light indigo accents (#d5d5dd). The light mode uses a neutral background (#ffffff). Dark mode keeps the light indigo primary (#f1f1f9) on a neutral background (#030307).

Color palette

TokenLightDark
Background
#ffffffwhite
#030307black
Foreground
#010104black
#f6f6f9whitesmoke
Card
#fcfcfcsnow
#05040bblack
Card foreground
#000000black
#f9f9fbghostwhite
Popover
#ffffffwhite
#030307black
Popover foreground
#010104black
#f6f6f9whitesmoke
Primary
#f1f1f9whitesmoke
#f1f1f9whitesmoke
Primary foreground
#3e397fdarkslateblue
#3e397fdarkslateblue
Secondary
#d5d5ddgainsboro
#2a2938darkslategray
Secondary foreground
#3a3947darkslategray
#c2c1d1silver
Muted
#e1e0ebgainsboro
#15141fblack
Muted foreground
#464649darkslategray
#b6b6b9silver
Accent
#d5d5ddgainsboro
#2a2938darkslategray
Accent foreground
#3a3947darkslategray
#c2c1d1silver
Destructive
#974211saddlebrown
#e76e27chocolate
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#f1f1f9whitesmoke
#f1f1f9whitesmoke

Contrast

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

Light mode
Text on background20.84:1AAA
Text on card20.54:1AAA
Primary button8.91:1AAA
Secondary button7.72:1AAA
Muted text7.18:1AAA
Accent7.72:1AAA
Destructive6.73:1AA
Dark mode
Text on background19.08:1AAA
Text on card19.38:1AAA
Primary button8.91:1AAA
Secondary button8.02:1AAA
Muted text9.02:1AAA
Accent8.02:1AAA
Destructive6.64:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.078 0.015 286.658);
  --muted: oklch(0.91 0.015 289.164);
  --muted-foreground: oklch(0.395 0.005 289.252);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.078 0.015 286.658);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.961 0.01 289.276);
  --primary-foreground: oklch(0.388 0.114 282.694);
  --secondary: oklch(0.875 0.011 289.231);
  --secondary-foreground: oklch(0.35 0.024 288.134);
  --accent: oklch(0.875 0.011 289.231);
  --accent-foreground: oklch(0.35 0.024 288.134);
  --destructive: oklch(0.485 0.128 45.51);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.961 0.01 289.276);
  --chart-1: oklch(0.961 0.01 289.276);
  --chart-2: oklch(0.875 0.011 289.231);
  --chart-3: oklch(0.875 0.011 289.231);
  --chart-4: oklch(0.9 0.009 289.288);
  --chart-5: oklch(0.96 0.011 289.26);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.015 287.284);
  --foreground: oklch(0.974 0.003 289.416);
  --muted: oklch(0.197 0.022 287.208);
  --muted-foreground: oklch(0.778 0.004 289.382);
  --popover: oklch(0.101 0.015 287.284);
  --popover-foreground: oklch(0.974 0.003 289.416);
  --card: oklch(0.116 0.018 287.268);
  --card-foreground: oklch(0.983 0.002 289.437);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.961 0.01 289.276);
  --primary-foreground: oklch(0.388 0.114 282.694);
  --secondary: oklch(0.289 0.026 287.681);
  --secondary-foreground: oklch(0.818 0.022 288.96);
  --accent: oklch(0.289 0.026 287.681);
  --accent-foreground: oklch(0.818 0.022 288.96);
  --destructive: oklch(0.672 0.17 46.334);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.961 0.01 289.276);
  --chart-1: oklch(0.961 0.01 289.276);
  --chart-2: oklch(0.289 0.026 287.681);
  --chart-3: oklch(0.289 0.026 287.681);
  --chart-4: oklch(0.316 0.03 287.615);
  --chart-5: oklch(0.96 0.011 289.26);
}