Cation for shadcn/ui

Cation is a shadcn/ui theme built around a muted deep green primary color (#11110e) with muted light green accents (#d5d7c6). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep green primary (#11110e) on a neutral background (#040401).

Color palette

TokenLightDark
Background
#ffffffwhite
#040401black
Foreground
#040401black
#ffffffwhite
Card
#ffffffwhite
#040401black
Card foreground
#040401black
#ffffffwhite
Popover
#ffffffwhite
#040401black
Popover foreground
#040401black
#ffffffwhite
Primary
#11110eblack
#11110eblack
Primary foreground
#b0b29fdarkgray
#b0b29fdarkgray
Secondary
#d5d7c6lightgrey
#252522darkslategray
Secondary foreground
#3d3f2cdarkslategray
#bfc0b9silver
Muted
#e6e9d3gainsboro
#2a2c16black
Muted foreground
#51514ddarkslategray
#b2b2aedarkgray
Accent
#d5d7c6lightgrey
#252522darkslategray
Accent foreground
#3d3f2cdarkslategray
#bfc0b9silver
Destructive
#b2260afirebrick
#f13813orangered
Destructive foreground
#fef3f1seashell
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#11110eblack
#11110eblack

Contrast

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

Light mode
Text on background20.52:1AAA
Text on card20.52:1AAA
Primary button8.75:1AAA
Secondary button7.39:1AAA
Muted text6.43:1AA
Accent7.39:1AAA
Destructive6.05:1AA
Dark mode
Text on background20.54:1AAA
Text on card20.54:1AAA
Primary button8.75:1AAA
Secondary button8.34:1AAA
Muted text6.71:1AA
Accent8.34:1AAA
Destructive3.94:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.103 0.014 112.955);
  --muted: oklch(0.926 0.029 112.367);
  --muted-foreground: oklch(0.434 0.008 112.11);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.103 0.014 112.955);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.103 0.014 112.955);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.176 0.007 112.497);
  --primary-foreground: oklch(0.756 0.027 112.438);
  --secondary: oklch(0.874 0.024 112.284);
  --secondary-foreground: oklch(0.36 0.032 113.409);
  --accent: oklch(0.874 0.024 112.284);
  --accent-foreground: oklch(0.36 0.032 113.409);
  --destructive: oklch(0.499 0.18 32.511);
  --destructive-foreground: oklch(0.972 0.013 31.07);
  --ring: oklch(0.176 0.007 112.497);
  --chart-1: oklch(0.176 0.007 112.497);
  --chart-2: oklch(0.874 0.024 112.284);
  --chart-3: oklch(0.874 0.024 112.284);
  --chart-4: oklch(0.894 0.02 112.194);
  --chart-5: oklch(0.177 0.009 112.678);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.103 0.014 112.955);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.284 0.037 114.208);
  --muted-foreground: oklch(0.763 0.007 111.944);
  --popover: oklch(0.103 0.014 112.955);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.103 0.014 112.955);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.176 0.007 112.497);
  --primary-foreground: oklch(0.756 0.027 112.438);
  --secondary: oklch(0.265 0.007 112.239);
  --secondary-foreground: oklch(0.805 0.009 111.994);
  --accent: oklch(0.265 0.007 112.239);
  --accent-foreground: oklch(0.805 0.009 111.994);
  --destructive: oklch(0.626 0.225 32.531);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.176 0.007 112.497);
  --chart-1: oklch(0.176 0.007 112.497);
  --chart-2: oklch(0.265 0.007 112.239);
  --chart-3: oklch(0.265 0.007 112.239);
  --chart-4: oklch(0.297 0.008 112.263);
  --chart-5: oklch(0.177 0.009 112.678);
}