Gravel for shadcn/ui

Gravel is a shadcn/ui theme built around a violet primary color (#9e76bc) with purple accents (#bc76b7). The light mode uses a neutral background (#faf8fc). Dark mode keeps the violet primary (#9e76bc) on a violet-tinted background (#0b070d).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#0b070dblack
Foreground
#060109black
#f7f7f8whitesmoke
Card
#faf8fcghostwhite
#0b070dblack
Card foreground
#060109black
#f7f7f8whitesmoke
Popover
#faf8fcghostwhite
#0b070dblack
Popover foreground
#060109black
#f7f7f8whitesmoke
Primary
#9e76bcmediumpurple
#9e76bcmediumpurple
Primary foreground
#000000black
#000000black
Secondary
#7b76bcslateblue
#7b76bcslateblue
Secondary foreground
#000000black
#000000black
Muted
#ecebeflavender
#101014black
Muted foreground
#3b3a4adarkslategray
#b6b5c5silver
Accent
#bc76b7mediumorchid
#bc76b7mediumorchid
Accent foreground
#000000black
#000000black
Destructive
#cb2e06firebrick
#ed3507orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#9e76bcmediumpurple
#9e76bcmediumpurple

Contrast

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

Light mode
Text on background19.53:1AAA
Text on card19.53:1AAA
Primary button5.77:1AA
Secondary button5.17:1AA
Muted text9.37:1AAA
Accent6.42:1AA
Destructive5.35:1AA
Dark mode
Text on background18.66:1AAA
Text on card18.66:1AAA
Primary button5.77:1AA
Secondary button5.17:1AA
Muted text9.39:1AAA
Accent6.42:1AA
Destructive4.08:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.981 0.007 311.023);
  --foreground: oklch(0.099 0.029 313.471);
  --muted: oklch(0.942 0.005 289.383);
  --muted-foreground: oklch(0.357 0.027 287.984);
  --popover: oklch(0.981 0.007 311.023);
  --popover-foreground: oklch(0.099 0.029 313.471);
  --card: oklch(0.981 0.007 311.023);
  --card-foreground: oklch(0.099 0.029 313.471);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.632 0.11 309.526);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.6 0.104 285.847);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.662 0.122 329.208);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.549 0.198 33.297);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.632 0.11 309.526);
  --chart-1: oklch(0.632 0.11 309.526);
  --chart-2: oklch(0.6 0.104 285.847);
  --chart-3: oklch(0.662 0.122 329.208);
  --chart-4: oklch(0.631 0.095 286.37);
  --chart-5: oklch(0.628 0.119 309.366);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.138 0.015 310.946);
  --foreground: oklch(0.976 0.002 311.063);
  --muted: oklch(0.175 0.007 288.681);
  --muted-foreground: oklch(0.778 0.022 288.932);
  --popover: oklch(0.138 0.015 310.946);
  --popover-foreground: oklch(0.976 0.002 311.063);
  --card: oklch(0.138 0.015 310.946);
  --card-foreground: oklch(0.976 0.002 311.063);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.632 0.11 309.526);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.6 0.104 285.847);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.662 0.122 329.208);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.617 0.224 33.117);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.632 0.11 309.526);
  --chart-1: oklch(0.632 0.11 309.526);
  --chart-2: oklch(0.6 0.104 285.847);
  --chart-3: oklch(0.662 0.122 329.208);
  --chart-4: oklch(0.631 0.095 286.37);
  --chart-5: oklch(0.628 0.119 309.366);
}