Alert for shadcn/ui

Alert is a shadcn/ui theme built around a muted deep blue primary color (#1b2228) with muted deep green accents (#22281b). The light mode uses a neutral background (#f7fafd). Dark mode keeps the muted deep blue primary (#1b2228) on a blue-tinted background (#070b0d).

Color palette

TokenLightDark
Background
#f7fafdghostwhite
#070b0dblack
Foreground
#050b0fblack
#ffffffwhite
Card
#f2f8fcaliceblue
#090d11black
Card foreground
#04080bblack
#ffffffwhite
Popover
#f2f8fcaliceblue
#090d11black
Popover foreground
#04080bblack
#ffffffwhite
Primary
#1b2228black
#1b2228black
Primary foreground
#acbcc8silver
#acbcc8silver
Secondary
#281b22black
#281b22black
Secondary foreground
#c8acbcsilver
#c8acbcsilver
Muted
#f5f0f3whitesmoke
#0f0a0dblack
Muted foreground
#635a5fdimgray
#a59ca1darkgray
Accent
#22281bblack
#22281bblack
Accent foreground
#bcc8acsilver
#bcc8acsilver
Destructive
#8d110cdarkred
#ed3b35crimson
Destructive foreground
#fbd2d0pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1b2228black
#1b2228black

Contrast

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

Light mode
Text on background18.93:1AAA
Text on card18.80:1AAA
Primary button8.24:1AAA
Secondary button7.96:1AAA
Muted text5.89:1AA
Accent8.66:1AAA
Destructive6.88:1AA
Dark mode
Text on background19.77:1AAA
Text on card19.46:1AAA
Primary button8.24:1AAA
Secondary button7.96:1AAA
Muted text7.34:1AAA
Accent8.66:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.984 0.005 238.441);
  --foreground: oklch(0.145 0.014 236.032);
  --muted: oklch(0.959 0.006 341.168);
  --muted-foreground: oklch(0.477 0.015 341.724);
  --popover: oklch(0.976 0.008 238.481);
  --popover-foreground: oklch(0.131 0.012 232.347);
  --card: oklch(0.976 0.008 238.481);
  --card-foreground: oklch(0.131 0.012 232.347);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.248 0.015 239.322);
  --primary-foreground: oklch(0.788 0.024 238.808);
  --secondary: oklch(0.24 0.025 343.293);
  --secondary-foreground: oklch(0.774 0.039 342.135);
  --accent: oklch(0.266 0.025 126.411);
  --accent-foreground: oklch(0.816 0.04 125.731);
  --destructive: oklch(0.412 0.158 28.796);
  --destructive-foreground: oklch(0.897 0.047 20.39);
  --ring: oklch(0.248 0.015 239.322);
  --chart-1: oklch(0.248 0.015 239.322);
  --chart-2: oklch(0.24 0.025 343.293);
  --chart-3: oklch(0.266 0.025 126.411);
  --chart-4: oklch(0.27 0.03 343.426);
  --chart-5: oklch(0.248 0.018 239.487);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.145 0.009 237.046);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.154 0.01 342.486);
  --muted-foreground: oklch(0.702 0.013 341.455);
  --popover: oklch(0.158 0.011 239.109);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.158 0.011 239.109);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.248 0.015 239.322);
  --primary-foreground: oklch(0.788 0.024 238.808);
  --secondary: oklch(0.24 0.025 343.293);
  --secondary-foreground: oklch(0.774 0.039 342.135);
  --accent: oklch(0.266 0.025 126.411);
  --accent-foreground: oklch(0.816 0.04 125.731);
  --destructive: oklch(0.625 0.215 27.514);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.248 0.015 239.322);
  --chart-1: oklch(0.248 0.015 239.322);
  --chart-2: oklch(0.24 0.025 343.293);
  --chart-3: oklch(0.266 0.025 126.411);
  --chart-4: oklch(0.27 0.03 343.426);
  --chart-5: oklch(0.248 0.018 239.487);
}