Vegetarian for shadcn/ui

Vegetarian is a shadcn/ui theme built around a muted deep purple primary color (#312130) with near-white accents (#e8e8e8). The light mode uses a neutral background (#fefbfe). Dark mode keeps the muted deep purple primary (#312130) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#fefbfewhite
#070307black
Foreground
#000000black
#faf4faghostwhite
Card
#fefbfewhite
#070307black
Card foreground
#000000black
#faf4faghostwhite
Popover
#fefbfewhite
#070307black
Popover foreground
#000000black
#faf4faghostwhite
Primary
#312130darkslategray
#312130darkslategray
Primary foreground
#cdb6ccthistle
#cdb6ccthistle
Secondary
#e8e8e8lavender
#1e151eblack
Secondary foreground
#4f4f4fdarkslategray
#c0a5bfsilver
Muted
#e5e1e1gainsboro
#1e1a1eblack
Muted foreground
#666666dimgray
#999999darkgray
Accent
#e8e8e8lavender
#1e151eblack
Accent foreground
#4f4f4fdarkslategray
#c0a5bfsilver
Destructive
#720404maroon
#f82525crimson
Destructive foreground
#fcabablightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#312130darkslategray
#312130darkslategray

Contrast

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

Light mode
Text on background20.41:1AAA
Text on card20.41:1AAA
Primary button8.03:1AAA
Secondary button6.68:1AA
Muted text4.41:1AA Large
Accent6.68:1AA
Destructive6.68:1AA
Dark mode
Text on background18.91:1AAA
Text on card18.91:1AAA
Primary button8.03:1AAA
Secondary button7.94:1AAA
Muted text6.03:1AA
Accent7.94:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 327.09);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.912 0.005 17.246);
  --muted-foreground: oklch(0.51 0 171.87);
  --popover: oklch(0.991 0.005 327.09);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.991 0.005 327.09);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.273 0.035 328.143);
  --primary-foreground: oklch(0.803 0.04 327.488);
  --secondary: oklch(0.931 0 180);
  --secondary-foreground: oklch(0.428 0 180);
  --accent: oklch(0.931 0 180);
  --accent-foreground: oklch(0.428 0 180);
  --destructive: oklch(0.348 0.14 28.729);
  --destructive-foreground: oklch(0.82 0.096 19.344);
  --ring: oklch(0.273 0.035 328.143);
  --chart-1: oklch(0.273 0.035 328.143);
  --chart-2: oklch(0.931 0 180);
  --chart-3: oklch(0.931 0 180);
  --chart-4: oklch(0.954 0 180);
  --chart-5: oklch(0.272 0.04 328.305);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.11 0.02 328.178);
  --foreground: oklch(0.974 0.01 327.133);
  --muted: oklch(0.224 0.011 327.467);
  --muted-foreground: oklch(0.683 0 180);
  --popover: oklch(0.11 0.02 328.178);
  --popover-foreground: oklch(0.974 0.01 327.133);
  --card: oklch(0.11 0.02 328.178);
  --card-foreground: oklch(0.974 0.01 327.133);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.273 0.035 328.143);
  --primary-foreground: oklch(0.803 0.04 327.488);
  --secondary: oklch(0.211 0.022 327.954);
  --secondary-foreground: oklch(0.753 0.048 327.611);
  --accent: oklch(0.211 0.022 327.954);
  --accent-foreground: oklch(0.753 0.048 327.611);
  --destructive: oklch(0.628 0.24 27.771);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.273 0.035 328.143);
  --chart-1: oklch(0.273 0.035 328.143);
  --chart-2: oklch(0.211 0.022 327.954);
  --chart-3: oklch(0.211 0.022 327.954);
  --chart-4: oklch(0.243 0.028 328.032);
  --chart-5: oklch(0.272 0.04 328.305);
}