Election for shadcn/ui

Election is a shadcn/ui theme built around a yellow primary color (#827926) with green accents (#5d8226). The light mode uses a neutral background (#fdfdf7). Dark mode keeps the yellow primary (#827926) on a neutral background (#070703).

Color palette

TokenLightDark
Background
#fdfdf7snow
#070703black
Foreground
#080702black
#ffffffwhite
Card
#fdfdf7snow
#070703black
Card foreground
#080702black
#ffffffwhite
Popover
#fdfdf7snow
#070703black
Popover foreground
#080702black
#ffffffwhite
Primary
#827926olivedrab
#827926olivedrab
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#824b26saddlebrown
#824b26saddlebrown
Secondary foreground
#f7ebe3linen
#f7ebe3linen
Muted
#ece1dagainsboro
#251a13black
Muted foreground
#66605cdimgray
#a39d99darkgray
Accent
#5d8226olivedrab
#5d8226olivedrab
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#862409saddlebrown
#db3b0forangered
Destructive foreground
#fbd1c6peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#827926olivedrab
#827926olivedrab

Contrast

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

Light mode
Text on background19.69:1AAA
Text on card19.69:1AAA
Primary button4.44:1AA Large
Secondary button6.00:1AA
Muted text4.82:1AA
Accent4.45:1AA Large
Destructive6.64:1AA
Dark mode
Text on background20.16:1AAA
Text on card20.16:1AAA
Primary button4.44:1AA Large
Secondary button6.00:1AA
Muted text6.32:1AA
Accent4.45:1AA Large
Destructive4.50:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.008 101.411);
  --foreground: oklch(0.128 0.016 104.31);
  --muted: oklch(0.917 0.016 56.196);
  --muted-foreground: oklch(0.493 0.01 56.164);
  --popover: oklch(0.991 0.008 101.411);
  --popover-foreground: oklch(0.128 0.016 104.31);
  --card: oklch(0.991 0.008 101.411);
  --card-foreground: oklch(0.128 0.016 104.31);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.569 0.103 102.906);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.471 0.091 52.337);
  --secondary-foreground: oklch(0.948 0.017 56.192);
  --accent: oklch(0.561 0.127 128.785);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.414 0.137 35.019);
  --destructive-foreground: oklch(0.894 0.05 35.953);
  --ring: oklch(0.569 0.103 102.906);
  --chart-1: oklch(0.569 0.103 102.906);
  --chart-2: oklch(0.471 0.091 52.337);
  --chart-3: oklch(0.561 0.127 128.785);
  --chart-4: oklch(0.5 0.098 52.254);
  --chart-5: oklch(0.576 0.106 102.856);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.014 104.03);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.23 0.022 55.01);
  --muted-foreground: oklch(0.7 0.009 56.26);
  --popover: oklch(0.127 0.014 104.03);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.127 0.014 104.03);
  --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.569 0.103 102.906);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.471 0.091 52.337);
  --secondary-foreground: oklch(0.948 0.017 56.192);
  --accent: oklch(0.561 0.127 128.785);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.591 0.203 34.505);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.569 0.103 102.906);
  --chart-1: oklch(0.569 0.103 102.906);
  --chart-2: oklch(0.471 0.091 52.337);
  --chart-3: oklch(0.561 0.127 128.785);
  --chart-4: oklch(0.5 0.098 52.254);
  --chart-5: oklch(0.576 0.106 102.856);
}