Cation for shadcn/ui

Cation is a shadcn/ui theme built around a near-white primary color (#ffffff) with near-white accents (#ffffff). The light mode uses a neutral background (#fdfcfc). Dark mode keeps the near-white primary (#ffffff) on a red-tinted background (#0f0606).

Color palette

TokenLightDark
Background
#fdfcfcsnow
#0f0606black
Foreground
#120303black
#fcf8f8snow
Card
#fcf8f8snow
#130707black
Card foreground
#0d0202black
#fdfcfcsnow
Popover
#fcf8f8snow
#130707black
Popover foreground
#0d0202black
#fdfcfcsnow
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#ffffffwhite
#ffffffwhite
Secondary foreground
#333333darkslategray
#333333darkslategray
Muted
#e9e2e2gainsboro
#1d1616black
Muted foreground
#4b4444darkslategray
#bbb4b4silver
Accent
#ffffffwhite
#ffffffwhite
Accent foreground
#333333darkslategray
#333333darkslategray
Destructive
#e24a03orangered
#e74c04orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background19.66:1AAA
Text on card19.40:1AAA
Primary button12.63:1AAA
Secondary button12.63:1AAA
Muted text7.44:1AAA
Accent12.63:1AAA
Destructive4.02:1AA Large
Dark mode
Text on background19.03:1AAA
Text on card19.34:1AAA
Primary button12.63:1AAA
Secondary button12.63:1AAA
Muted text8.73:1AAA
Accent12.63:1AAA
Destructive3.87: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.991 0.002 17.191);
  --foreground: oklch(0.128 0.033 22.96);
  --muted: oklch(0.919 0.007 17.288);
  --muted-foreground: oklch(0.393 0.01 17.574);
  --popover: oklch(0.982 0.004 17.224);
  --popover-foreground: oklch(0.114 0.029 22.711);
  --card: oklch(0.982 0.004 17.224);
  --card-foreground: oklch(0.114 0.029 22.711);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(1 0 180);
  --secondary-foreground: oklch(0.321 0 180);
  --accent: oklch(1 0 180);
  --accent-foreground: oklch(0.321 0 180);
  --destructive: oklch(0.617 0.199 38.45);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(1 0 180);
  --chart-3: oklch(1 0 180);
  --chart-4: oklch(1.023 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.135 0.019 19.854);
  --foreground: oklch(0.982 0.003 17.217);
  --muted: oklch(0.209 0.011 18.046);
  --muted-foreground: oklch(0.776 0.008 17.332);
  --popover: oklch(0.147 0.022 20.071);
  --popover-foreground: oklch(0.991 0.002 17.187);
  --card: oklch(0.147 0.022 20.071);
  --card-foreground: oklch(0.991 0.002 17.187);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(1 0 180);
  --secondary-foreground: oklch(0.321 0 180);
  --accent: oklch(1 0 180);
  --accent-foreground: oklch(0.321 0 180);
  --destructive: oklch(0.627 0.202 38.404);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(1 0 180);
  --chart-3: oklch(1 0 180);
  --chart-4: oklch(1.023 0 180);
  --chart-5: oklch(1 0 180);
}