Gruvbox Light Hard for shadcn/ui

Gruvbox Light Hard is a shadcn/ui theme built around a teal primary color (#458588) with muted orange accents (#c8b899). The light mode uses a yellow-tinted background (#ecddb5). Dark mode switches to a vivid deep teal primary (#025043) on a neutral background (#020303).

Color palette

TokenLightDark
Background
#ecddb5wheat
#020303black
Foreground
#282828darkslategray
#f9fbfamintcream
Card
#f9f5d7beige
#030706black
Card foreground
#282828darkslategray
#fcfdfdwhite
Popover
#efe3bewheat
#030706black
Popover foreground
#282828darkslategray
#fcfdfdwhite
Primary
#458588cadetblue
#025043darkslategray
Primary foreground
#f9f5d7beige
#23fbd7turquoise
Secondary
#dddec6lightgrey
#02501cdarkgreen
Secondary foreground
#282828darkslategray
#23fb6bspringgreen
Muted
#d9c8a4tan
#191f1bblack
Muted foreground
#5f5650dimgray
#b9bbbasilver
Accent
#c8b899tan
#023650midnightblue
Accent foreground
#282828darkslategray
#87d5fdlightskyblue
Destructive
#cc241dfirebrick
#f92a01orangered
Destructive foreground
#f9f5d7beige
#ffffffwhite
Border
#c8b899tan
#202222black
Input
#c8b899tan
#202222black
Ring
#458588cadetblue
#025043darkslategray

Contrast

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

Light mode
Text on background10.93:1AAA
Text on card13.38:1AAA
Primary button3.84:1AA Large
Secondary button10.76:1AAA
Muted text4.34:1AA Large
Accent7.56:1AAA
Destructive4.96:1AA
Dark mode
Text on background19.84:1AAA
Text on card19.87:1AAA
Primary button7.11:1AAA
Secondary button6.96:1AA
Muted text8.65:1AAA
Accent7.89:1AAA
Destructive3.92:1AA Large

CSS variables

Paste this into your globals.css to use Gruvbox Light Hard in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.9 0.055 89.923);
  --foreground: oklch(0.277 0 172.875);
  --muted: oklch(0.838 0.052 85.677);
  --muted-foreground: oklch(0.46 0.015 55.978);
  --popover: oklch(0.916 0.05 92.182);
  --popover-foreground: oklch(0.277 0 172.875);
  --card: oklch(0.965 0.039 100.861);
  --card-foreground: oklch(0.277 0 172.875);
  --border: oklch(0.788 0.046 83.857);
  --input: oklch(0.788 0.046 83.857);
  --primary: oklch(0.576 0.066 199.493);
  --primary-foreground: oklch(0.965 0.039 100.861);
  --secondary: oklch(0.893 0.032 108.976);
  --secondary-foreground: oklch(0.277 0 172.875);
  --accent: oklch(0.788 0.046 83.857);
  --accent-foreground: oklch(0.277 0 172.875);
  --destructive: oklch(0.546 0.203 28.663);
  --destructive-foreground: oklch(0.965 0.039 100.861);
  --ring: oklch(0.576 0.066 199.493);
  --chart-1: oklch(0.576 0.066 199.493);
  --chart-2: oklch(0.893 0.032 108.976);
  --chart-3: oklch(0.788 0.046 83.857);
  --chart-4: oklch(0.912 0.027 108.855);
  --chart-5: oklch(0.582 0.07 199.484);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.096 0.007 185.228);
  --foreground: oklch(0.986 0.002 185.405);
  --muted: oklch(0.233 0.013 156.067);
  --muted-foreground: oklch(0.79 0.002 157.214);
  --popover: oklch(0.122 0.009 185.228);
  --popover-foreground: oklch(0.993 0.001 185.427);
  --card: oklch(0.122 0.009 185.228);
  --card-foreground: oklch(0.993 0.001 185.427);
  --border: oklch(0.251 0.004 185.03);
  --input: oklch(0.251 0.004 185.03);
  --primary: oklch(0.386 0.071 176.734);
  --primary-foreground: oklch(0.884 0.16 176.896);
  --secondary: oklch(0.376 0.108 147.851);
  --secondary-foreground: oklch(0.863 0.243 147.903);
  --accent: oklch(0.315 0.068 237.729);
  --accent-foreground: oklch(0.838 0.095 231.159);
  --destructive: oklch(0.63 0.24 31.705);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.386 0.071 176.734);
  --chart-1: oklch(0.386 0.071 176.734);
  --chart-2: oklch(0.376 0.108 147.851);
  --chart-3: oklch(0.315 0.068 237.729);
  --chart-4: oklch(0.423 0.123 147.466);
  --chart-5: oklch(0.389 0.072 176.531);
}