Fairness for shadcn/ui

Fairness is a shadcn/ui theme built around an indigo primary color (#35328f) with green accents (#328f35). The light mode uses a neutral background (#fcfbfd). Dark mode keeps the indigo primary (#35328f) on a neutral background (#030307).

Color palette

TokenLightDark
Background
#fcfbfdsnow
#030307black
Foreground
#03030dblack
#ffffffwhite
Card
#f8f8fcghostwhite
#05050bblack
Card foreground
#020209black
#ffffffwhite
Popover
#fcfbfdsnow
#030307black
Popover foreground
#03030dblack
#ffffffwhite
Primary
#35328fdarkslateblue
#35328fdarkslateblue
Primary foreground
#f8f7fcghostwhite
#f8f7fcghostwhite
Secondary
#8f3532brown
#8f3532brown
Secondary foreground
#fcf8f7snow
#fcf8f7snow
Muted
#e8dedegainsboro
#211717black
Muted foreground
#454040darkslategray
#bfbabasilver
Accent
#328f35forestgreen
#328f35forestgreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#8b1809darkred
#f2432ctomato
Destructive foreground
#fcd0capink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#35328fdarkslateblue
#35328fdarkslateblue

Contrast

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

Light mode
Text on background19.94:1AAA
Text on card19.51:1AAA
Primary button9.77:1AAA
Secondary button7.26:1AAA
Muted text7.73:1AAA
Accent4.08:1AA Large
Destructive6.72:1AA
Dark mode
Text on background20.56:1AAA
Text on card20.35:1AAA
Primary button9.77:1AAA
Secondary button7.26:1AAA
Muted text9.11:1AAA
Accent4.08:1AA Large
Destructive3.74:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 287.891);
  --foreground: oklch(0.103 0.03 282.178);
  --muted: oklch(0.909 0.011 19.781);
  --muted-foreground: oklch(0.376 0.007 19.873);
  --popover: oklch(0.99 0.003 287.891);
  --popover-foreground: oklch(0.103 0.03 282.178);
  --card: oklch(0.98 0.005 287.84);
  --card-foreground: oklch(0.09 0.026 282.311);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.383 0.149 278.201);
  --primary-foreground: oklch(0.979 0.006 287.817);
  --secondary: oklch(0.458 0.123 25.145);
  --secondary-foreground: oklch(0.982 0.005 19.678);
  --accent: oklch(0.576 0.154 143.745);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.413 0.152 31.013);
  --destructive-foreground: oklch(0.894 0.05 26.914);
  --ring: oklch(0.383 0.149 278.201);
  --chart-1: oklch(0.383 0.149 278.201);
  --chart-2: oklch(0.458 0.123 25.145);
  --chart-3: oklch(0.576 0.154 143.745);
  --chart-4: oklch(0.483 0.131 25.209);
  --chart-5: oklch(0.379 0.157 277.285);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.103 0.014 285.634);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.218 0.017 20.808);
  --muted-foreground: oklch(0.794 0.006 19.708);
  --popover: oklch(0.103 0.014 285.634);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.117 0.016 285.63);
  --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.383 0.149 278.201);
  --primary-foreground: oklch(0.979 0.006 287.817);
  --secondary: oklch(0.458 0.123 25.145);
  --secondary-foreground: oklch(0.982 0.005 19.678);
  --accent: oklch(0.576 0.154 143.745);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.638 0.214 30.952);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.383 0.149 278.201);
  --chart-1: oklch(0.383 0.149 278.201);
  --chart-2: oklch(0.458 0.123 25.145);
  --chart-3: oklch(0.576 0.154 143.745);
  --chart-4: oklch(0.483 0.131 25.209);
  --chart-5: oklch(0.379 0.157 277.285);
}