Grass for shadcn/ui

Grass is a shadcn/ui theme built around a muted violet primary color (#4b3e5b) with muted green accents (#3e5b4b). The light mode uses a neutral background (#faf8fc). Dark mode keeps the muted violet primary (#4b3e5b) on a violet-tinted background (#0a060e).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#0a060eblack
Foreground
#07040cblack
#faf9fbghostwhite
Card
#faf8fcghostwhite
#0a060eblack
Card foreground
#07040cblack
#faf9fbghostwhite
Popover
#faf8fcghostwhite
#0a060eblack
Popover foreground
#07040cblack
#faf9fbghostwhite
Primary
#4b3e5bdarkslategray
#4b3e5bdarkslategray
Primary foreground
#e5e1ealavender
#e5e1ealavender
Secondary
#5b4b3edarkolivegreen
#5b4b3edarkolivegreen
Secondary foreground
#eae5e1gainsboro
#eae5e1gainsboro
Muted
#f3efeclinen
#130f0cblack
Muted foreground
#645b54dimgray
#aba29bdarkgray
Accent
#3e5b4bdarkslategray
#3e5b4bdarkslategray
Accent foreground
#e1eae5gainsboro
#e1eae5gainsboro
Destructive
#710f04maroon
#f6250eorangered
Destructive foreground
#fcb3ablightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4b3e5bdarkslategray
#4b3e5bdarkslategray

Contrast

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

Light mode
Text on background19.21:1AAA
Text on card19.21:1AAA
Primary button7.62:1AAA
Secondary button6.69:1AA
Muted text5.81:1AA
Accent6.10:1AA
Destructive6.85:1AA
Dark mode
Text on background19.14:1AAA
Text on card19.14:1AAA
Primary button7.62:1AAA
Secondary button6.69:1AA
Muted text7.61:1AAA
Accent6.10:1AA
Destructive4.03:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.981 0.007 305.649);
  --foreground: oklch(0.117 0.023 306.713);
  --muted: oklch(0.955 0.006 60.194);
  --muted-foreground: oklch(0.477 0.017 59.8);
  --popover: oklch(0.981 0.007 305.649);
  --popover-foreground: oklch(0.117 0.023 306.713);
  --card: oklch(0.981 0.007 305.649);
  --card-foreground: oklch(0.117 0.023 306.713);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.389 0.051 303.975);
  --primary-foreground: oklch(0.915 0.014 305.539);
  --secondary: oklch(0.424 0.03 59.246);
  --secondary-foreground: oklch(0.925 0.008 60.161);
  --accent: oklch(0.443 0.044 159.12);
  --accent-foreground: oklch(0.929 0.013 161.476);
  --destructive: oklch(0.354 0.133 30.83);
  --destructive-foreground: oklch(0.834 0.086 26.16);
  --ring: oklch(0.389 0.051 303.975);
  --chart-1: oklch(0.389 0.051 303.975);
  --chart-2: oklch(0.424 0.03 59.246);
  --chart-3: oklch(0.443 0.044 159.12);
  --chart-4: oklch(0.453 0.033 59.229);
  --chart-5: oklch(0.385 0.059 303.658);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.133 0.021 305.377);
  --foreground: oklch(0.983 0.003 305.697);
  --muted: oklch(0.172 0.01 59.492);
  --muted-foreground: oklch(0.718 0.015 59.997);
  --popover: oklch(0.133 0.021 305.377);
  --popover-foreground: oklch(0.983 0.003 305.697);
  --card: oklch(0.133 0.021 305.377);
  --card-foreground: oklch(0.983 0.003 305.697);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.389 0.051 303.975);
  --primary-foreground: oklch(0.915 0.014 305.539);
  --secondary: oklch(0.424 0.03 59.246);
  --secondary-foreground: oklch(0.925 0.008 60.161);
  --accent: oklch(0.443 0.044 159.12);
  --accent-foreground: oklch(0.929 0.013 161.476);
  --destructive: oklch(0.623 0.24 30.428);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.389 0.051 303.975);
  --chart-1: oklch(0.389 0.051 303.975);
  --chart-2: oklch(0.424 0.03 59.246);
  --chart-3: oklch(0.443 0.044 159.12);
  --chart-4: oklch(0.453 0.033 59.229);
  --chart-5: oklch(0.385 0.059 303.658);
}