Grim for shadcn/ui

Grim is a shadcn/ui theme built around a muted purple primary color (#7a5274) with muted green accents (#527a58). The light mode uses a neutral background (#fcf8fb). Dark mode keeps the muted purple primary (#7a5274) on a purple-tinted background (#0b040a).

Color palette

TokenLightDark
Background
#fcf8fbsnow
#0b040ablack
Foreground
#150412black
#fcf8fbsnow
Card
#fcf8fbsnow
#0b040ablack
Card foreground
#150412black
#fcf8fbsnow
Popover
#fcf8fbsnow
#0b040ablack
Popover foreground
#150412black
#fcf8fbsnow
Primary
#7a5274dimgray
#7a5274dimgray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#527a58dimgray
#527a58dimgray
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#eff1efwhitesmoke
#0e100fblack
Muted foreground
#424242darkslategray
#bdbdbdsilver
Accent
#527a58dimgray
#527a58dimgray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#c52007firebrick
#f8533atomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#7a5274dimgray
#7a5274dimgray

Contrast

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

Light mode
Text on background18.87:1AAA
Text on card18.87:1AAA
Primary button6.40:1AA
Secondary button4.88:1AA
Muted text8.83:1AAA
Accent4.88:1AA
Destructive5.85:1AA
Dark mode
Text on background19.26:1AAA
Text on card19.26:1AAA
Primary button6.40:1AA
Secondary button4.88:1AA
Muted text10.14:1AAA
Accent4.88:1AA
Destructive6.29:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.005 330.889);
  --foreground: oklch(0.15 0.043 333.8);
  --muted: oklch(0.955 0.003 150.774);
  --muted-foreground: oklch(0.38 0 180);
  --popover: oklch(0.983 0.005 330.889);
  --popover-foreground: oklch(0.15 0.043 333.8);
  --card: oklch(0.983 0.005 330.889);
  --card-foreground: oklch(0.15 0.043 333.8);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.494 0.073 332.696);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.541 0.07 148.866);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.07 148.866);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.529 0.2 31.231);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.494 0.073 332.696);
  --chart-1: oklch(0.494 0.073 332.696);
  --chart-2: oklch(0.541 0.07 148.866);
  --chart-3: oklch(0.541 0.07 148.866);
  --chart-4: oklch(0.569 0.074 148.85);
  --chart-5: oklch(0.493 0.084 332.96);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.125 0.023 331.911);
  --foreground: oklch(0.983 0.006 330.9);
  --muted: oklch(0.172 0.005 150.414);
  --muted-foreground: oklch(0.797 0 180);
  --popover: oklch(0.125 0.023 331.911);
  --popover-foreground: oklch(0.983 0.006 330.9);
  --card: oklch(0.125 0.023 331.911);
  --card-foreground: oklch(0.983 0.006 330.9);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.494 0.073 332.696);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.541 0.07 148.866);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.07 148.866);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.666 0.205 31.501);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.494 0.073 332.696);
  --chart-1: oklch(0.494 0.073 332.696);
  --chart-2: oklch(0.541 0.07 148.866);
  --chart-3: oklch(0.541 0.07 148.866);
  --chart-4: oklch(0.569 0.074 148.85);
  --chart-5: oklch(0.493 0.084 332.96);
}