Alert for shadcn/ui

Alert is a shadcn/ui theme built around a vivid deep violet primary color (#19063c) with vivid deep green accents (#063c19). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep violet primary (#19063c) on a violet-tinted background (#09060f).

Color palette

TokenLightDark
Background
#ffffffwhite
#09060fblack
Foreground
#0b0514black
#ffffffwhite
Card
#fcfcfcsnow
#0b0712black
Card foreground
#080410black
#ffffffwhite
Popover
#fcfcfcsnow
#0b0712black
Popover foreground
#080410black
#ffffffwhite
Primary
#19063cmidnightblue
#19063cmidnightblue
Primary foreground
#a982f3mediumpurple
#a982f3mediumpurple
Secondary
#3c1906black
#3c1906black
Secondary foreground
#f3a982lightsalmon
#f3a982lightsalmon
Muted
#f6f1efwhitesmoke
#100c09black
Muted foreground
#483d37darkslategray
#c8bdb7silver
Accent
#063c19darkgreen
#063c19darkgreen
Accent foreground
#25e96aspringgreen
#25e96aspringgreen
Destructive
#980601darkred
#f40901red
Destructive foreground
#ffceccpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#19063cmidnightblue
#19063cmidnightblue

Contrast

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

Light mode
Text on background20.07:1AAA
Text on card19.84:1AAA
Primary button6.33:1AA
Secondary button8.09:1AAA
Muted text9.38:1AAA
Accent7.72:1AAA
Destructive6.32:1AA
Dark mode
Text on background20.12:1AAA
Text on card19.90:1AAA
Primary button6.33:1AA
Secondary button8.09:1AAA
Muted text10.59:1AAA
Accent7.72:1AAA
Destructive4.30:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.136 0.034 299.679);
  --muted: oklch(0.962 0.006 50.581);
  --muted-foreground: oklch(0.37 0.018 50.076);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.126 0.03 301.369);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.126 0.03 301.369);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.2 0.095 291.36);
  --primary-foreground: oklch(0.691 0.164 298.14);
  --secondary: oklch(0.262 0.063 46.491);
  --secondary-foreground: oklch(0.797 0.102 49.099);
  --accent: oklch(0.314 0.082 149.756);
  --accent-foreground: oklch(0.819 0.225 148.682);
  --destructive: oklch(0.43 0.173 29.662);
  --destructive-foreground: oklch(0.893 0.055 20.554);
  --ring: oklch(0.2 0.095 291.36);
  --chart-1: oklch(0.2 0.095 291.36);
  --chart-2: oklch(0.262 0.063 46.491);
  --chart-3: oklch(0.314 0.082 149.756);
  --chart-4: oklch(0.298 0.074 45.618);
  --chart-5: oklch(0.199 0.098 290.837);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.131 0.021 301.574);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.158 0.009 50.097);
  --muted-foreground: oklch(0.805 0.015 50.428);
  --popover: oklch(0.142 0.025 300.08);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.142 0.025 300.08);
  --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.2 0.095 291.36);
  --primary-foreground: oklch(0.691 0.164 298.14);
  --secondary: oklch(0.262 0.063 46.491);
  --secondary-foreground: oklch(0.797 0.102 49.099);
  --accent: oklch(0.314 0.082 149.756);
  --accent-foreground: oklch(0.819 0.225 148.682);
  --destructive: oklch(0.608 0.247 29.473);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.2 0.095 291.36);
  --chart-1: oklch(0.2 0.095 291.36);
  --chart-2: oklch(0.262 0.063 46.491);
  --chart-3: oklch(0.314 0.082 149.756);
  --chart-4: oklch(0.298 0.074 45.618);
  --chart-5: oklch(0.199 0.098 290.837);
}