Key for shadcn/ui

Key is a shadcn/ui theme built around a neutral gray primary color (#a0a0a7) with neutral gray accents (#a3a0a7). The light mode uses a neutral background (#fbfbfd). Dark mode keeps the neutral gray primary (#a0a0a7) on a neutral background (#020208).

Color palette

TokenLightDark
Background
#fbfbfdghostwhite
#020208black
Foreground
#000000black
#f9f9faghostwhite
Card
#f8f8fcghostwhite
#04040cblack
Card foreground
#000000black
#fcfcfdwhite
Popover
#f8f8fcghostwhite
#04040cblack
Popover foreground
#000000black
#fcfcfdwhite
Primary
#a0a0a7darkgray
#a0a0a7darkgray
Primary foreground
#0a0a0bblack
#0a0a0bblack
Secondary
#a0a3a7darkgray
#a0a3a7darkgray
Secondary foreground
#0a0a0bblack
#0a0a0bblack
Muted
#d3dde8gainsboro
#17212cblack
Muted foreground
#5f6367dimgray
#989ba0darkgray
Accent
#a3a0a7darkgray
#a3a0a7darkgray
Accent foreground
#0a0a0bblack
#0a0a0bblack
Destructive
#d90808red
#f83a3atomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#a0a0a7darkgray
#a0a0a7darkgray

Contrast

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

Light mode
Text on background20.39:1AAA
Text on card19.79:1AAA
Primary button7.57:1AAA
Secondary button7.80:1AAA
Muted text4.42:1AA Large
Accent7.64:1AAA
Destructive5.28:1AA
Dark mode
Text on background19.62:1AAA
Text on card19.97:1AAA
Primary button7.57:1AAA
Secondary button7.80:1AAA
Muted text5.85:1AA
Accent7.64:1AAA
Destructive3.71:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 287.119);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.895 0.019 249.841);
  --muted-foreground: oklch(0.499 0.008 249.8);
  --popover: oklch(0.98 0.006 287.066);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.98 0.006 287.066);
  --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.707 0.011 286.893);
  --primary-foreground: oklch(0.144 0.002 286.958);
  --secondary: oklch(0.714 0.007 249.74);
  --secondary-foreground: oklch(0.145 0.001 249.565);
  --accent: oklch(0.71 0.011 308.958);
  --accent-foreground: oklch(0.145 0.002 309.036);
  --destructive: oklch(0.557 0.226 28.955);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.707 0.011 286.893);
  --chart-1: oklch(0.707 0.011 286.893);
  --chart-2: oklch(0.714 0.007 249.74);
  --chart-3: oklch(0.71 0.011 308.958);
  --chart-4: oklch(0.739 0.006 249.729);
  --chart-5: oklch(0.7 0.019 286.675);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.096 0.02 282.959);
  --foreground: oklch(0.984 0.001 287.145);
  --muted: oklch(0.242 0.026 250.579);
  --muted-foreground: oklch(0.689 0.007 249.751);
  --popover: oklch(0.11 0.024 282.914);
  --popover-foreground: oklch(0.992 0.001 287.157);
  --card: oklch(0.11 0.024 282.914);
  --card-foreground: oklch(0.992 0.001 287.157);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.707 0.011 286.893);
  --primary-foreground: oklch(0.144 0.002 286.958);
  --secondary: oklch(0.714 0.007 249.74);
  --secondary-foreground: oklch(0.145 0.001 249.565);
  --accent: oklch(0.71 0.011 308.958);
  --accent-foreground: oklch(0.145 0.002 309.036);
  --destructive: oklch(0.642 0.225 26.319);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.707 0.011 286.893);
  --chart-1: oklch(0.707 0.011 286.893);
  --chart-2: oklch(0.714 0.007 249.74);
  --chart-3: oklch(0.71 0.011 308.958);
  --chart-4: oklch(0.739 0.006 249.729);
  --chart-5: oklch(0.7 0.019 286.675);
}