Alert for shadcn/ui

Alert is a shadcn/ui theme built around a vivid indigo primary color (#15209e) with muted light indigo accents (#cbccd8). The light mode uses a neutral background (#fbfbfe). Dark mode keeps the vivid indigo primary (#15209e) on an indigo-tinted background (#07070e).

Color palette

TokenLightDark
Background
#fbfbfeghostwhite
#07070eblack
Foreground
#010104black
#f8f9fbghostwhite
Card
#f6f7fdghostwhite
#090911black
Card foreground
#000000black
#fcfcfdwhite
Popover
#fbfbfeghostwhite
#07070eblack
Popover foreground
#010104black
#f8f9fbghostwhite
Primary
#15209edarkblue
#15209edarkblue
Primary foreground
#e8eafclavender
#e8eafclavender
Secondary
#cbccd8lightgrey
#323234darkslategray
Secondary foreground
#303240darkslategray
#cbcbcdlightgrey
Muted
#f1f1f3whitesmoke
#0c0c0eblack
Muted foreground
#46474edarkslategray
#b1b2b9darkgray
Accent
#cbccd8lightgrey
#323234darkslategray
Accent foreground
#303240darkslategray
#cbcbcdlightgrey
Destructive
#d53b10orangered
#ee491borangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#15209edarkblue
#15209edarkblue

Contrast

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

Light mode
Text on background20.16:1AAA
Text on card19.65:1AAA
Primary button10.17:1AAA
Secondary button7.92:1AAA
Muted text8.21:1AAA
Accent7.92:1AAA
Destructive4.69:1AA
Dark mode
Text on background19.03:1AAA
Text on card19.33:1AAA
Primary button10.17:1AAA
Secondary button7.88:1AAA
Muted text9.26:1AAA
Accent7.88:1AAA
Destructive3.75: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.989 0.004 282.139);
  --foreground: oklch(0.071 0.021 272.383);
  --muted: oklch(0.959 0.003 282.164);
  --muted-foreground: oklch(0.399 0.011 281.728);
  --popover: oklch(0.989 0.004 282.139);
  --popover-foreground: oklch(0.071 0.021 272.383);
  --card: oklch(0.977 0.009 282.064);
  --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.35 0.196 267.625);
  --primary-foreground: oklch(0.941 0.024 281.774);
  --secondary: oklch(0.847 0.016 281.888);
  --secondary-foreground: oklch(0.32 0.026 280.771);
  --accent: oklch(0.847 0.016 281.888);
  --accent-foreground: oklch(0.32 0.026 280.771);
  --destructive: oklch(0.58 0.197 34.62);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.35 0.196 267.625);
  --chart-1: oklch(0.35 0.196 267.625);
  --chart-2: oklch(0.847 0.016 281.888);
  --chart-3: oklch(0.847 0.016 281.888);
  --chart-4: oklch(0.873 0.013 281.953);
  --chart-5: oklch(0.35 0.202 267.056);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.134 0.014 279.539);
  --foreground: oklch(0.982 0.004 282.151);
  --muted: oklch(0.154 0.004 281.718);
  --muted-foreground: oklch(0.765 0.01 282.002);
  --popover: oklch(0.134 0.014 279.539);
  --popover-foreground: oklch(0.982 0.004 282.151);
  --card: oklch(0.144 0.017 279.759);
  --card-foreground: oklch(0.991 0.002 282.182);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.35 0.196 267.625);
  --primary-foreground: oklch(0.941 0.024 281.774);
  --secondary: oklch(0.318 0.003 282.039);
  --secondary-foreground: oklch(0.843 0.003 282.161);
  --accent: oklch(0.318 0.003 282.039);
  --accent-foreground: oklch(0.843 0.003 282.161);
  --destructive: oklch(0.636 0.208 35.104);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.35 0.196 267.625);
  --chart-1: oklch(0.35 0.196 267.625);
  --chart-2: oklch(0.318 0.003 282.039);
  --chart-3: oklch(0.318 0.003 282.039);
  --chart-4: oklch(0.348 0.004 282.034);
  --chart-5: oklch(0.35 0.202 267.056);
}