Element for shadcn/ui

Element is a shadcn/ui theme built around a vivid green primary color (#03a03a) with vivid pink accents (#a00369). The light mode uses a neutral background (#f8fbf9). Dark mode keeps the vivid green primary (#03a03a) on a neutral background (#010402).

Color palette

TokenLightDark
Background
#f8fbf9mintcream
#010402black
Foreground
#000000black
#f9fbfamintcream
Card
#f5faf7whitesmoke
#030704black
Card foreground
#000000black
#fcfdfcwhite
Popover
#f5faf7whitesmoke
#030704black
Popover foreground
#000000black
#fcfdfcwhite
Primary
#03a03aforestgreen
#03a03aforestgreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a00369purple
#a00369purple
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#f4f1f3whitesmoke
#0e0b0dblack
Muted foreground
#62505cdimgray
#af9da8darkgray
Accent
#a00369purple
#a00369purple
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#620a04maroon
#f52819orangered
Destructive foreground
#fba39dlightsalmon
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#03a03aforestgreen
#03a03aforestgreen

Contrast

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

Light mode
Text on background20.23:1AAA
Text on card19.85:1AAA
Primary button3.44:1AA Large
Secondary button7.74:1AAA
Muted text6.61:1AA
Accent7.74:1AAA
Destructive6.91:1AA
Dark mode
Text on background19.83:1AAA
Text on card19.84:1AAA
Primary button3.44:1AA Large
Secondary button7.74:1AAA
Muted text7.64:1AAA
Accent7.74:1AAA
Destructive4.03:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.987 0.004 157.894);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.96 0.005 338.083);
  --muted-foreground: oklch(0.455 0.03 339.288);
  --popover: oklch(0.98 0.006 157.847);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.98 0.006 157.847);
  --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.615 0.182 147.058);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.466 0.193 349.747);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.466 0.193 349.747);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.319 0.121 30.044);
  --destructive-foreground: oklch(0.802 0.105 24.135);
  --ring: oklch(0.615 0.182 147.058);
  --chart-1: oklch(0.615 0.182 147.058);
  --chart-2: oklch(0.466 0.193 349.747);
  --chart-3: oklch(0.466 0.193 349.747);
  --chart-4: oklch(0.498 0.206 349.908);
  --chart-5: oklch(0.622 0.185 146.849);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.097 0.012 157.751);
  --foreground: oklch(0.986 0.002 157.938);
  --muted: oklch(0.155 0.007 338.921);
  --muted-foreground: oklch(0.714 0.026 338.736);
  --popover: oklch(0.122 0.015 157.751);
  --popover-foreground: oklch(0.993 0.001 157.962);
  --card: oklch(0.122 0.015 157.751);
  --card-foreground: oklch(0.993 0.001 157.962);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.615 0.182 147.058);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.466 0.193 349.747);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.466 0.193 349.747);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.623 0.237 29.668);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.615 0.182 147.058);
  --chart-1: oklch(0.615 0.182 147.058);
  --chart-2: oklch(0.466 0.193 349.747);
  --chart-3: oklch(0.466 0.193 349.747);
  --chart-4: oklch(0.498 0.206 349.908);
  --chart-5: oklch(0.622 0.185 146.849);
}