Election for shadcn/ui

Election is a shadcn/ui theme built around a deep blue primary color (#152d65) with deep green accents (#2d6515). The light mode uses a neutral background (#fcfcfd). Dark mode keeps the deep blue primary (#152d65) on a neutral background (#010204).

Color palette

TokenLightDark
Background
#fcfcfdwhite
#010204black
Foreground
#040810black
#fcfcfdwhite
Card
#fcfcfdwhite
#010204black
Card foreground
#040810black
#fcfcfdwhite
Popover
#fcfcfdwhite
#010204black
Popover foreground
#040810black
#fcfcfdwhite
Primary
#152d65midnightblue
#152d65midnightblue
Primary foreground
#bcccf1lightblue
#bcccf1lightblue
Secondary
#65152dmaroon
#65152dmaroon
Secondary foreground
#f1bcccpink
#f1bcccpink
Muted
#f3edefwhitesmoke
#120c0eblack
Muted foreground
#5c5c5cdimgray
#a3a3a3darkgray
Accent
#2d6515forestgreen
#2d6515forestgreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#892706saddlebrown
#e13f09orangered
Destructive foreground
#fdd2c4peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#152d65midnightblue
#152d65midnightblue

Contrast

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

Light mode
Text on background19.55:1AAA
Text on card19.55:1AAA
Primary button8.15:1AAA
Secondary button7.52:1AAA
Muted text5.77:1AA
Accent7.03:1AAA
Destructive6.45:1AA
Dark mode
Text on background20.23:1AAA
Text on card20.23:1AAA
Primary button8.15:1AAA
Secondary button7.52:1AAA
Muted text7.65:1AAA
Accent7.03:1AAA
Destructive4.25:1AA Large

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.002 267.41);
  --foreground: oklch(0.134 0.02 261.322);
  --muted: oklch(0.95 0.007 356.86);
  --muted-foreground: oklch(0.474 0 198.435);
  --popover: oklch(0.991 0.002 267.41);
  --popover-foreground: oklch(0.134 0.02 261.322);
  --card: oklch(0.991 0.002 267.41);
  --card-foreground: oklch(0.134 0.02 261.322);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.315 0.103 263.96);
  --primary-foreground: oklch(0.844 0.055 266.921);
  --secondary: oklch(0.342 0.113 7.853);
  --secondary-foreground: oklch(0.846 0.064 358.754);
  --accent: oklch(0.452 0.125 138.19);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.423 0.139 36.329);
  --destructive-foreground: oklch(0.897 0.051 39.268);
  --ring: oklch(0.315 0.103 263.96);
  --chart-1: oklch(0.315 0.103 263.96);
  --chart-2: oklch(0.342 0.113 7.853);
  --chart-3: oklch(0.452 0.125 138.19);
  --chart-4: oklch(0.37 0.124 8.144);
  --chart-5: oklch(0.314 0.107 263.816);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.01 260.952);
  --foreground: oklch(0.992 0.001 267.414);
  --muted: oklch(0.165 0.011 358.438);
  --muted-foreground: oklch(0.716 0 165.964);
  --popover: oklch(0.085 0.01 260.952);
  --popover-foreground: oklch(0.992 0.001 267.414);
  --card: oklch(0.085 0.01 260.952);
  --card-foreground: oklch(0.992 0.001 267.414);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.315 0.103 263.96);
  --primary-foreground: oklch(0.844 0.055 266.921);
  --secondary: oklch(0.342 0.113 7.853);
  --secondary-foreground: oklch(0.846 0.064 358.754);
  --accent: oklch(0.452 0.125 138.19);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.605 0.206 35.49);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.315 0.103 263.96);
  --chart-1: oklch(0.315 0.103 263.96);
  --chart-2: oklch(0.342 0.113 7.853);
  --chart-3: oklch(0.452 0.125 138.19);
  --chart-4: oklch(0.37 0.124 8.144);
  --chart-5: oklch(0.314 0.107 263.816);
}