Elastic for shadcn/ui

Elastic is a shadcn/ui theme built around a deep green primary color (#192a14) with deep violet accents (#24142a). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep green primary (#192a14) on a green-tinted background (#090d07).

Color palette

TokenLightDark
Background
#ffffffwhite
#090d07black
Foreground
#000000black
#fcfdfcwhite
Card
#fcfcfcsnow
#0b1109black
Card foreground
#000000black
#ffffffwhite
Popover
#ffffffwhite
#090d07black
Popover foreground
#000000black
#fcfdfcwhite
Primary
#192a14black
#192a14black
Primary foreground
#acd19edarkseagreen
#acd19edarkseagreen
Secondary
#24142ablack
#24142ablack
Secondary foreground
#c49ed1plum
#c49ed1plum
Muted
#f3f0f4whitesmoke
#0e0b0fblack
Muted foreground
#675c6adimgray
#9f95a3darkgray
Accent
#24142ablack
#24142ablack
Accent foreground
#c49ed1plum
#c49ed1plum
Destructive
#80140amaroon
#e82311orangered
Destructive foreground
#fac6c1pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#192a14black
#192a14black

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button8.97:1AAA
Secondary button7.60:1AAA
Muted text5.61:1AA
Accent7.60:1AAA
Destructive6.88:1AA
Dark mode
Text on background19.17:1AAA
Text on card19.15:1AAA
Primary button8.97:1AAA
Secondary button7.60:1AAA
Muted text6.81:1AA
Accent7.60:1AAA
Destructive4.46:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.959 0.006 317.174);
  --muted-foreground: oklch(0.491 0.025 317.073);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --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.262 0.045 137.76);
  --primary-foreground: oklch(0.821 0.081 137.453);
  --secondary: oklch(0.222 0.047 316.618);
  --secondary-foreground: oklch(0.75 0.083 316.93);
  --accent: oklch(0.222 0.047 316.618);
  --accent-foreground: oklch(0.75 0.083 316.93);
  --destructive: oklch(0.388 0.144 30.032);
  --destructive-foreground: oklch(0.872 0.06 24.391);
  --ring: oklch(0.262 0.045 137.76);
  --chart-1: oklch(0.262 0.045 137.76);
  --chart-2: oklch(0.222 0.047 316.618);
  --chart-3: oklch(0.222 0.047 316.618);
  --chart-4: oklch(0.252 0.057 316.563);
  --chart-5: oklch(0.265 0.048 137.824);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.153 0.016 136.657);
  --foreground: oklch(0.993 0.002 137.194);
  --muted: oklch(0.154 0.01 317.043);
  --muted-foreground: oklch(0.682 0.023 317.112);
  --popover: oklch(0.153 0.016 136.657);
  --popover-foreground: oklch(0.993 0.002 137.194);
  --card: oklch(0.167 0.019 137.374);
  --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.262 0.045 137.76);
  --primary-foreground: oklch(0.821 0.081 137.453);
  --secondary: oklch(0.222 0.047 316.618);
  --secondary-foreground: oklch(0.75 0.083 316.93);
  --accent: oklch(0.222 0.047 316.618);
  --accent-foreground: oklch(0.75 0.083 316.93);
  --destructive: oklch(0.597 0.229 30.093);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.262 0.045 137.76);
  --chart-1: oklch(0.262 0.045 137.76);
  --chart-2: oklch(0.222 0.047 316.618);
  --chart-3: oklch(0.222 0.047 316.618);
  --chart-4: oklch(0.252 0.057 316.563);
  --chart-5: oklch(0.265 0.048 137.824);
}