Defense for shadcn/ui

Defense is a shadcn/ui theme built around a muted deep green primary color (#141a0f) with muted light green accents (#c4cdbc). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep green primary (#141a0f) on a neutral background (#050802).

Color palette

TokenLightDark
Background
#ffffffwhite
#050802black
Foreground
#050901black
#ffffffwhite
Card
#fcfcfcsnow
#070c03black
Card foreground
#020401black
#ffffffwhite
Popover
#fcfcfcsnow
#070c03black
Popover foreground
#020401black
#ffffffwhite
Primary
#141a0fblack
#141a0fblack
Primary foreground
#acc397darkseagreen
#acc397darkseagreen
Secondary
#d9dcd6gainsboro
#242523darkslategray
Secondary foreground
#3f453bdarkslategray
#bdbfbbsilver
Muted
#e5ebe0gainsboro
#191f14black
Muted foreground
#606f52dimgray
#9dad90darkseagreen
Accent
#c4cdbcsilver
#383e32darkslategray
Accent foreground
#2b3125darkslategray
#d1d6cdlightgrey
Destructive
#8d3607saddlebrown
#f45d0borangered
Destructive foreground
#fcdbc9bisque
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#141a0fblack
#141a0fblack

Contrast

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

Light mode
Text on background20.07:1AAA
Text on card20.13:1AAA
Primary button9.29:1AAA
Secondary button7.11:1AAA
Muted text4.44:1AA Large
Accent8.13:1AAA
Destructive6.05:1AA
Dark mode
Text on background20.14:1AAA
Text on card19.73:1AAA
Primary button9.29:1AAA
Secondary button8.33:1AAA
Muted text7.05:1AAA
Accent7.49:1AAA
Destructive6.38:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.129 0.025 128.242);
  --muted: oklch(0.933 0.016 129.96);
  --muted-foreground: oklch(0.522 0.048 130.759);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.102 0.02 128.242);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.102 0.02 128.242);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.207 0.023 130.972);
  --primary-foreground: oklch(0.789 0.066 130.66);
  --secondary: oklch(0.89 0.009 129.886);
  --secondary-foreground: oklch(0.381 0.018 130.277);
  --accent: oklch(0.836 0.024 130.08);
  --accent-foreground: oklch(0.304 0.023 130.574);
  --destructive: oklch(0.45 0.13 42.657);
  --destructive-foreground: oklch(0.915 0.044 50.079);
  --ring: oklch(0.207 0.023 130.972);
  --chart-1: oklch(0.207 0.023 130.972);
  --chart-2: oklch(0.89 0.009 129.886);
  --chart-3: oklch(0.836 0.024 130.08);
  --chart-4: oklch(0.912 0.007 129.863);
  --chart-5: oklch(0.209 0.025 131.103);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.021 128.475);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.23 0.023 130.839);
  --muted-foreground: oklch(0.726 0.044 130.417);
  --popover: oklch(0.146 0.024 128.71);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.146 0.024 128.71);
  --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.207 0.023 130.972);
  --primary-foreground: oklch(0.789 0.066 130.66);
  --secondary: oklch(0.262 0.004 129.948);
  --secondary-foreground: oklch(0.801 0.006 129.86);
  --accent: oklch(0.353 0.021 130.384);
  --accent-foreground: oklch(0.869 0.014 129.941);
  --destructive: oklch(0.667 0.2 41.451);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.207 0.023 130.972);
  --chart-1: oklch(0.207 0.023 130.972);
  --chart-2: oklch(0.262 0.004 129.948);
  --chart-3: oklch(0.353 0.021 130.384);
  --chart-4: oklch(0.293 0.005 129.957);
  --chart-5: oklch(0.209 0.025 131.103);
}