Material Color(Dark Modern) for shadcn/ui

Material Color(Dark Modern) is a shadcn/ui theme built around a neutral gray primary color (#d6d6d6) with neutral gray accents (#454545). The light mode uses a neutral background (#1f1f1f). Dark mode keeps the neutral gray primary (#d6d6d6) on a neutral background (#1f1f1f).

Color palette

TokenLightDark
Background
#1f1f1fblack
#1f1f1fblack
Foreground
#cccccclightgrey
#cccccclightgrey
Card
#1a1a1ablack
#1a1a1ablack
Card foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Popover
#171717black
#171717black
Popover foreground
#e6e6e6gainsboro
#e6e6e6gainsboro
Primary
#d6d6d6lightgrey
#d6d6d6lightgrey
Primary foreground
#3d3d3ddarkslategray
#3d3d3ddarkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#2e2424darkslategray
#2e2424darkslategray
Muted foreground
#b39e9edarkgray
#b39e9edarkgray
Accent
#454545darkslategray
#454545darkslategray
Accent foreground
#dededegainsboro
#dededegainsboro
Destructive
#f41606red
#f41606red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#2b2b2bdarkslategray
#2b2b2bdarkslategray
Input
#333333darkslategray
#333333darkslategray
Ring
#d6d6d6lightgrey
#d6d6d6lightgrey

Contrast

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

Light mode
Text on background10.31:1AAA
Text on card12.39:1AAA
Primary button7.48:1AAA
Secondary button7.37:1AAA
Muted text5.96:1AA
Accent7.14:1AAA
Destructive4.24:1AA Large
Dark mode
Text on background10.31:1AAA
Text on card12.39:1AAA
Primary button7.48:1AAA
Secondary button7.37:1AAA
Muted text5.96:1AA
Accent7.14:1AAA
Destructive4.24:1AA Large

CSS variables

Paste this into your globals.css to use Material Color(Dark Modern) in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.238 0 161.565);
  --foreground: oklch(0.845 0 164.055);
  --muted: oklch(0.271 0.015 18.11);
  --muted-foreground: oklch(0.717 0.025 17.739);
  --popover: oklch(0.204 0 180);
  --popover-foreground: oklch(0.923 0 153.435);
  --card: oklch(0.216 0 180);
  --card-foreground: oklch(0.885 0 180);
  --border: oklch(0.29 0 180);
  --input: oklch(0.321 0 180);
  --primary: oklch(0.877 0 180);
  --primary-foreground: oklch(0.361 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.39 0 165.964);
  --accent-foreground: oklch(0.9 0 188.746);
  --destructive: oklch(0.612 0.244 29.753);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.877 0 180);
  --chart-1: oklch(0.877 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.39 0 165.964);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.875 0.003 17.209);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.238 0 161.565);
  --foreground: oklch(0.845 0 164.055);
  --muted: oklch(0.271 0.015 18.11);
  --muted-foreground: oklch(0.717 0.025 17.739);
  --popover: oklch(0.204 0 180);
  --popover-foreground: oklch(0.923 0 153.435);
  --card: oklch(0.216 0 180);
  --card-foreground: oklch(0.885 0 180);
  --border: oklch(0.29 0 180);
  --input: oklch(0.321 0 180);
  --primary: oklch(0.877 0 180);
  --primary-foreground: oklch(0.361 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.39 0 165.964);
  --accent-foreground: oklch(0.9 0 188.746);
  --destructive: oklch(0.612 0.244 29.753);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.877 0 180);
  --chart-1: oklch(0.877 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.39 0 165.964);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.875 0.003 17.209);
}