Legislation for shadcn/ui

Legislation is a shadcn/ui theme built around a vivid deep green primary color (#5b7209) with muted light green accents (#d8dec4). The light mode uses a neutral background (#fbfcf8). Dark mode keeps the vivid deep green primary (#5b7209) on a neutral background (#030401).

Color palette

TokenLightDark
Background
#fbfcf8snow
#030401black
Foreground
#000000black
#f8f9f6whitesmoke
Card
#fbfcf8snow
#030401black
Card foreground
#000000black
#f8f9f6whitesmoke
Popover
#fbfcf8snow
#030401black
Popover foreground
#000000black
#f8f9f6whitesmoke
Primary
#5b7209darkolivegreen
#5b7209darkolivegreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#e8ebe0beige
#24261cblack
Secondary foreground
#1c1f14black
#c0c4b0silver
Muted
#edf1e0beige
#1c1f0eblack
Muted foreground
#484847darkslategray
#b8b8b7silver
Accent
#d8dec4lightgrey
#373d24darkslategray
Accent foreground
#414828darkolivegreen
#d1d7bclightgrey
Destructive
#c14015firebrick
#cf4517chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5b7209darkolivegreen
#5b7209darkolivegreen

Contrast

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

Light mode
Text on background20.36:1AAA
Text on card20.36:1AAA
Primary button5.45:1AA
Secondary button13.82:1AAA
Muted text7.93:1AAA
Accent6.95:1AA
Destructive5.23:1AA
Dark mode
Text on background19.46:1AAA
Text on card19.46:1AAA
Primary button5.45:1AA
Secondary button8.58:1AAA
Muted text8.42:1AAA
Accent7.65:1AAA
Destructive4.66:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.005 116.425);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.949 0.023 116.767);
  --muted-foreground: oklch(0.401 0.002 116.438);
  --popover: oklch(0.989 0.005 116.425);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.989 0.005 116.425);
  --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.515 0.122 122.63);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.934 0.014 116.598);
  --secondary-foreground: oklch(0.232 0.019 117.842);
  --accent: oklch(0.889 0.035 117.044);
  --accent-foreground: oklch(0.386 0.05 118.788);
  --destructive: oklch(0.551 0.172 36.992);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.515 0.122 122.63);
  --chart-1: oklch(0.515 0.122 122.63);
  --chart-2: oklch(0.934 0.014 116.598);
  --chart-3: oklch(0.889 0.035 117.044);
  --chart-4: oklch(0.954 0.01 116.513);
  --chart-5: oklch(0.52 0.125 122.801);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.012 116.704);
  --foreground: oklch(0.981 0.004 116.41);
  --muted: oklch(0.232 0.031 118.841);
  --muted-foreground: oklch(0.783 0.002 116.377);
  --popover: oklch(0.101 0.012 116.704);
  --popover-foreground: oklch(0.981 0.004 116.41);
  --card: oklch(0.101 0.012 116.704);
  --card-foreground: oklch(0.981 0.004 116.41);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.515 0.122 122.63);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.263 0.018 117.587);
  --secondary-foreground: oklch(0.813 0.029 116.973);
  --accent: oklch(0.346 0.04 118.5);
  --accent-foreground: oklch(0.867 0.037 117.098);
  --destructive: oklch(0.579 0.182 36.927);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.515 0.122 122.63);
  --chart-1: oklch(0.515 0.122 122.63);
  --chart-2: oklch(0.263 0.018 117.587);
  --chart-3: oklch(0.346 0.04 118.5);
  --chart-4: oklch(0.298 0.022 117.655);
  --chart-5: oklch(0.52 0.125 122.801);
}