Key for shadcn/ui

Key is a shadcn/ui theme built around a vivid purple primary color (#ce2be3) with muted purple accents (#c9adcd). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the vivid purple primary (#ce2be3) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#fdfbfewhite
#070307black
Foreground
#0f0411black
#ffffffwhite
Card
#fdfbfewhite
#070307black
Card foreground
#0f0411black
#ffffffwhite
Popover
#fdfbfewhite
#070307black
Popover foreground
#0f0411black
#ffffffwhite
Primary
#ce2be3mediumorchid
#ce2be3mediumorchid
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#d5c6d7thistle
#322334darkslategray
Secondary foreground
#3d2c3fdarkslategray
#cdb9d0thistle
Muted
#efe5f1lavender
#190e1ablack
Muted foreground
#604b63dimgray
#b29cb4darkgray
Accent
#c9adcdsilver
#533357darkslategray
Accent foreground
#2a1b2cdarkslategray
#e4d5e6gainsboro
Destructive
#9d1f10firebrick
#eb4e3dtomato
Destructive foreground
#fce6e3mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#ce2be3mediumorchid
#ce2be3mediumorchid

Contrast

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

Light mode
Text on background19.54:1AAA
Text on card19.54:1AAA
Primary button4.13:1AA Large
Secondary button7.91:1AAA
Muted text6.37:1AA
Accent7.98:1AAA
Destructive6.67:1AA
Dark mode
Text on background20.50:1AAA
Text on card20.50:1AAA
Primary button4.13:1AA Large
Secondary button8.04:1AAA
Muted text7.40:1AAA
Accent7.58:1AAA
Destructive3.68: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.991 0.004 322.127);
  --foreground: oklch(0.135 0.037 323.4);
  --muted: oklch(0.933 0.019 322.183);
  --muted-foreground: oklch(0.443 0.047 322.458);
  --popover: oklch(0.991 0.004 322.127);
  --popover-foreground: oklch(0.135 0.037 323.4);
  --card: oklch(0.991 0.004 322.127);
  --card-foreground: oklch(0.135 0.037 323.4);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.625 0.271 322.564);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.844 0.028 322.223);
  --secondary-foreground: oklch(0.321 0.038 322.495);
  --accent: oklch(0.781 0.054 322.342);
  --accent-foreground: oklch(0.25 0.038 322.587);
  --destructive: oklch(0.453 0.164 30.494);
  --destructive-foreground: oklch(0.942 0.025 25.224);
  --ring: oklch(0.625 0.271 322.564);
  --chart-1: oklch(0.625 0.271 322.564);
  --chart-2: oklch(0.844 0.028 322.223);
  --chart-3: oklch(0.781 0.054 322.342);
  --chart-4: oklch(0.869 0.023 322.203);
  --chart-5: oklch(0.629 0.277 322.503);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.109 0.02 323.596);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.186 0.028 322.586);
  --muted-foreground: oklch(0.72 0.042 322.308);
  --popover: oklch(0.109 0.02 323.596);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.109 0.02 323.596);
  --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.625 0.271 322.564);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.281 0.038 322.536);
  --secondary-foreground: oklch(0.809 0.04 322.277);
  --accent: oklch(0.374 0.072 322.68);
  --accent-foreground: oklch(0.891 0.028 322.221);
  --destructive: oklch(0.639 0.195 29.736);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.625 0.271 322.564);
  --chart-1: oklch(0.625 0.271 322.564);
  --chart-2: oklch(0.281 0.038 322.536);
  --chart-3: oklch(0.374 0.072 322.68);
  --chart-4: oklch(0.31 0.043 322.55);
  --chart-5: oklch(0.629 0.277 322.503);
}