Displacement for shadcn/ui

Displacement is a shadcn/ui theme built around a near-white primary color (#f0f0ef) with muted green accents (#c0c6b3). The light mode uses a neutral background (#fdfefb). Dark mode keeps the near-white primary (#f0f0ef) on a neutral background (#060803).

Color palette

TokenLightDark
Background
#fdfefbwhite
#060803black
Foreground
#000000black
#f8f9f5whitesmoke
Card
#fdfefbwhite
#060803black
Card foreground
#000000black
#f8f9f5whitesmoke
Popover
#fdfefbwhite
#060803black
Popover foreground
#000000black
#f8f9f5whitesmoke
Primary
#f0f0efwhitesmoke
#f0f0efwhitesmoke
Primary foreground
#585b52dimgray
#585b52dimgray
Secondary
#d0d2cblightgrey
#2c2e28darkslategray
Secondary foreground
#373932darkslategray
#c6c8c0silver
Muted
#dfe1dbgainsboro
#22241eblack
Muted foreground
#60694fdimgray
#a7b096darkgray
Accent
#c0c6b3silver
#404635darkslategray
Accent foreground
#25291fdarkslategray
#d8dcd0lightgrey
Destructive
#622304maroon
#f76f2btomato
Destructive foreground
#fbbc9dburlywood
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#f0f0efwhitesmoke
#f0f0efwhitesmoke

Contrast

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

Light mode
Text on background20.70:1AAA
Text on card20.70:1AAA
Primary button6.08:1AA
Secondary button7.66:1AAA
Muted text4.38:1AA Large
Accent8.45:1AAA
Destructive7.22:1AAA
Dark mode
Text on background19.05:1AAA
Text on card19.05:1AAA
Primary button6.08:1AA
Secondary button8.08:1AAA
Muted text6.92:1AA
Accent7.04:1AAA
Destructive7.29:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.003 121.547);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.906 0.008 121.64);
  --muted-foreground: oklch(0.505 0.041 122.823);
  --popover: oklch(0.995 0.003 121.547);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.995 0.003 121.547);
  --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.956 0.002 121.528);
  --primary-foreground: oklch(0.466 0.014 121.985);
  --secondary: oklch(0.86 0.01 121.672);
  --secondary-foreground: oklch(0.341 0.013 122.122);
  --accent: oklch(0.816 0.026 122.016);
  --accent-foreground: oklch(0.273 0.018 122.606);
  --destructive: oklch(0.348 0.1 42.541);
  --destructive-foreground: oklch(0.846 0.085 47.692);
  --ring: oklch(0.956 0.002 121.528);
  --chart-1: oklch(0.956 0.002 121.528);
  --chart-2: oklch(0.86 0.01 121.672);
  --chart-3: oklch(0.816 0.026 122.016);
  --chart-4: oklch(0.882 0.008 121.639);
  --chart-5: oklch(0.957 0.003 121.549);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.017 121.189);
  --foreground: oklch(0.981 0.005 121.582);
  --muted: oklch(0.257 0.011 122.207);
  --muted-foreground: oklch(0.743 0.037 122.308);
  --popover: oklch(0.127 0.017 121.189);
  --popover-foreground: oklch(0.981 0.005 121.582);
  --card: oklch(0.127 0.017 121.189);
  --card-foreground: oklch(0.981 0.005 121.582);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.956 0.002 121.528);
  --primary-foreground: oklch(0.466 0.014 121.985);
  --secondary: oklch(0.299 0.011 122.094);
  --secondary-foreground: oklch(0.83 0.012 121.719);
  --accent: oklch(0.383 0.029 122.745);
  --accent-foreground: oklch(0.888 0.016 121.782);
  --destructive: oklch(0.698 0.184 43.625);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.956 0.002 121.528);
  --chart-1: oklch(0.956 0.002 121.528);
  --chart-2: oklch(0.299 0.011 122.094);
  --chart-3: oklch(0.383 0.029 122.745);
  --chart-4: oklch(0.33 0.013 122.116);
  --chart-5: oklch(0.957 0.003 121.549);
}