Center for shadcn/ui

Center is a shadcn/ui theme built around a deep green primary color (#157519) with deep purple accents (#751570). The light mode uses a neutral background (#fbfdfc). Dark mode keeps the deep green primary (#157519) on a neutral background (#020302).

Color palette

TokenLightDark
Background
#fbfdfcwhite
#020302black
Foreground
#000000black
#fcfdfcwhite
Card
#f8fcf8mintcream
#030703black
Card foreground
#000000black
#ffffffwhite
Popover
#f8fcf8mintcream
#030703black
Popover foreground
#000000black
#ffffffwhite
Primary
#157519forestgreen
#157519forestgreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#751570purple
#751570purple
Secondary foreground
#f5c7f3lavender
#f5c7f3lavender
Muted
#dbd7dagainsboro
#282428darkslategray
Muted foreground
#686468dimgray
#9b979bdarkgray
Accent
#751570purple
#751570purple
Accent foreground
#f5c7f3lavender
#f5c7f3lavender
Destructive
#962f03saddlebrown
#fb6b2dtomato
Destructive foreground
#fedccdbisque
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#157519forestgreen
#157519forestgreen

Contrast

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

Light mode
Text on background20.62:1AAA
Text on card20.25:1AAA
Primary button5.84:1AA
Secondary button6.84:1AA
Muted text4.07:1AA Large
Accent6.84:1AA
Destructive6.03:1AA
Dark mode
Text on background20.23:1AAA
Text on card20.27:1AAA
Primary button5.84:1AA
Secondary button6.84:1AA
Muted text5.29:1AA
Accent6.84:1AA
Destructive7.22:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.993 0.003 147.008);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.883 0.006 327.105);
  --muted-foreground: oklch(0.508 0.008 327.181);
  --popover: oklch(0.987 0.006 146.977);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.987 0.006 146.977);
  --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.491 0.152 143.329);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.402 0.164 330.418);
  --secondary-foreground: oklch(0.882 0.078 327.819);
  --accent: oklch(0.402 0.164 330.418);
  --accent-foreground: oklch(0.882 0.078 327.819);
  --destructive: oklch(0.456 0.145 38.587);
  --destructive-foreground: oklch(0.918 0.043 44.568);
  --ring: oklch(0.491 0.152 143.329);
  --chart-1: oklch(0.491 0.152 143.329);
  --chart-2: oklch(0.402 0.164 330.418);
  --chart-3: oklch(0.402 0.164 330.418);
  --chart-4: oklch(0.433 0.178 330.448);
  --chart-5: oklch(0.497 0.156 143.244);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.095 0.012 146.111);
  --foreground: oklch(0.993 0.003 147.012);
  --muted: oklch(0.267 0.009 327.333);
  --muted-foreground: oklch(0.681 0.007 327.137);
  --popover: oklch(0.12 0.015 146.111);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.12 0.015 146.111);
  --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.491 0.152 143.329);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.402 0.164 330.418);
  --secondary-foreground: oklch(0.882 0.078 327.819);
  --accent: oklch(0.402 0.164 330.418);
  --accent-foreground: oklch(0.882 0.078 327.819);
  --destructive: oklch(0.697 0.19 41.158);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.491 0.152 143.329);
  --chart-1: oklch(0.491 0.152 143.329);
  --chart-2: oklch(0.402 0.164 330.418);
  --chart-3: oklch(0.402 0.164 330.418);
  --chart-4: oklch(0.433 0.178 330.448);
  --chart-5: oklch(0.497 0.156 143.244);
}