Dark for shadcn/ui

Dark is a shadcn/ui theme built around a green primary color (#55952d) with pink accents (#952d55). The light mode uses a neutral background (#f9fcf8). Dark mode keeps the green primary (#55952d) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#f9fcf8mintcream
#000000black
Foreground
#000000black
#f7faf4whitesmoke
Card
#f9fcf8mintcream
#000000black
Card foreground
#000000black
#f7faf4whitesmoke
Popover
#f9fcf8mintcream
#000000black
Popover foreground
#000000black
#f7faf4whitesmoke
Primary
#55952dolivedrab
#55952dolivedrab
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#2d5595darkslateblue
#2d5595darkslateblue
Secondary foreground
#f7f9fdghostwhite
#f7f9fdghostwhite
Muted
#ecedeewhitesmoke
#111213black
Muted foreground
#3b424fdarkslategray
#b0b8c4silver
Accent
#952d55brown
#952d55brown
Accent foreground
#fdf7f9snow
#fdf7f9snow
Destructive
#6b0e0bmaroon
#ea342ecrimson
Destructive foreground
#f7b2b0lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#55952dolivedrab
#55952dolivedrab

Contrast

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

Light mode
Text on background20.34:1AAA
Text on card20.34:1AAA
Primary button3.66:1AA Large
Secondary button7.02:1AAA
Muted text8.61:1AAA
Accent7.13:1AAA
Destructive7.07:1AAA
Dark mode
Text on background19.93:1AAA
Text on card19.93:1AAA
Primary button3.66:1AA Large
Secondary button7.02:1AAA
Muted text9.40:1AAA
Accent7.13:1AAA
Destructive4.15:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.007 133.032);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.945 0.002 259.937);
  --muted-foreground: oklch(0.379 0.024 259.89);
  --popover: oklch(0.988 0.007 133.032);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.988 0.007 133.032);
  --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.605 0.152 135.795);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.454 0.115 259.493);
  --secondary-foreground: oklch(0.982 0.005 259.939);
  --accent: oklch(0.465 0.143 0.988);
  --accent-foreground: oklch(0.981 0.006 351.78);
  --destructive: oklch(0.34 0.126 28.42);
  --destructive-foreground: oklch(0.829 0.081 21.175);
  --ring: oklch(0.605 0.152 135.795);
  --chart-1: oklch(0.605 0.152 135.795);
  --chart-2: oklch(0.454 0.115 259.493);
  --chart-3: oklch(0.465 0.143 0.988);
  --chart-4: oklch(0.478 0.122 259.495);
  --chart-5: oklch(0.612 0.159 135.979);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.982 0.009 133.048);
  --muted: oklch(0.18 0.004 259.946);
  --muted-foreground: oklch(0.78 0.02 259.944);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.982 0.009 133.048);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.982 0.009 133.048);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.605 0.152 135.795);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.454 0.115 259.493);
  --secondary-foreground: oklch(0.982 0.005 259.939);
  --accent: oklch(0.465 0.143 0.988);
  --accent-foreground: oklch(0.981 0.006 351.78);
  --destructive: oklch(0.613 0.218 27.896);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.605 0.152 135.795);
  --chart-1: oklch(0.605 0.152 135.795);
  --chart-2: oklch(0.454 0.115 259.493);
  --chart-3: oklch(0.465 0.143 0.988);
  --chart-4: oklch(0.478 0.122 259.495);
  --chart-5: oklch(0.612 0.159 135.979);
}