Analogy for shadcn/ui

Analogy is a shadcn/ui theme built around a purple primary color (#c985d5) with muted light purple accents (#d0bbd3). The light mode uses a neutral background (#fcf7fd). Dark mode keeps the purple primary (#c985d5) on a neutral background (#030203).

Color palette

TokenLightDark
Background
#fcf7fdghostwhite
#030203black
Foreground
#0b030cblack
#ffffffwhite
Card
#faf3fcghostwhite
#060407black
Card foreground
#070208black
#ffffffwhite
Popover
#faf3fcghostwhite
#060407black
Popover foreground
#070208black
#ffffffwhite
Primary
#c985d5orchid
#c985d5orchid
Primary foreground
#1b0a1eblack
#1b0a1eblack
Secondary
#e2d9e3gainsboro
#272528darkslategray
Secondary foreground
#4d3a50darkslategray
#c1bdc2silver
Muted
#e7e4e7gainsboro
#1b181bblack
Muted foreground
#554158darkslategray
#bba7besilver
Accent
#d0bbd3thistle
#403342darkslategray
Accent foreground
#352438darkslategray
#d8ced9lightgrey
Destructive
#d90b08red
#f10d09red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c985d5orchid
#c985d5orchid

Contrast

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

Light mode
Text on background19.23:1AAA
Text on card18.91:1AAA
Primary button7.06:1AAA
Secondary button7.46:1AAA
Muted text7.28:1AAA
Accent7.99:1AAA
Destructive5.26:1AA
Dark mode
Text on background20.72:1AAA
Text on card20.46:1AAA
Primary button7.06:1AAA
Secondary button8.21:1AAA
Muted text7.87:1AAA
Accent7.76:1AAA
Destructive4.37:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.009 321.085);
  --foreground: oklch(0.122 0.029 322.661);
  --muted: oklch(0.922 0.005 321.077);
  --muted-foreground: oklch(0.405 0.045 321.29);
  --popover: oklch(0.973 0.013 321.095);
  --popover-foreground: oklch(0.106 0.025 322.959);
  --card: oklch(0.973 0.013 321.095);
  --card-foreground: oklch(0.106 0.025 322.959);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.715 0.134 321.4);
  --primary-foreground: oklch(0.183 0.046 321.443);
  --secondary: oklch(0.894 0.017 321.107);
  --secondary-foreground: oklch(0.377 0.044 321.3);
  --accent: oklch(0.816 0.041 321.173);
  --accent-foreground: oklch(0.289 0.043 321.35);
  --destructive: oklch(0.558 0.225 29.111);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.715 0.134 321.4);
  --chart-1: oklch(0.715 0.134 321.4);
  --chart-2: oklch(0.894 0.017 321.107);
  --chart-3: oklch(0.816 0.041 321.173);
  --chart-4: oklch(0.919 0.013 321.096);
  --chart-5: oklch(0.714 0.142 321.412);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.088 0.01 322.024);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.213 0.007 321.137);
  --muted-foreground: oklch(0.752 0.039 321.176);
  --popover: oklch(0.111 0.013 322.024);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.111 0.013 322.024);
  --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.715 0.134 321.4);
  --primary-foreground: oklch(0.183 0.046 321.443);
  --secondary: oklch(0.267 0.007 321.12);
  --secondary-foreground: oklch(0.802 0.009 321.088);
  --accent: oklch(0.341 0.031 321.255);
  --accent-foreground: oklch(0.862 0.019 321.112);
  --destructive: oklch(0.605 0.244 29.131);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.715 0.134 321.4);
  --chart-1: oklch(0.715 0.134 321.4);
  --chart-2: oklch(0.267 0.007 321.12);
  --chart-3: oklch(0.341 0.031 321.255);
  --chart-4: oklch(0.298 0.008 321.122);
  --chart-5: oklch(0.714 0.142 321.412);
}