Alert for shadcn/ui

Alert is a shadcn/ui theme built around a muted deep blue primary color (#3b3d4a) with muted deep violet accents (#403b4a). The light mode uses a neutral background (#f7f8fc). Dark mode keeps the muted deep blue primary (#3b3d4a) on a neutral background (#020308).

Color palette

TokenLightDark
Background
#f7f8fcghostwhite
#020308black
Foreground
#000000black
#f9f9fbghostwhite
Card
#f7f8fcghostwhite
#020308black
Card foreground
#000000black
#f9f9fbghostwhite
Popover
#f7f8fcghostwhite
#020308black
Popover foreground
#000000black
#f9f9fbghostwhite
Primary
#3b3d4adarkslategray
#3b3d4adarkslategray
Primary foreground
#d7d8dfgainsboro
#d7d8dfgainsboro
Secondary
#3b444adarkslategray
#3b444adarkslategray
Secondary foreground
#d7dcdfgainsboro
#d7dcdfgainsboro
Muted
#e7eff3lavender
#0c1318black
Muted foreground
#4f595fdimgray
#a0aab0darkgray
Accent
#403b4adarkslategray
#403b4adarkslategray
Accent foreground
#dad7dfgainsboro
#dad7dfgainsboro
Destructive
#94130adarkred
#e51e10red
Destructive foreground
#fcd7d4mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#3b3d4adarkslategray
#3b3d4adarkslategray

Contrast

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

Light mode
Text on background19.81:1AAA
Text on card19.81:1AAA
Primary button7.57:1AAA
Secondary button7.17:1AAA
Muted text6.15:1AA
Accent7.59:1AAA
Destructive6.70:1AA
Dark mode
Text on background19.57:1AAA
Text on card19.57:1AAA
Primary button7.57:1AAA
Secondary button7.17:1AAA
Muted text7.89:1AAA
Accent7.59:1AAA
Destructive4.64:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.006 279.252);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.947 0.01 232.723);
  --muted-foreground: oklch(0.457 0.016 233.095);
  --popover: oklch(0.98 0.006 279.252);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.98 0.006 279.252);
  --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.363 0.022 278.358);
  --primary-foreground: oklch(0.885 0.009 279.181);
  --secondary: oklch(0.381 0.015 233.193);
  --secondary-foreground: oklch(0.893 0.007 232.685);
  --accent: oklch(0.364 0.026 301.846);
  --accent-foreground: oklch(0.885 0.011 302.738);
  --destructive: oklch(0.427 0.163 29.668);
  --destructive-foreground: oklch(0.909 0.042 22.786);
  --ring: oklch(0.363 0.022 278.358);
  --chart-1: oklch(0.363 0.022 278.358);
  --chart-2: oklch(0.381 0.015 233.193);
  --chart-3: oklch(0.364 0.026 301.846);
  --chart-4: oklch(0.41 0.017 233.206);
  --chart-5: oklch(0.359 0.028 278.039);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.017 273.494);
  --foreground: oklch(0.983 0.003 279.299);
  --muted: oklch(0.183 0.014 233.924);
  --muted-foreground: oklch(0.733 0.014 232.855);
  --popover: oklch(0.101 0.017 273.494);
  --popover-foreground: oklch(0.983 0.003 279.299);
  --card: oklch(0.101 0.017 273.494);
  --card-foreground: oklch(0.983 0.003 279.299);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.363 0.022 278.358);
  --primary-foreground: oklch(0.885 0.009 279.181);
  --secondary: oklch(0.381 0.015 233.193);
  --secondary-foreground: oklch(0.893 0.007 232.685);
  --accent: oklch(0.364 0.026 301.846);
  --accent-foreground: oklch(0.885 0.011 302.738);
  --destructive: oklch(0.588 0.229 29.742);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.363 0.022 278.358);
  --chart-1: oklch(0.363 0.022 278.358);
  --chart-2: oklch(0.381 0.015 233.193);
  --chart-3: oklch(0.364 0.026 301.846);
  --chart-4: oklch(0.41 0.017 233.206);
  --chart-5: oklch(0.359 0.028 278.039);
}