Metric for shadcn/ui

Metric is a shadcn/ui theme built around a muted light blue primary color (#b7bbcd) with muted light yellow accents (#cdc8b7). The light mode uses a neutral background (#fbfcfe). Dark mode keeps the muted light blue primary (#b7bbcd) on a blue-tinted background (#03050c).

Color palette

TokenLightDark
Background
#fbfcfewhite
#03050cblack
Foreground
#060914black
#fcfcfdwhite
Card
#fbfcfewhite
#03050cblack
Card foreground
#060914black
#fcfcfdwhite
Popover
#fbfcfewhite
#03050cblack
Popover foreground
#060914black
#fcfcfdwhite
Primary
#b7bbcdsilver
#b7bbcdsilver
Primary foreground
#212430darkslategray
#212430darkslategray
Secondary
#cdc8b7silver
#cdc8b7silver
Secondary foreground
#302d21darkslategray
#302d21darkslategray
Muted
#e3dfcegainsboro
#312c1cdarkslategray
Muted foreground
#6a6862dimgray
#9d9b95darkgray
Accent
#cdc8b7silver
#cdc8b7silver
Accent foreground
#302d21darkslategray
#302d21darkslategray
Destructive
#dd0e03red
#fc281dorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b7bbcdsilver
#b7bbcdsilver

Contrast

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

Light mode
Text on background19.33:1AAA
Text on card19.33:1AAA
Primary button8.09:1AAA
Secondary button8.25:1AAA
Muted text4.16:1AA Large
Accent8.25:1AAA
Destructive5.07:1AA
Dark mode
Text on background19.86:1AAA
Text on card19.86:1AAA
Primary button8.09:1AAA
Secondary button8.25:1AAA
Muted text4.99:1AA
Accent8.25:1AAA
Destructive3.85:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 275.003);
  --foreground: oklch(0.141 0.025 270.197);
  --muted: oklch(0.902 0.023 95.312);
  --muted-foreground: oklch(0.518 0.01 95.258);
  --popover: oklch(0.99 0.003 275.003);
  --popover-foreground: oklch(0.141 0.025 270.197);
  --card: oklch(0.99 0.003 275.003);
  --card-foreground: oklch(0.141 0.025 270.197);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.795 0.025 274.623);
  --primary-foreground: oklch(0.264 0.022 273.828);
  --secondary: oklch(0.833 0.025 95.356);
  --secondary-foreground: oklch(0.297 0.021 95.676);
  --accent: oklch(0.833 0.025 95.356);
  --accent-foreground: oklch(0.297 0.021 95.676);
  --destructive: oklch(0.567 0.228 29.6);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.795 0.025 274.623);
  --chart-1: oklch(0.795 0.025 274.623);
  --chart-2: oklch(0.833 0.025 95.356);
  --chart-3: oklch(0.833 0.025 95.356);
  --chart-4: oklch(0.854 0.021 95.312);
  --chart-5: oklch(0.792 0.03 274.546);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.116 0.02 267.683);
  --foreground: oklch(0.992 0.001 275.024);
  --muted: oklch(0.294 0.028 95.782);
  --muted-foreground: oklch(0.69 0.01 95.193);
  --popover: oklch(0.116 0.02 267.683);
  --popover-foreground: oklch(0.992 0.001 275.024);
  --card: oklch(0.116 0.02 267.683);
  --card-foreground: oklch(0.992 0.001 275.024);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.795 0.025 274.623);
  --primary-foreground: oklch(0.264 0.022 273.828);
  --secondary: oklch(0.833 0.025 95.356);
  --secondary-foreground: oklch(0.297 0.021 95.676);
  --accent: oklch(0.833 0.025 95.356);
  --accent-foreground: oklch(0.297 0.021 95.676);
  --destructive: oklch(0.635 0.242 29.225);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.795 0.025 274.623);
  --chart-1: oklch(0.795 0.025 274.623);
  --chart-2: oklch(0.833 0.025 95.356);
  --chart-3: oklch(0.833 0.025 95.356);
  --chart-4: oklch(0.854 0.021 95.312);
  --chart-5: oklch(0.792 0.03 274.546);
}