Mainstream for shadcn/ui

Mainstream is a shadcn/ui theme built around a muted deep green primary color (#485143) with muted deep pink accents (#514348). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep green primary (#485143) on a neutral background (#020401).

Color palette

TokenLightDark
Background
#ffffffwhite
#020401black
Foreground
#081103black
#ffffffwhite
Card
#ffffffwhite
#020401black
Card foreground
#081103black
#ffffffwhite
Popover
#ffffffwhite
#020401black
Popover foreground
#081103black
#ffffffwhite
Primary
#485143darkslategray
#485143darkslategray
Primary foreground
#e2e5e0gainsboro
#e2e5e0gainsboro
Secondary
#434851darkslategray
#434851darkslategray
Secondary foreground
#e0e2e5gainsboro
#e0e2e5gainsboro
Muted
#e0e4eblavender
#14181fblack
Muted foreground
#5d6269dimgray
#969aa2darkgray
Accent
#514348darkslategray
#514348darkslategray
Accent foreground
#e5e0e2gainsboro
#e5e0e2gainsboro
Destructive
#b74a0bsienna
#f27126chocolate
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#485143darkslategray
#485143darkslategray

Contrast

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

Light mode
Text on background19.23:1AAA
Text on card19.23:1AAA
Primary button6.54:1AA
Secondary button7.06:1AAA
Muted text4.82:1AA
Accent7.15:1AAA
Destructive5.25:1AA
Dark mode
Text on background20.59:1AAA
Text on card20.59:1AAA
Primary button6.54:1AA
Secondary button7.06:1AAA
Muted text6.29:1AA
Accent7.15:1AAA
Destructive7.17:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.164 0.033 132.974);
  --muted: oklch(0.918 0.01 261.509);
  --muted-foreground: oklch(0.494 0.013 261.485);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.164 0.033 132.974);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.164 0.033 132.974);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.422 0.024 133.976);
  --primary-foreground: oklch(0.919 0.008 133.657);
  --secondary: oklch(0.401 0.016 261.457);
  --secondary-foreground: oklch(0.913 0.005 261.513);
  --accent: oklch(0.399 0.02 353.949);
  --accent-foreground: oklch(0.912 0.006 352.764);
  --destructive: oklch(0.547 0.156 43.599);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.422 0.024 133.976);
  --chart-1: oklch(0.422 0.024 133.976);
  --chart-2: oklch(0.401 0.016 261.457);
  --chart-3: oklch(0.399 0.02 353.949);
  --chart-4: oklch(0.429 0.017 261.455);
  --chart-5: oklch(0.426 0.032 134.1);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.098 0.014 132.315);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.209 0.014 261.361);
  --muted-foreground: oklch(0.685 0.012 261.501);
  --popover: oklch(0.098 0.014 132.315);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.098 0.014 132.315);
  --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.422 0.024 133.976);
  --primary-foreground: oklch(0.919 0.008 133.657);
  --secondary: oklch(0.401 0.016 261.457);
  --secondary-foreground: oklch(0.913 0.005 261.513);
  --accent: oklch(0.399 0.02 353.949);
  --accent-foreground: oklch(0.912 0.006 352.764);
  --destructive: oklch(0.693 0.179 45.972);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.422 0.024 133.976);
  --chart-1: oklch(0.422 0.024 133.976);
  --chart-2: oklch(0.401 0.016 261.457);
  --chart-3: oklch(0.399 0.02 353.949);
  --chart-4: oklch(0.429 0.017 261.455);
  --chart-5: oklch(0.426 0.032 134.1);
}