Mortality for shadcn/ui

Mortality is a shadcn/ui theme built around a vivid deep violet primary color (#340688) with muted light violet accents (#d4d0dc). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep violet primary (#340688) on a violet-tinted background (#090510).

Color palette

TokenLightDark
Background
#ffffffwhite
#090510black
Foreground
#020104black
#fcfcfdwhite
Card
#ffffffwhite
#090510black
Card foreground
#020104black
#fcfcfdwhite
Popover
#ffffffwhite
#090510black
Popover foreground
#020104black
#fcfcfdwhite
Primary
#340688indigo
#340688indigo
Primary foreground
#d8c5fclavender
#d8c5fclavender
Secondary
#e5e3e8gainsboro
#312c3adarkslategray
Secondary foreground
#4a4653darkslategray
#cac5d3thistle
Muted
#e5e3e8gainsboro
#19171cblack
Muted foreground
#544f5fdimgray
#a6a0b0darkgray
Accent
#d4d0dclightgrey
#403654darkslategray
Accent foreground
#3b3546darkslategray
#dcd7e5gainsboro
Destructive
#7a2d00saddlebrown
#e65400orangered
Destructive foreground
#ffcbadnavajowhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#340688indigo
#340688indigo

Contrast

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

Light mode
Text on background20.81:1AAA
Text on card20.81:1AAA
Primary button8.69:1AAA
Secondary button7.19:1AAA
Muted text6.21:1AA
Accent7.80:1AAA
Destructive6.52:1AA
Dark mode
Text on background19.71:1AAA
Text on card19.71:1AAA
Primary button8.69:1AAA
Secondary button7.98:1AAA
Muted text6.99:1AA
Accent7.96:1AAA
Destructive3.73:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.075 0.022 303.174);
  --muted: oklch(0.92 0.006 302.116);
  --muted-foreground: oklch(0.438 0.026 301.274);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.075 0.022 303.174);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.075 0.022 303.174);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.322 0.181 285.563);
  --primary-foreground: oklch(0.857 0.079 300.754);
  --secondary: oklch(0.919 0.006 302.104);
  --secondary-foreground: oklch(0.403 0.024 301.292);
  --accent: oklch(0.866 0.016 301.921);
  --accent-foreground: oklch(0.341 0.031 300.794);
  --destructive: oklch(0.404 0.119 43.533);
  --destructive-foreground: oklch(0.881 0.071 51.55);
  --ring: oklch(0.322 0.181 285.563);
  --chart-1: oklch(0.322 0.181 285.563);
  --chart-2: oklch(0.919 0.006 302.104);
  --chart-3: oklch(0.866 0.016 301.921);
  --chart-4: oklch(0.943 0.004 302.139);
  --chart-5: oklch(0.322 0.184 284.81);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.027 301.424);
  --foreground: oklch(0.992 0.001 302.2);
  --muted: oklch(0.21 0.008 301.599);
  --muted-foreground: oklch(0.717 0.023 301.707);
  --popover: oklch(0.127 0.027 301.424);
  --popover-foreground: oklch(0.992 0.001 302.2);
  --card: oklch(0.127 0.027 301.424);
  --card-foreground: oklch(0.992 0.001 302.2);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.322 0.181 285.563);
  --primary-foreground: oklch(0.857 0.079 300.754);
  --secondary: oklch(0.305 0.024 300.954);
  --secondary-foreground: oklch(0.832 0.019 301.857);
  --accent: oklch(0.356 0.053 299.802);
  --accent-foreground: oklch(0.886 0.021 301.851);
  --destructive: oklch(0.634 0.194 41.259);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.322 0.181 285.563);
  --chart-1: oklch(0.322 0.181 285.563);
  --chart-2: oklch(0.305 0.024 300.954);
  --chart-3: oklch(0.356 0.053 299.802);
  --chart-4: oklch(0.333 0.027 300.915);
  --chart-5: oklch(0.322 0.184 284.81);
}