Cation for shadcn/ui

Cation is a shadcn/ui theme built around a vivid green primary color (#5fed0c) with muted light green accents (#dce3d9). The light mode uses a neutral background (#fcfefb). Dark mode keeps the vivid green primary (#5fed0c) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fcfefbwhite
#000000black
Foreground
#000000black
#fcfdfcwhite
Card
#f9fcf8mintcream
#030303black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfefbwhite
#000000black
Popover foreground
#000000black
#fcfdfcwhite
Primary
#5fed0clawngreen
#5fed0clawngreen
Primary foreground
#112c02black
#112c02black
Secondary
#dce3d9gainsboro
#1e221cblack
Secondary foreground
#42503adarkslategray
#b6bfb0silver
Muted
#eaece9linen
#141613black
Muted foreground
#404c38darkslategray
#bac7b3silver
Accent
#dce3d9gainsboro
#1e221cblack
Accent foreground
#42503adarkslategray
#b6bfb0silver
Destructive
#d93f02orangered
#fd4d08orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5fed0clawngreen
#5fed0clawngreen

Contrast

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

Light mode
Text on background20.67:1AAA
Text on card20.34:1AAA
Primary button9.85:1AAA
Secondary button6.58:1AA
Muted text7.66:1AAA
Accent6.58:1AA
Destructive4.49:1AA Large
Dark mode
Text on background20.59:1AAA
Text on card20.67:1AAA
Primary button9.85:1AAA
Secondary button8.54:1AAA
Muted text10.31:1AAA
Accent8.54:1AAA
Destructive3.37:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.004 133.628);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.941 0.005 133.638);
  --muted-foreground: oklch(0.4 0.036 134.214);
  --popover: oklch(0.994 0.004 133.628);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.988 0.007 133.65);
  --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.835 0.259 138.588);
  --primary-foreground: oklch(0.261 0.074 136.182);
  --secondary: oklch(0.908 0.016 133.716);
  --secondary-foreground: oklch(0.412 0.04 134.26);
  --accent: oklch(0.908 0.016 133.716);
  --accent-foreground: oklch(0.412 0.04 134.26);
  --destructive: oklch(0.59 0.199 36.548);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.835 0.259 138.588);
  --chart-1: oklch(0.835 0.259 138.588);
  --chart-2: oklch(0.908 0.016 133.716);
  --chart-3: oklch(0.908 0.016 133.716);
  --chart-4: oklch(0.93 0.012 133.688);
  --chart-5: oklch(0.845 0.263 138.77);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.994 0.003 133.622);
  --muted: oklch(0.197 0.007 133.838);
  --muted-foreground: oklch(0.813 0.031 133.846);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.994 0.003 133.622);
  --card: oklch(0.092 0 180);
  --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.835 0.259 138.588);
  --primary-foreground: oklch(0.261 0.074 136.182);
  --secondary: oklch(0.244 0.013 133.941);
  --secondary-foreground: oklch(0.793 0.022 133.783);
  --accent: oklch(0.244 0.013 133.941);
  --accent-foreground: oklch(0.793 0.022 133.783);
  --destructive: oklch(0.664 0.221 36.748);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.835 0.259 138.588);
  --chart-1: oklch(0.835 0.259 138.588);
  --chart-2: oklch(0.244 0.013 133.941);
  --chart-3: oklch(0.244 0.013 133.941);
  --chart-4: oklch(0.278 0.015 133.964);
  --chart-5: oklch(0.845 0.263 138.77);
}