Polarisation for shadcn/ui

Polarisation is a shadcn/ui theme built around a muted deep violet primary color (#100d12) with muted deep teal accents (#0d1210). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep violet primary (#100d12) on a neutral background (#050307).

Color palette

TokenLightDark
Background
#ffffffwhite
#050307black
Foreground
#08040cblack
#faf8fcghostwhite
Card
#fcfcfcsnow
#08050bblack
Card foreground
#060208black
#fdfcfdwhite
Popover
#fcfcfcsnow
#08050bblack
Popover foreground
#060208black
#fdfcfdwhite
Primary
#100d12black
#100d12black
Primary foreground
#ab9ab6darkgray
#ab9ab6darkgray
Secondary
#12100dblack
#12100dblack
Secondary foreground
#b6ab9adarkgray
#b6ab9adarkgray
Muted
#e8dccagainsboro
#352917darkslategray
Muted foreground
#59554fdimgray
#b0aca6darkgray
Accent
#0d1210black
#0d1210black
Accent foreground
#9ab6abdarkgray
#9ab6abdarkgray
Destructive
#c84a14chocolate
#e35416chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#100d12black
#100d12black

Contrast

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

Light mode
Text on background20.32:1AAA
Text on card20.14:1AAA
Primary button7.38:1AAA
Secondary button8.40:1AAA
Muted text5.45:1AA
Accent8.70:1AAA
Destructive4.74:1AA
Dark mode
Text on background19.43:1AAA
Text on card19.80:1AAA
Primary button7.38:1AAA
Secondary button8.40:1AAA
Muted text6.25:1AA
Accent8.70:1AAA
Destructive3.77:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.12 0.024 313.846);
  --muted: oklch(0.898 0.027 78.181);
  --muted-foreground: oklch(0.452 0.011 78.215);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.104 0.021 314.053);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.104 0.021 314.053);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.164 0.011 311.856);
  --primary-foreground: oklch(0.711 0.044 311.902);
  --secondary: oklch(0.173 0.007 78.125);
  --secondary-foreground: oklch(0.746 0.027 78.148);
  --accent: oklch(0.175 0.009 169.123);
  --accent-foreground: oklch(0.753 0.034 169.256);
  --destructive: oklch(0.573 0.171 39.787);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.164 0.011 311.856);
  --chart-1: oklch(0.164 0.011 311.856);
  --chart-2: oklch(0.173 0.007 78.125);
  --chart-3: oklch(0.175 0.009 169.123);
  --chart-4: oklch(0.209 0.01 78.071);
  --chart-5: oklch(0.163 0.013 311.757);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.108 0.015 313.548);
  --foreground: oklch(0.982 0.005 312.32);
  --muted: oklch(0.291 0.034 76.88);
  --muted-foreground: oklch(0.746 0.01 78.267);
  --popover: oklch(0.123 0.017 313.525);
  --popover-foreground: oklch(0.991 0.003 312.339);
  --card: oklch(0.123 0.017 313.525);
  --card-foreground: oklch(0.991 0.003 312.339);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.164 0.011 311.856);
  --primary-foreground: oklch(0.711 0.044 311.902);
  --secondary: oklch(0.173 0.007 78.125);
  --secondary-foreground: oklch(0.746 0.027 78.148);
  --accent: oklch(0.175 0.009 169.123);
  --accent-foreground: oklch(0.753 0.034 169.256);
  --destructive: oklch(0.631 0.19 39.62);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.164 0.011 311.856);
  --chart-1: oklch(0.164 0.011 311.856);
  --chart-2: oklch(0.173 0.007 78.125);
  --chart-3: oklch(0.175 0.009 169.123);
  --chart-4: oklch(0.209 0.01 78.071);
  --chart-5: oklch(0.163 0.013 311.757);
}