Sanction for shadcn/ui

Sanction is a shadcn/ui theme built around a vivid green primary color (#5e990a) with vivid violet accents (#460a99). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid green primary (#5e990a) on a neutral background (#030401).

Color palette

TokenLightDark
Background
#ffffffwhite
#030401black
Foreground
#0e1306black
#fafcf8snow
Card
#ffffffwhite
#030401black
Card foreground
#0e1306black
#fafcf8snow
Popover
#ffffffwhite
#030401black
Popover foreground
#0e1306black
#fafcf8snow
Primary
#5e990aolivedrab
#5e990aolivedrab
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#460a99indigo
#460a99indigo
Secondary foreground
#e8d9fdlavender
#e8d9fdlavender
Muted
#e7e2eelavender
#16111dblack
Muted foreground
#3f3946darkslategray
#beb9c6silver
Accent
#460a99indigo
#460a99indigo
Accent foreground
#e8d9fdlavender
#e8d9fdlavender
Destructive
#c4260efirebrick
#d72a0ffirebrick
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5e990aolivedrab
#5e990aolivedrab

Contrast

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

Light mode
Text on background18.84:1AAA
Text on card18.84:1AAA
Primary button3.46:1AA Large
Secondary button8.94:1AAA
Muted text8.75:1AAA
Accent8.94:1AAA
Destructive5.80:1AA
Dark mode
Text on background19.91:1AAA
Text on card19.91:1AAA
Primary button3.46:1AA Large
Secondary button8.94:1AAA
Muted text9.68:1AAA
Accent8.94:1AAA
Destructive4.99:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.178 0.028 126.854);
  --muted: oklch(0.92 0.017 304.782);
  --muted-foreground: oklch(0.356 0.023 304.16);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.178 0.028 126.854);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.178 0.028 126.854);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.619 0.169 131.947);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.362 0.196 290.9);
  --secondary-foreground: oklch(0.907 0.051 304.27);
  --accent: oklch(0.362 0.196 290.9);
  --accent-foreground: oklch(0.907 0.051 304.27);
  --destructive: oklch(0.531 0.196 31.441);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.619 0.169 131.947);
  --chart-1: oklch(0.619 0.169 131.947);
  --chart-2: oklch(0.362 0.196 290.9);
  --chart-3: oklch(0.362 0.196 290.9);
  --chart-4: oklch(0.386 0.21 290.633);
  --chart-5: oklch(0.626 0.172 132.169);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.015 124.266);
  --foreground: oklch(0.988 0.005 125.112);
  --muted: oklch(0.189 0.026 303.123);
  --muted-foreground: oklch(0.794 0.019 304.72);
  --popover: oklch(0.101 0.015 124.266);
  --popover-foreground: oklch(0.988 0.005 125.112);
  --card: oklch(0.101 0.015 124.266);
  --card-foreground: oklch(0.988 0.005 125.112);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.619 0.169 131.947);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.362 0.196 290.9);
  --secondary-foreground: oklch(0.907 0.051 304.27);
  --accent: oklch(0.362 0.196 290.9);
  --accent-foreground: oklch(0.907 0.051 304.27);
  --destructive: oklch(0.568 0.21 31.409);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.619 0.169 131.947);
  --chart-1: oklch(0.619 0.169 131.947);
  --chart-2: oklch(0.362 0.196 290.9);
  --chart-3: oklch(0.362 0.196 290.9);
  --chart-4: oklch(0.386 0.21 290.633);
  --chart-5: oklch(0.626 0.172 132.169);
}