Stacking for shadcn/ui

Stacking is a shadcn/ui theme built around a near-black primary color (#080708) with neutral gray accents (#ddd9de). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the near-black primary (#080708) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#fdfbfewhite
#070307black
Foreground
#000000black
#f9f5faghostwhite
Card
#fcf7fdghostwhite
#0a040bblack
Card foreground
#000000black
#fbf8fcghostwhite
Popover
#fdfbfewhite
#070307black
Popover foreground
#000000black
#f9f5faghostwhite
Primary
#080708black
#080708black
Primary foreground
#a698a9darkgray
#a698a9darkgray
Secondary
#ddd9degainsboro
#1c1c1cblack
Secondary foreground
#453e47darkslategray
#b5b4b6silver
Muted
#ebdceflavender
#1f1023black
Muted foreground
#433a45darkslategray
#c3bac5silver
Accent
#ddd9degainsboro
#1c1c1cblack
Accent foreground
#453e47darkslategray
#b5b4b6silver
Destructive
#682b08saddlebrown
#ee6517chocolate
Destructive foreground
#f9c7aanavajowhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#080708black
#080708black

Contrast

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

Light mode
Text on background20.40:1AAA
Text on card19.82:1AAA
Primary button7.35:1AAA
Secondary button7.39:1AAA
Muted text8.29:1AAA
Accent7.39:1AAA
Destructive7.08:1AAA
Dark mode
Text on background19.02:1AAA
Text on card19.25:1AAA
Primary button7.35:1AAA
Secondary button8.26:1AAA
Muted text9.63:1AAA
Accent8.26:1AAA
Destructive6.50:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 319.446);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.912 0.031 319.454);
  --muted-foreground: oklch(0.362 0.023 319.461);
  --popover: oklch(0.991 0.005 319.446);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.981 0.01 319.447);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.131 0.004 319.732);
  --primary-foreground: oklch(0.697 0.029 319.456);
  --secondary: oklch(0.889 0.008 319.447);
  --secondary-foreground: oklch(0.374 0.018 319.458);
  --accent: oklch(0.889 0.008 319.447);
  --accent-foreground: oklch(0.374 0.018 319.458);
  --destructive: oklch(0.371 0.098 45.512);
  --destructive-foreground: oklch(0.865 0.069 51.561);
  --ring: oklch(0.131 0.004 319.732);
  --chart-1: oklch(0.131 0.004 319.732);
  --chart-2: oklch(0.889 0.008 319.447);
  --chart-3: oklch(0.889 0.008 319.447);
  --chart-4: oklch(0.913 0.006 319.446);
  --chart-5: oklch(0.13 0.006 319.829);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.108 0.019 320.973);
  --foreground: oklch(0.974 0.008 319.447);
  --muted: oklch(0.204 0.043 319.41);
  --muted-foreground: oklch(0.798 0.019 319.451);
  --popover: oklch(0.108 0.019 320.973);
  --popover-foreground: oklch(0.974 0.008 319.447);
  --card: oklch(0.124 0.022 320.845);
  --card-foreground: oklch(0.983 0.006 319.446);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.131 0.004 319.732);
  --primary-foreground: oklch(0.697 0.029 319.456);
  --secondary: oklch(0.226 0.001 319.446);
  --secondary-foreground: oklch(0.772 0.002 319.445);
  --accent: oklch(0.226 0.001 319.446);
  --accent-foreground: oklch(0.772 0.002 319.445);
  --destructive: oklch(0.669 0.186 44.278);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.131 0.004 319.732);
  --chart-1: oklch(0.131 0.004 319.732);
  --chart-2: oklch(0.226 0.001 319.446);
  --chart-3: oklch(0.226 0.001 319.446);
  --chart-4: oklch(0.258 0.002 319.446);
  --chart-5: oklch(0.13 0.006 319.829);
}