Defensive for shadcn/ui

Defensive is a shadcn/ui theme built around a deep green primary color (#0d1109) with deep green accents (#091109). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep green primary (#0d1109) on a neutral background (#030302).

Color palette

TokenLightDark
Background
#ffffffwhite
#030302black
Foreground
#0d1505black
#fcfdfcwhite
Card
#ffffffwhite
#030302black
Card foreground
#0d1505black
#fcfdfcwhite
Popover
#ffffffwhite
#030302black
Popover foreground
#0d1505black
#fcfdfcwhite
Primary
#0d1109black
#0d1109black
Primary foreground
#a8c18adarkseagreen
#a8c18adarkseagreen
Secondary
#111009black
#111009black
Secondary foreground
#96944fgray
#96944fgray
Muted
#ebead6antiquewhite
#292814black
Muted foreground
#5a5a53dimgray
#acaca5darkgray
Accent
#091109black
#091109black
Accent foreground
#8cc18adarkseagreen
#8cc18adarkseagreen
Destructive
#6a0301maroon
#e30602red
Destructive foreground
#fea19flightsalmon
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0d1109black
#0d1109black

Contrast

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

Light mode
Text on background18.64:1AAA
Text on card18.64:1AAA
Primary button9.69:1AAA
Secondary button6.02:1AA
Muted text5.71:1AA
Accent9.24:1AAA
Destructive6.65:1AA
Dark mode
Text on background20.20:1AAA
Text on card20.20:1AAA
Primary button9.69:1AAA
Secondary button6.02:1AA
Muted text6.51:1AA
Accent9.24:1AAA
Destructive4.88:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.181 0.033 128.795);
  --muted: oklch(0.933 0.027 105.297);
  --muted-foreground: oklch(0.465 0.011 105.2);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.181 0.033 128.795);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.181 0.033 128.795);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.169 0.017 128.323);
  --primary-foreground: oklch(0.779 0.081 128.467);
  --secondary: oklch(0.173 0.015 106.222);
  --secondary-foreground: oklch(0.653 0.091 106.919);
  --accent: oklch(0.165 0.02 143.742);
  --accent-foreground: oklch(0.76 0.096 143.765);
  --destructive: oklch(0.331 0.133 29.421);
  --destructive-foreground: oklch(0.801 0.112 20.889);
  --ring: oklch(0.169 0.017 128.323);
  --chart-1: oklch(0.169 0.017 128.323);
  --chart-2: oklch(0.173 0.015 106.222);
  --chart-3: oklch(0.165 0.02 143.742);
  --chart-4: oklch(0.216 0.022 106.446);
  --chart-5: oklch(0.17 0.019 128.39);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.098 0.01 126.436);
  --foreground: oklch(0.993 0.001 127.129);
  --muted: oklch(0.273 0.034 106.723);
  --muted-foreground: oklch(0.741 0.009 105.03);
  --popover: oklch(0.098 0.01 126.436);
  --popover-foreground: oklch(0.993 0.001 127.129);
  --card: oklch(0.098 0.01 126.436);
  --card-foreground: oklch(0.993 0.001 127.129);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.169 0.017 128.323);
  --primary-foreground: oklch(0.779 0.081 128.467);
  --secondary: oklch(0.173 0.015 106.222);
  --secondary-foreground: oklch(0.653 0.091 106.919);
  --accent: oklch(0.165 0.02 143.742);
  --accent-foreground: oklch(0.76 0.096 143.765);
  --destructive: oklch(0.577 0.235 29.308);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.169 0.017 128.323);
  --chart-1: oklch(0.169 0.017 128.323);
  --chart-2: oklch(0.173 0.015 106.222);
  --chart-3: oklch(0.165 0.02 143.742);
  --chart-4: oklch(0.216 0.022 106.446);
  --chart-5: oklch(0.17 0.019 128.39);
}