Spacegray Mocha Dark for shadcn/ui

Spacegray Mocha Dark is a shadcn/ui theme built around a near-white primary color (#ffffff) with muted orange accents (#675846). The light mode uses an orange-tinted background (#3a3127). Dark mode keeps the near-white primary (#ffffff) on an orange-tinted background (#3a3127).

Color palette

TokenLightDark
Background
#3a3127darkslategray
#3a3127darkslategray
Foreground
#d1c9c7lightgrey
#d1c9c7lightgrey
Card
#342c23darkslategray
#342c23darkslategray
Card foreground
#ddd6d5gainsboro
#ddd6d5gainsboro
Popover
#312921darkslategray
#312921darkslategray
Popover foreground
#e8e4e3gainsboro
#e8e4e3gainsboro
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#423b34darkslategray
#423b34darkslategray
Muted foreground
#c2bbb2silver
#c2bbb2silver
Accent
#675846darkolivegreen
#675846darkolivegreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#eb2724crimson
#eb2724crimson
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#433e38darkslategray
#433e38darkslategray
Input
#4b453fdarkslategray
#4b453fdarkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background7.82:1AAA
Text on card9.59:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.79:1AA
Accent6.86:1AA
Destructive4.34:1AA Large
Dark mode
Text on background7.82:1AAA
Text on card9.59:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.79:1AA
Accent6.86:1AA
Destructive4.34:1AA Large

CSS variables

Paste this into your globals.css to use Spacegray Mocha Dark in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.32 0.021 70.704);
  --foreground: oklch(0.842 0.01 34.301);
  --muted: oklch(0.357 0.016 71.006);
  --muted-foreground: oklch(0.795 0.015 71.279);
  --popover: oklch(0.287 0.018 70.743);
  --popover-foreground: oklch(0.922 0.005 34.309);
  --card: oklch(0.298 0.019 70.729);
  --card-foreground: oklch(0.882 0.007 34.304);
  --border: oklch(0.365 0.012 71.129);
  --input: oklch(0.395 0.013 71.121);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.47 0.034 70.594);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.604 0.228 28.068);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.47 0.034 70.594);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.32 0.021 70.704);
  --foreground: oklch(0.842 0.01 34.301);
  --muted: oklch(0.357 0.016 71.006);
  --muted-foreground: oklch(0.795 0.015 71.279);
  --popover: oklch(0.287 0.018 70.743);
  --popover-foreground: oklch(0.922 0.005 34.309);
  --card: oklch(0.298 0.019 70.729);
  --card-foreground: oklch(0.882 0.007 34.304);
  --border: oklch(0.365 0.012 71.129);
  --input: oklch(0.395 0.013 71.121);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.47 0.034 70.594);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.604 0.228 28.068);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.47 0.034 70.594);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}