Mad for shadcn/ui

Mad is a shadcn/ui theme built around a violet primary color (#582989) with muted light violet accents (#ccc5d3). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#582989) on a neutral background (#050307).

Color palette

TokenLightDark
Background
#fcfbfewhite
#050307black
Foreground
#000000black
#ffffffwhite
Card
#fcfbfewhite
#050307black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfbfewhite
#050307black
Popover foreground
#000000black
#ffffffwhite
Primary
#582989rebeccapurple
#582989rebeccapurple
Primary foreground
#f2ebf9whitesmoke
#f2ebf9whitesmoke
Secondary
#ccc5d3thistle
#333234darkslategray
Secondary foreground
#332c3adarkslategray
#cccbcdlightgrey
Muted
#d8d0e2gainsboro
#261d2fdarkslategray
Muted foreground
#544d5bdimgray
#aba4b2darkgray
Accent
#ccc5d3thistle
#333234darkslategray
Accent foreground
#332c3adarkslategray
#cccbcdlightgrey
Destructive
#ce3e12firebrick
#e64514orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#582989rebeccapurple
#582989rebeccapurple

Contrast

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

Light mode
Text on background20.38:1AAA
Text on card20.38:1AAA
Primary button8.61:1AAA
Secondary button8.01:1AAA
Muted text5.42:1AA
Accent8.01:1AAA
Destructive4.84:1AA
Dark mode
Text on background20.52:1AAA
Text on card20.52:1AAA
Primary button8.61:1AAA
Secondary button7.85:1AAA
Muted text6.66:1AA
Accent7.85:1AAA
Destructive4.02:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.004 307.742);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.87 0.026 307.446);
  --muted-foreground: oklch(0.433 0.023 307.162);
  --popover: oklch(0.99 0.004 307.742);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.99 0.004 307.742);
  --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.398 0.153 301.963);
  --primary-foreground: oklch(0.95 0.02 307.548);
  --secondary: oklch(0.834 0.02 307.516);
  --secondary-foreground: oklch(0.307 0.025 306.839);
  --accent: oklch(0.834 0.02 307.516);
  --accent-foreground: oklch(0.307 0.025 306.839);
  --destructive: oklch(0.571 0.188 35.639);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.398 0.153 301.963);
  --chart-1: oklch(0.398 0.153 301.963);
  --chart-2: oklch(0.834 0.02 307.516);
  --chart-3: oklch(0.834 0.02 307.516);
  --chart-4: oklch(0.859 0.016 307.565);
  --chart-5: oklch(0.396 0.159 301.492);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.106 0.015 308.77);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.251 0.035 306.154);
  --muted-foreground: oklch(0.729 0.02 307.461);
  --popover: oklch(0.106 0.015 308.77);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.106 0.015 308.77);
  --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.398 0.153 301.963);
  --primary-foreground: oklch(0.95 0.02 307.548);
  --secondary: oklch(0.32 0.002 307.719);
  --secondary-foreground: oklch(0.844 0.001 307.768);
  --accent: oklch(0.32 0.002 307.719);
  --accent-foreground: oklch(0.844 0.001 307.768);
  --destructive: oklch(0.618 0.205 35.54);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.398 0.153 301.963);
  --chart-1: oklch(0.398 0.153 301.963);
  --chart-2: oklch(0.32 0.002 307.719);
  --chart-3: oklch(0.32 0.002 307.719);
  --chart-4: oklch(0.35 0.002 307.717);
  --chart-5: oklch(0.396 0.159 301.492);
}