Trooper for shadcn/ui

Trooper is a shadcn/ui theme built around an indigo primary color (#7c65c8) with green accents (#b1c865). The light mode uses a neutral background (#ffffff). Dark mode keeps the indigo primary (#7c65c8) on an indigo-tinted background (#05030c).

Color palette

TokenLightDark
Background
#ffffffwhite
#05030cblack
Foreground
#000000black
#fcfcfdwhite
Card
#ffffffwhite
#05030cblack
Card foreground
#000000black
#fcfcfdwhite
Popover
#ffffffwhite
#05030cblack
Popover foreground
#000000black
#fcfcfdwhite
Primary
#7c65c8slateblue
#7c65c8slateblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#b1c865darkkhaki
#b1c865darkkhaki
Secondary foreground
#000000black
#000000black
Muted
#eff0ealinen
#13150fblack
Muted foreground
#56594adarkolivegreen
#b1b5a6darkgray
Accent
#b1c865darkkhaki
#b1c865darkkhaki
Accent foreground
#000000black
#000000black
Destructive
#651c0bmaroon
#e95a3atomato
Destructive foreground
#f6baaclightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#7c65c8slateblue
#7c65c8slateblue

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button4.60:1AA
Secondary button11.27:1AAA
Muted text6.27:1AA
Accent11.27:1AAA
Destructive7.28:1AAA
Dark mode
Text on background19.97:1AAA
Text on card19.97:1AAA
Primary button4.60:1AA
Secondary button11.27:1AAA
Muted text8.78:1AAA
Accent11.27:1AAA
Destructive5.98:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.953 0.008 117.233);
  --muted-foreground: oklch(0.456 0.024 118.01);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(1 0 180);
  --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.576 0.147 291.864);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.793 0.127 120.223);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.793 0.127 120.223);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.343 0.108 33.956);
  --destructive-foreground: oklch(0.84 0.072 32.944);
  --ring: oklch(0.576 0.147 291.864);
  --chart-1: oklch(0.576 0.147 291.864);
  --chart-2: oklch(0.793 0.127 120.223);
  --chart-3: oklch(0.793 0.127 120.223);
  --chart-4: oklch(0.808 0.119 119.914);
  --chart-5: oklch(0.571 0.156 291.413);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.111 0.026 296.248);
  --foreground: oklch(0.992 0.001 297.058);
  --muted: oklch(0.191 0.012 118.217);
  --muted-foreground: oklch(0.765 0.021 117.568);
  --popover: oklch(0.111 0.026 296.248);
  --popover-foreground: oklch(0.992 0.001 297.058);
  --card: oklch(0.111 0.026 296.248);
  --card-foreground: oklch(0.992 0.001 297.058);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.576 0.147 291.864);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.793 0.127 120.223);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.793 0.127 120.223);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.65 0.184 34.148);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.576 0.147 291.864);
  --chart-1: oklch(0.576 0.147 291.864);
  --chart-2: oklch(0.793 0.127 120.223);
  --chart-3: oklch(0.793 0.127 120.223);
  --chart-4: oklch(0.808 0.119 119.914);
  --chart-5: oklch(0.571 0.156 291.413);
}