Fairness for shadcn/ui

Fairness is a shadcn/ui theme built around a muted deep violet primary color (#3d2d49) with muted deep purple accents (#492d46). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the muted deep violet primary (#3d2d49) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fdfbfewhite
#000000black
Foreground
#060208black
#fdfbfdsnow
Card
#faf7fcghostwhite
#030303black
Card foreground
#030104black
#ffffffwhite
Popover
#fdfbfewhite
#000000black
Popover foreground
#060208black
#fdfbfdsnow
Primary
#3d2d49darkslategray
#3d2d49darkslategray
Primary foreground
#d5c9dethistle
#d5c9dethistle
Secondary
#2f2d49darkslategray
#2f2d49darkslategray
Secondary foreground
#cbc9delightgrey
#cbc9delightgrey
Muted
#e7e6f4lavender
#0c0b19black
Muted foreground
#616066dimgray
#99999fdarkgray
Accent
#492d46darkslategray
#492d46darkslategray
Accent foreground
#dec9dcthistle
#dec9dcthistle
Destructive
#ab3803saddlebrown
#fc6e2ctomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#3d2d49darkslategray
#3d2d49darkslategray

Contrast

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

Light mode
Text on background20.01:1AAA
Text on card19.65:1AAA
Primary button7.96:1AAA
Secondary button8.17:1AAA
Muted text5.05:1AA
Accent7.75:1AAA
Destructive6.38:1AA
Dark mode
Text on background20.39:1AAA
Text on card20.67:1AAA
Primary button7.96:1AAA
Secondary button8.17:1AAA
Muted text6.88:1AA
Accent7.75:1AAA
Destructive7.38:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.004 311.695);
  --foreground: oklch(0.101 0.027 313.899);
  --muted: oklch(0.93 0.019 289.865);
  --muted-foreground: oklch(0.493 0.009 289.885);
  --popover: oklch(0.991 0.004 311.695);
  --popover-foreground: oklch(0.101 0.027 313.899);
  --card: oklch(0.981 0.007 311.666);
  --card-foreground: oklch(0.08 0.021 313.899);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.327 0.053 310.384);
  --primary-foreground: oklch(0.853 0.031 311.429);
  --secondary: oklch(0.311 0.05 286.935);
  --secondary-foreground: oklch(0.844 0.029 289.597);
  --accent: oklch(0.34 0.058 329.708);
  --accent-foreground: oklch(0.86 0.034 328.475);
  --destructive: oklch(0.503 0.159 39.13);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.327 0.053 310.384);
  --chart-1: oklch(0.327 0.053 310.384);
  --chart-2: oklch(0.311 0.05 286.935);
  --chart-3: oklch(0.34 0.058 329.708);
  --chart-4: oklch(0.337 0.055 286.84);
  --chart-5: oklch(0.324 0.059 310.191);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.991 0.003 311.701);
  --muted: oklch(0.159 0.029 286.388);
  --muted-foreground: oklch(0.684 0.009 290.008);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.991 0.003 311.701);
  --card: oklch(0.092 0 180);
  --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.327 0.053 310.384);
  --primary-foreground: oklch(0.853 0.031 311.429);
  --secondary: oklch(0.311 0.05 286.935);
  --secondary-foreground: oklch(0.844 0.029 289.597);
  --accent: oklch(0.34 0.058 329.708);
  --accent-foreground: oklch(0.86 0.034 328.475);
  --destructive: oklch(0.703 0.189 42.304);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.327 0.053 310.384);
  --chart-1: oklch(0.327 0.053 310.384);
  --chart-2: oklch(0.311 0.05 286.935);
  --chart-3: oklch(0.34 0.058 329.708);
  --chart-4: oklch(0.337 0.055 286.84);
  --chart-5: oklch(0.324 0.059 310.191);
}