GrunBoxTheme for shadcn/ui

GrunBoxTheme is a shadcn/ui theme built around a light yellow primary color (#ebd9b2) with neutral gray accents (#4f4f4f). The light mode uses a neutral background (#292929). Dark mode keeps the light yellow primary (#ebd9b2) on a neutral background (#292929).

Color palette

TokenLightDark
Background
#292929darkslategray
#292929darkslategray
Foreground
#ebd9b2wheat
#ebd9b2wheat
Card
#242424darkslategray
#242424darkslategray
Card foreground
#f0e3c7bisque
#f0e3c7bisque
Popover
#212121black
#212121black
Popover foreground
#f5eddbantiquewhite
#f5eddbantiquewhite
Primary
#ebd9b2wheat
#ebd9b2wheat
Primary foreground
#554116darkolivegreen
#554116darkolivegreen
Secondary
#53472ddarkolivegreen
#53472ddarkolivegreen
Secondary foreground
#e4ddcdgainsboro
#e4ddcdgainsboro
Muted
#392d2ddarkslategray
#392d2ddarkslategray
Muted foreground
#bca9a9darkgray
#bca9a9darkgray
Accent
#4f4f4fdarkslategray
#4f4f4fdarkslategray
Accent foreground
#e8e8e8lavender
#e8e8e8lavender
Destructive
#ec4c46tomato
#ec4c46tomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#363636darkslategray
#363636darkslategray
Input
#3d3d3ddarkslategray
#3d3d3ddarkslategray
Ring
#ebd9b2wheat
#ebd9b2wheat

Contrast

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

Light mode
Text on background10.48:1AAA
Text on card12.25:1AAA
Primary button6.99:1AA
Secondary button6.75:1AA
Muted text5.91:1AA
Accent6.67:1AA
Destructive3.70:1AA Large
Dark mode
Text on background10.48:1AAA
Text on card12.25:1AAA
Primary button6.99:1AA
Secondary button6.75:1AA
Muted text5.91:1AA
Accent6.67:1AA
Destructive3.70:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.28 0 180);
  --foreground: oklch(0.89 0.054 86.062);
  --muted: oklch(0.31 0.018 18.169);
  --muted-foreground: oklch(0.752 0.021 17.636);
  --popover: oklch(0.248 0 173.29);
  --popover-foreground: oklch(0.948 0.026 86.086);
  --card: oklch(0.259 0 167.471);
  --card-foreground: oklch(0.919 0.04 86.094);
  --border: oklch(0.331 0 180);
  --input: oklch(0.361 0 180);
  --primary: oklch(0.89 0.054 86.062);
  --primary-foreground: oklch(0.387 0.064 83.716);
  --secondary: oklch(0.402 0.043 85.664);
  --secondary-foreground: oklch(0.899 0.022 86.082);
  --accent: oklch(0.428 0 180);
  --accent-foreground: oklch(0.931 0 180);
  --destructive: oklch(0.639 0.197 26.346);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.89 0.054 86.062);
  --chart-1: oklch(0.89 0.054 86.062);
  --chart-2: oklch(0.402 0.043 85.664);
  --chart-3: oklch(0.428 0 180);
  --chart-4: oklch(0.434 0.048 85.638);
  --chart-5: oklch(0.892 0.057 86.052);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.28 0 180);
  --foreground: oklch(0.89 0.054 86.062);
  --muted: oklch(0.31 0.018 18.169);
  --muted-foreground: oklch(0.752 0.021 17.636);
  --popover: oklch(0.248 0 173.29);
  --popover-foreground: oklch(0.948 0.026 86.086);
  --card: oklch(0.259 0 167.471);
  --card-foreground: oklch(0.919 0.04 86.094);
  --border: oklch(0.331 0 180);
  --input: oklch(0.361 0 180);
  --primary: oklch(0.89 0.054 86.062);
  --primary-foreground: oklch(0.387 0.064 83.716);
  --secondary: oklch(0.402 0.043 85.664);
  --secondary-foreground: oklch(0.899 0.022 86.082);
  --accent: oklch(0.428 0 180);
  --accent-foreground: oklch(0.931 0 180);
  --destructive: oklch(0.639 0.197 26.346);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.89 0.054 86.062);
  --chart-1: oklch(0.89 0.054 86.062);
  --chart-2: oklch(0.402 0.043 85.664);
  --chart-3: oklch(0.428 0 180);
  --chart-4: oklch(0.434 0.048 85.638);
  --chart-5: oklch(0.892 0.057 86.052);
}