Badger for shadcn/ui

Badger is a shadcn/ui theme built around a violet primary color (#5f3ea3) with purple accents (#923ea3). The light mode uses a neutral background (#fcfcfd). Dark mode keeps the violet primary (#5f3ea3) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fcfcfdwhite
#000000black
Foreground
#000000black
#ffffffwhite
Card
#fcfcfdwhite
#000000black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfdwhite
#000000black
Popover foreground
#000000black
#ffffffwhite
Primary
#5f3ea3rebeccapurple
#5f3ea3rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#3e4fa3darkslateblue
#3e4fa3darkslateblue
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#d8dbe9gainsboro
#161927black
Muted foreground
#3c3f4edarkslategray
#b1b4c3silver
Accent
#923ea3darkorchid
#923ea3darkorchid
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#9f3f0fsaddlebrown
#d75514chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5f3ea3rebeccapurple
#5f3ea3rebeccapurple

Contrast

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

Light mode
Text on background20.44:1AAA
Text on card20.44:1AAA
Primary button7.77:1AAA
Secondary button7.40:1AAA
Muted text7.54:1AAA
Accent6.12:1AA
Destructive6.60:1AA
Dark mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button7.77:1AAA
Secondary button7.40:1AAA
Muted text8.47:1AAA
Accent6.12:1AA
Destructive4.05:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.002 301.458);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.893 0.02 276.946);
  --muted-foreground: oklch(0.37 0.026 276.188);
  --popover: oklch(0.991 0.002 301.458);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.991 0.002 301.458);
  --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.456 0.156 294.804);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.459 0.137 271.516);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.517 0.171 320.642);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.492 0.139 42.337);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.456 0.156 294.804);
  --chart-1: oklch(0.456 0.156 294.804);
  --chart-2: oklch(0.459 0.137 271.516);
  --chart-3: oklch(0.517 0.171 320.642);
  --chart-4: oklch(0.48 0.144 271.46);
  --chart-5: oklch(0.452 0.165 294.165);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.217 0.028 275.09);
  --muted-foreground: oklch(0.773 0.021 276.863);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0 0 0);
  --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.456 0.156 294.804);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.459 0.137 271.516);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.517 0.171 320.642);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.612 0.177 41.837);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.456 0.156 294.804);
  --chart-1: oklch(0.456 0.156 294.804);
  --chart-2: oklch(0.459 0.137 271.516);
  --chart-3: oklch(0.517 0.171 320.642);
  --chart-4: oklch(0.48 0.144 271.46);
  --chart-5: oklch(0.452 0.165 294.165);
}