Voting for shadcn/ui

Voting is a shadcn/ui theme built around a deep blue primary color (#06121d) with deep green accents (#121d06). The light mode uses a neutral background (#f8fafc). Dark mode keeps the deep blue primary (#06121d) on a blue-tinted background (#070a0e).

Color palette

TokenLightDark
Background
#f8fafcghostwhite
#070a0eblack
Foreground
#010304black
#fcfcfdwhite
Card
#f5f7fawhitesmoke
#090d11black
Card foreground
#000000black
#ffffffwhite
Popover
#f8fafcghostwhite
#070a0eblack
Popover foreground
#010304black
#fcfcfdwhite
Primary
#06121dblack
#06121dblack
Primary foreground
#74abe2cornflowerblue
#74abe2cornflowerblue
Secondary
#1d0612black
#1d0612black
Secondary foreground
#e274abpalevioletred
#e274abpalevioletred
Muted
#f5f0f2whitesmoke
#0f0a0dblack
Muted foreground
#443b40darkslategray
#c4bbbfsilver
Accent
#121d06black
#121d06black
Accent foreground
#78c62ayellowgreen
#78c62ayellowgreen
Destructive
#9c0502darkred
#fb1c18red
Destructive foreground
#fed3d2pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#06121dblack
#06121dblack

Contrast

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

Light mode
Text on background19.74:1AAA
Text on card19.60:1AAA
Primary button7.79:1AAA
Secondary button6.71:1AA
Muted text9.56:1AAA
Accent8.20:1AAA
Destructive6.36:1AA
Dark mode
Text on background19.33:1AAA
Text on card19.52:1AAA
Primary button7.79:1AAA
Secondary button6.71:1AA
Muted text10.46:1AAA
Accent8.20:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.984 0.003 247.851);
  --foreground: oklch(0.089 0.01 239.894);
  --muted: oklch(0.959 0.006 345.309);
  --muted-foreground: oklch(0.364 0.014 346.146);
  --popover: oklch(0.984 0.003 247.851);
  --popover-foreground: oklch(0.089 0.01 239.894);
  --card: oklch(0.976 0.004 247.866);
  --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.177 0.03 248.868);
  --primary-foreground: oklch(0.724 0.099 249.33);
  --secondary: oklch(0.171 0.045 351.144);
  --secondary-foreground: oklch(0.7 0.149 350.338);
  --accent: oklch(0.215 0.045 131.134);
  --accent-foreground: oklch(0.747 0.196 133.275);
  --destructive: oklch(0.436 0.176 29.293);
  --destructive-foreground: oklch(0.903 0.049 19.251);
  --ring: oklch(0.177 0.03 248.868);
  --chart-1: oklch(0.177 0.03 248.868);
  --chart-2: oklch(0.171 0.045 351.144);
  --chart-3: oklch(0.215 0.045 131.134);
  --chart-4: oklch(0.204 0.059 352.59);
  --chart-5: oklch(0.177 0.031 248.751);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.143 0.01 245.811);
  --foreground: oklch(0.992 0.001 247.834);
  --muted: oklch(0.154 0.01 346.723);
  --muted-foreground: oklch(0.8 0.012 345.524);
  --popover: oklch(0.143 0.01 245.811);
  --popover-foreground: oklch(0.992 0.001 247.834);
  --card: oklch(0.155 0.011 248.155);
  --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.177 0.03 248.868);
  --primary-foreground: oklch(0.724 0.099 249.33);
  --secondary: oklch(0.171 0.045 351.144);
  --secondary-foreground: oklch(0.7 0.149 350.338);
  --accent: oklch(0.215 0.045 131.134);
  --accent-foreground: oklch(0.747 0.196 133.275);
  --destructive: oklch(0.629 0.248 28.748);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.177 0.03 248.868);
  --chart-1: oklch(0.177 0.03 248.868);
  --chart-2: oklch(0.171 0.045 351.144);
  --chart-3: oklch(0.215 0.045 131.134);
  --chart-4: oklch(0.204 0.059 352.59);
  --chart-5: oklch(0.177 0.031 248.751);
}