Contingency for shadcn/ui

Contingency is a shadcn/ui theme built around a deep purple primary color (#170c15) with deep cyan accents (#0c1517). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the deep purple primary (#170c15) on a purple-tinted background (#0e060d).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#0e060dblack
Foreground
#0d030bblack
#ffffffwhite
Card
#fdfcfdwhite
#0e060dblack
Card foreground
#0d030bblack
#ffffffwhite
Popover
#fdfcfdwhite
#0e060dblack
Popover foreground
#0d030bblack
#ffffffwhite
Primary
#170c15black
#170c15black
Primary foreground
#c492bcdarkgray
#c492bcdarkgray
Secondary
#15170cblack
#15170cblack
Secondary foreground
#909c54gray
#909c54gray
Muted
#f1f2eewhitesmoke
#11110dblack
Muted foreground
#5e6052dimgray
#abad9fdarkgray
Accent
#0c1517black
#0c1517black
Accent foreground
#92bcc4darkgray
#92bcc4darkgray
Destructive
#df1207red
#df1207red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#170c15black
#170c15black

Contrast

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

Light mode
Text on background19.79:1AAA
Text on card19.79:1AAA
Primary button7.42:1AAA
Secondary button6.08:1AA
Muted text5.69:1AA
Accent8.96:1AAA
Destructive4.98:1AA
Dark mode
Text on background19.96:1AAA
Text on card19.96:1AAA
Primary button7.42:1AAA
Secondary button6.08:1AA
Muted text8.28:1AAA
Accent8.96:1AAA
Destructive4.98:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.992 0.002 330.853);
  --foreground: oklch(0.122 0.031 332.431);
  --muted: oklch(0.959 0.005 114.169);
  --muted-foreground: oklch(0.484 0.022 114.924);
  --popover: oklch(0.992 0.002 330.853);
  --popover-foreground: oklch(0.122 0.031 332.431);
  --card: oklch(0.992 0.002 330.853);
  --card-foreground: oklch(0.122 0.031 332.431);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.176 0.025 332.617);
  --primary-foreground: oklch(0.72 0.083 332.294);
  --secondary: oklch(0.2 0.02 115.974);
  --secondary-foreground: oklch(0.666 0.097 116.887);
  --accent: oklch(0.19 0.014 211.328);
  --accent-foreground: oklch(0.767 0.046 211.216);
  --destructive: oklch(0.571 0.228 29.527);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.176 0.025 332.617);
  --chart-1: oklch(0.176 0.025 332.617);
  --chart-2: oklch(0.2 0.02 115.974);
  --chart-3: oklch(0.19 0.014 211.328);
  --chart-4: oklch(0.241 0.027 116.219);
  --chart-5: oklch(0.176 0.027 332.787);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.14 0.021 332.303);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.177 0.008 114.908);
  --muted-foreground: oklch(0.741 0.02 114.573);
  --popover: oklch(0.14 0.021 332.303);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.14 0.021 332.303);
  --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.176 0.025 332.617);
  --primary-foreground: oklch(0.72 0.083 332.294);
  --secondary: oklch(0.2 0.02 115.974);
  --secondary-foreground: oklch(0.666 0.097 116.887);
  --accent: oklch(0.19 0.014 211.328);
  --accent-foreground: oklch(0.767 0.046 211.216);
  --destructive: oklch(0.571 0.228 29.527);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.176 0.025 332.617);
  --chart-1: oklch(0.176 0.025 332.617);
  --chart-2: oklch(0.2 0.02 115.974);
  --chart-3: oklch(0.19 0.014 211.328);
  --chart-4: oklch(0.241 0.027 116.219);
  --chart-5: oklch(0.176 0.027 332.787);
}