Cavernous for shadcn/ui

Cavernous is a shadcn/ui theme built around a vivid violet primary color (#4711c5) with vivid green accents (#11c547). The light mode uses a neutral background (#fcfbfd). Dark mode keeps the vivid violet primary (#4711c5) on a violet-tinted background (#06040b).

Color palette

TokenLightDark
Background
#fcfbfdsnow
#06040bblack
Foreground
#030109black
#f7f6f8whitesmoke
Card
#fcfbfdsnow
#06040bblack
Card foreground
#030109black
#f7f6f8whitesmoke
Popover
#fcfbfdsnow
#06040bblack
Popover foreground
#030109black
#f7f6f8whitesmoke
Primary
#4711c5rebeccapurple
#4711c5rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#c54711chocolate
#c54711chocolate
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e5d7d2gainsboro
#2d201ablack
Muted foreground
#4b4a49darkslategray
#b6b5b4silver
Accent
#11c547limegreen
#11c547limegreen
Accent foreground
#010903black
#010903black
Destructive
#752300maroon
#ff4d00orangered
Destructive foreground
#ffc2a8lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4711c5rebeccapurple
#4711c5rebeccapurple

Contrast

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

Light mode
Text on background20.17:1AAA
Text on card20.17:1AAA
Primary button9.73:1AAA
Secondary button4.89:1AA
Muted text6.32:1AA
Accent8.74:1AAA
Destructive6.75:1AA
Dark mode
Text on background18.93:1AAA
Text on card18.93:1AAA
Primary button9.73:1AAA
Secondary button4.89:1AA
Muted text7.69:1AAA
Accent8.74:1AAA
Destructive3.33:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 299.994);
  --foreground: oklch(0.09 0.032 300.42);
  --muted: oklch(0.89 0.017 44.795);
  --muted-foreground: oklch(0.409 0.002 44.942);
  --popover: oklch(0.991 0.003 299.994);
  --popover-foreground: oklch(0.09 0.032 300.42);
  --card: oklch(0.991 0.003 299.994);
  --card-foreground: oklch(0.09 0.032 300.42);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.417 0.237 282.404);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.566 0.171 39.529);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.718 0.213 146.515);
  --accent-foreground: oklch(0.126 0.027 155.181);
  --destructive: oklch(0.382 0.122 39.243);
  --destructive-foreground: oklch(0.863 0.078 44.272);
  --ring: oklch(0.417 0.237 282.404);
  --chart-1: oklch(0.417 0.237 282.404);
  --chart-2: oklch(0.566 0.171 39.529);
  --chart-3: oklch(0.718 0.213 146.515);
  --chart-4: oklch(0.595 0.181 39.434);
  --chart-5: oklch(0.417 0.242 281.517);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.116 0.022 300.106);
  --foreground: oklch(0.975 0.003 299.984);
  --muted: oklch(0.257 0.024 44.266);
  --muted-foreground: oklch(0.773 0.001 44.964);
  --popover: oklch(0.116 0.022 300.106);
  --popover-foreground: oklch(0.975 0.003 299.984);
  --card: oklch(0.116 0.022 300.106);
  --card-foreground: oklch(0.975 0.003 299.984);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.417 0.237 282.404);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.566 0.171 39.529);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.718 0.213 146.515);
  --accent-foreground: oklch(0.126 0.027 155.181);
  --destructive: oklch(0.667 0.224 36.881);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.417 0.237 282.404);
  --chart-1: oklch(0.417 0.237 282.404);
  --chart-2: oklch(0.566 0.171 39.529);
  --chart-3: oklch(0.718 0.213 146.515);
  --chart-4: oklch(0.595 0.181 39.434);
  --chart-5: oklch(0.417 0.242 281.517);
}