Gruvbox Light Hard for shadcn/ui

Gruvbox Light Hard is a shadcn/ui theme built around a neutral gray primary color (#3b3735) with light yellow accents (#efe595). The light mode uses a yellow-tinted background (#f9f5d7). Dark mode keeps the neutral gray primary (#3b3735) on a yellow-tinted background (#f9f5d7).

Color palette

TokenLightDark
Background
#f9f5d7beige
#f9f5d7beige
Foreground
#3b3735darkslategray
#3b3735darkslategray
Card
#f8f3celightgoldenrodyellow
#f8f3celightgoldenrodyellow
Card foreground
#2e2b29darkslategray
#2e2b29darkslategray
Popover
#f7f2cablanchedalmond
#f7f2cablanchedalmond
Popover foreground
#201e1dblack
#201e1dblack
Primary
#3b3735darkslategray
#3b3735darkslategray
Primary foreground
#d3d0cflightgrey
#d3d0cflightgrey
Secondary
#bfbfbfsilver
#bfbfbfsilver
Secondary foreground
#262626darkslategray
#262626darkslategray
Muted
#e2e1dagainsboro
#e2e1dagainsboro
Muted foreground
#4d4b3ddarkslategray
#4d4b3ddarkslategray
Accent
#efe595khaki
#efe595khaki
Accent foreground
#47400bdarkolivegreen
#47400bdarkolivegreen
Destructive
#721403maroon
#721403maroon
Destructive foreground
#fdb7aalightpink
#fdb7aalightpink
Border
#f2edc4bisque
#f2edc4bisque
Input
#efe9b8wheat
#efe9b8wheat
Ring
#3b3735darkslategray
#3b3735darkslategray

Contrast

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

Light mode
Text on background10.69:1AAA
Text on card12.50:1AAA
Primary button7.66:1AAA
Secondary button8.25:1AAA
Muted text6.69:1AA
Accent8.10:1AAA
Destructive6.88:1AA
Dark mode
Text on background10.69:1AAA
Text on card12.50:1AAA
Primary button7.66:1AAA
Secondary button8.25:1AAA
Muted text6.69:1AA
Accent8.10:1AAA
Destructive6.88:1AA

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.966 0.039 100.921);
  --foreground: oklch(0.341 0.006 48.534);
  --muted: oklch(0.908 0.009 100.49);
  --muted-foreground: oklch(0.411 0.024 101.133);
  --popover: oklch(0.954 0.052 101.102);
  --popover-foreground: oklch(0.237 0.004 48.564);
  --card: oklch(0.958 0.048 101.043);
  --card-foreground: oklch(0.29 0.005 48.546);
  --border: oklch(0.94 0.053 101.121);
  --input: oklch(0.927 0.064 101.273);
  --primary: oklch(0.341 0.006 48.534);
  --primary-foreground: oklch(0.861 0.004 48.694);
  --secondary: oklch(0.805 0 169.695);
  --secondary-foreground: oklch(0.27 0 180);
  --accent: oklch(0.911 0.101 101.681);
  --accent-foreground: oklch(0.368 0.07 101.431);
  --destructive: oklch(0.36 0.131 32.424);
  --destructive-foreground: oklch(0.841 0.084 30.153);
  --ring: oklch(0.341 0.006 48.534);
  --chart-1: oklch(0.341 0.006 48.534);
  --chart-2: oklch(0.805 0 169.695);
  --chart-3: oklch(0.911 0.101 101.681);
  --chart-4: oklch(0.829 0 180);
  --chart-5: oklch(0.34 0.01 48.413);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.966 0.039 100.921);
  --foreground: oklch(0.341 0.006 48.534);
  --muted: oklch(0.908 0.009 100.49);
  --muted-foreground: oklch(0.411 0.024 101.133);
  --popover: oklch(0.954 0.052 101.102);
  --popover-foreground: oklch(0.237 0.004 48.564);
  --card: oklch(0.958 0.048 101.043);
  --card-foreground: oklch(0.29 0.005 48.546);
  --border: oklch(0.94 0.053 101.121);
  --input: oklch(0.927 0.064 101.273);
  --primary: oklch(0.341 0.006 48.534);
  --primary-foreground: oklch(0.861 0.004 48.694);
  --secondary: oklch(0.805 0 169.695);
  --secondary-foreground: oklch(0.27 0 180);
  --accent: oklch(0.911 0.101 101.681);
  --accent-foreground: oklch(0.368 0.07 101.431);
  --destructive: oklch(0.36 0.131 32.424);
  --destructive-foreground: oklch(0.841 0.084 30.153);
  --ring: oklch(0.341 0.006 48.534);
  --chart-1: oklch(0.341 0.006 48.534);
  --chart-2: oklch(0.805 0 169.695);
  --chart-3: oklch(0.911 0.101 101.681);
  --chart-4: oklch(0.829 0 180);
  --chart-5: oklch(0.34 0.01 48.413);
}