Voting for shadcn/ui

Voting is a shadcn/ui theme built around a light green primary color (#e8fae6) with light red accents (#fae6e8). The light mode uses a neutral background (#f7fdf7). Dark mode keeps the light green primary (#e8fae6) on a green-tinted background (#040c04).

Color palette

TokenLightDark
Background
#f7fdf7mintcream
#040c04black
Foreground
#061604black
#f9fbf9mintcream
Card
#f4fcf3honeydew
#061005black
Card foreground
#041103black
#fcfdfcwhite
Popover
#f4fcf3honeydew
#061005black
Popover foreground
#041103black
#fcfdfcwhite
Primary
#e8fae6honeydew
#e8fae6honeydew
Primary foreground
#113b0cdarkgreen
#113b0cdarkgreen
Secondary
#e6e8falavender
#e6e8falavender
Secondary foreground
#1e2a8fmidnightblue
#1e2a8fmidnightblue
Muted
#e4e4e7gainsboro
#18181bblack
Muted foreground
#434556darkslategray
#a9abbcdarkgray
Accent
#fae6e8mistyrose
#fae6e8mistyrose
Accent foreground
#8f1e2abrown
#8f1e2abrown
Destructive
#a72d0cfirebrick
#f15b32tomato
Destructive foreground
#fdece7linen
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#e8fae6honeydew
#e8fae6honeydew

Contrast

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

Light mode
Text on background18.11:1AAA
Text on card18.45:1AAA
Primary button11.59:1AAA
Secondary button9.67:1AAA
Muted text7.46:1AAA
Accent7.33:1AAA
Destructive6.05:1AA
Dark mode
Text on background19.08:1AAA
Text on card19.05:1AAA
Primary button11.59:1AAA
Secondary button9.67:1AAA
Muted text7.76:1AAA
Accent7.33:1AAA
Destructive6.28:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.01 142.585);
  --foreground: oklch(0.178 0.044 140.891);
  --muted: oklch(0.921 0.003 281.233);
  --muted-foreground: oklch(0.394 0.03 279.937);
  --popover: oklch(0.982 0.015 142.563);
  --popover-foreground: oklch(0.161 0.039 140.683);
  --card: oklch(0.982 0.015 142.563);
  --card-foreground: oklch(0.161 0.039 140.683);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.965 0.032 142.49);
  --primary-foreground: oklch(0.311 0.087 141.68);
  --secondary: oklch(0.934 0.024 280.857);
  --secondary-foreground: oklch(0.352 0.165 269.981);
  --accent: oklch(0.941 0.022 10.607);
  --accent-foreground: oklch(0.429 0.147 21.118);
  --destructive: oklch(0.485 0.163 34.772);
  --destructive-foreground: oklch(0.955 0.02 35.957);
  --ring: oklch(0.965 0.032 142.49);
  --chart-1: oklch(0.965 0.032 142.49);
  --chart-2: oklch(0.934 0.024 280.857);
  --chart-3: oklch(0.941 0.022 10.607);
  --chart-4: oklch(0.967 0.012 281.085);
  --chart-5: oklch(0.966 0.034 142.484);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.14 0.024 141.051);
  --foreground: oklch(0.986 0.004 142.609);
  --muted: oklch(0.212 0.004 280.938);
  --muted-foreground: oklch(0.744 0.026 280.709);
  --popover: oklch(0.157 0.028 141.209);
  --popover-foreground: oklch(0.993 0.002 142.618);
  --card: oklch(0.157 0.028 141.209);
  --card-foreground: oklch(0.993 0.002 142.618);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.965 0.032 142.49);
  --primary-foreground: oklch(0.311 0.087 141.68);
  --secondary: oklch(0.934 0.024 280.857);
  --secondary-foreground: oklch(0.352 0.165 269.981);
  --accent: oklch(0.941 0.022 10.607);
  --accent-foreground: oklch(0.429 0.147 21.118);
  --destructive: oklch(0.663 0.192 35.98);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.965 0.032 142.49);
  --chart-1: oklch(0.965 0.032 142.49);
  --chart-2: oklch(0.934 0.024 280.857);
  --chart-3: oklch(0.941 0.022 10.607);
  --chart-4: oklch(0.967 0.012 281.085);
  --chart-5: oklch(0.966 0.034 142.484);
}