Spacing for shadcn/ui

Spacing is a shadcn/ui theme built around a purple primary color (#b84ca2) with cyan accents (#4ca2b8). The light mode uses a neutral background (#ffffff). Dark mode keeps the purple primary (#b84ca2) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#ffffffwhite
#070307black
Foreground
#160412black
#f9f6f8whitesmoke
Card
#fcfcfcsnow
#0b040ablack
Card foreground
#11030eblack
#fbf9fbsnow
Popover
#ffffffwhite
#070307black
Popover foreground
#160412black
#f9f6f8whitesmoke
Primary
#b84ca2mediumorchid
#b84ca2mediumorchid
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a2b84cyellowgreen
#a2b84cyellowgreen
Secondary foreground
#232810black
#232810black
Muted
#e2e3degainsboro
#20211cblack
Muted foreground
#565b43darkolivegreen
#b7bca4darkgray
Accent
#4ca2b8cadetblue
#4ca2b8cadetblue
Accent foreground
#000000black
#000000black
Destructive
#a71701darkred
#e41f01red
Destructive foreground
#ffe0dbmistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b84ca2mediumorchid
#b84ca2mediumorchid

Contrast

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

Light mode
Text on background19.80:1AAA
Text on card19.69:1AAA
Primary button4.56:1AA
Secondary button6.86:1AA
Muted text5.46:1AA
Accent7.18:1AAA
Destructive6.10:1AA
Dark mode
Text on background19.09:1AAA
Text on card19.33:1AAA
Primary button4.56:1AA
Secondary button6.86:1AA
Muted text8.28:1AAA
Accent7.18:1AAA
Destructive4.65:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.149 0.044 335.231);
  --muted: oklch(0.913 0.007 115.712);
  --muted-foreground: oklch(0.46 0.037 117.077);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.149 0.044 335.231);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.136 0.039 334.598);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.587 0.172 336.034);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.743 0.135 119.318);
  --secondary-foreground: oklch(0.266 0.041 118.595);
  --accent: oklch(0.669 0.088 216.564);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.467 0.18 31.359);
  --destructive-foreground: oklch(0.931 0.035 28.166);
  --ring: oklch(0.587 0.172 336.034);
  --chart-1: oklch(0.587 0.172 336.034);
  --chart-2: oklch(0.743 0.135 119.318);
  --chart-3: oklch(0.669 0.088 216.564);
  --chart-4: oklch(0.759 0.129 118.985);
  --chart-5: oklch(0.589 0.181 336.278);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.109 0.019 332.75);
  --foreground: oklch(0.975 0.005 332.082);
  --muted: oklch(0.245 0.009 116.264);
  --muted-foreground: oklch(0.784 0.033 116.353);
  --popover: oklch(0.109 0.019 332.75);
  --popover-foreground: oklch(0.975 0.005 332.082);
  --card: oklch(0.125 0.022 332.888);
  --card-foreground: oklch(0.984 0.003 332.056);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.587 0.172 336.034);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.743 0.135 119.318);
  --secondary-foreground: oklch(0.266 0.041 118.595);
  --accent: oklch(0.669 0.088 216.564);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.587 0.228 30.976);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.587 0.172 336.034);
  --chart-1: oklch(0.587 0.172 336.034);
  --chart-2: oklch(0.743 0.135 119.318);
  --chart-3: oklch(0.669 0.088 216.564);
  --chart-4: oklch(0.759 0.129 118.985);
  --chart-5: oklch(0.589 0.181 336.278);
}