Metaphor for shadcn/ui

Metaphor is a shadcn/ui theme built around a muted deep teal primary color (#1e2926) with muted deep cyan accents (#1e2729). The light mode uses a neutral background (#f7fdfb). Dark mode keeps the muted deep teal primary (#1e2926) on a teal-tinted background (#040b09).

Color palette

TokenLightDark
Background
#f7fdfbmintcream
#040b09black
Foreground
#000000black
#fcfdfdwhite
Card
#f7fdfbmintcream
#040b09black
Card foreground
#000000black
#fcfdfdwhite
Popover
#f7fdfbmintcream
#040b09black
Popover foreground
#000000black
#fcfdfdwhite
Primary
#1e2926darkslategray
#1e2926darkslategray
Primary foreground
#b2c7c1silver
#b2c7c1silver
Secondary
#1e2920black
#1e2920black
Secondary foreground
#b2c7b6silver
#b2c7b6silver
Muted
#d9edddgainsboro
#122616black
Muted foreground
#586f5cdimgray
#90a794darkseagreen
Accent
#1e2729darkslategray
#1e2729darkslategray
Accent foreground
#b2c3c7silver
#b2c3c7silver
Destructive
#973d0csaddlebrown
#ef7534tomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1e2926darkslategray
#1e2926darkslategray

Contrast

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

Light mode
Text on background20.36:1AAA
Text on card20.36:1AAA
Primary button8.41:1AAA
Secondary button8.39:1AAA
Muted text4.44:1AA Large
Accent8.33:1AAA
Destructive7.03:1AAA
Dark mode
Text on background19.45:1AAA
Text on card19.45:1AAA
Primary button8.41:1AAA
Secondary button8.39:1AAA
Muted text6.19:1AA
Accent8.33:1AAA
Destructive7.26:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.006 175.427);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.926 0.03 150.937);
  --muted-foreground: oklch(0.518 0.042 150.19);
  --popover: oklch(0.988 0.006 175.427);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.988 0.006 175.427);
  --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.271 0.017 173.61);
  --primary-foreground: oklch(0.813 0.025 174.695);
  --secondary: oklch(0.269 0.023 150.078);
  --secondary-foreground: oklch(0.81 0.033 150.802);
  --accent: oklch(0.266 0.014 212.864);
  --accent-foreground: oklch(0.806 0.02 212.709);
  --destructive: oklch(0.476 0.133 43.391);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.271 0.017 173.61);
  --chart-1: oklch(0.271 0.017 173.61);
  --chart-2: oklch(0.269 0.023 150.078);
  --chart-3: oklch(0.266 0.014 212.864);
  --chart-4: oklch(0.302 0.028 150.008);
  --chart-5: oklch(0.273 0.02 173.239);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.141 0.015 175.489);
  --foreground: oklch(0.993 0.002 175.568);
  --muted: oklch(0.246 0.04 148.733);
  --muted-foreground: oklch(0.706 0.039 150.593);
  --popover: oklch(0.141 0.015 175.489);
  --popover-foreground: oklch(0.993 0.002 175.568);
  --card: oklch(0.141 0.015 175.489);
  --card-foreground: oklch(0.993 0.002 175.568);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.271 0.017 173.61);
  --primary-foreground: oklch(0.813 0.025 174.695);
  --secondary: oklch(0.269 0.023 150.078);
  --secondary-foreground: oklch(0.81 0.033 150.802);
  --accent: oklch(0.266 0.014 212.864);
  --accent-foreground: oklch(0.806 0.02 212.709);
  --destructive: oklch(0.695 0.168 45.884);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.271 0.017 173.61);
  --chart-1: oklch(0.271 0.017 173.61);
  --chart-2: oklch(0.269 0.023 150.078);
  --chart-3: oklch(0.266 0.014 212.864);
  --chart-4: oklch(0.302 0.028 150.008);
  --chart-5: oklch(0.273 0.02 173.239);
}