Darkness for shadcn/ui

Darkness is a shadcn/ui theme built around a green primary color (#4fbf5e) with teal accents (#4fbf96). The light mode uses a neutral background (#f8fcf9). Dark mode keeps the green primary (#4fbf5e) on a green-tinted background (#051006).

Color palette

TokenLightDark
Background
#f8fcf9mintcream
#051006black
Foreground
#021204black
#f5faf5whitesmoke
Card
#f5faf5whitesmoke
#061408black
Card foreground
#020e03black
#f8fcf9mintcream
Popover
#f5faf5whitesmoke
#061408black
Popover foreground
#020e03black
#f8fcf9mintcream
Primary
#4fbf5emediumseagreen
#4fbf5emediumseagreen
Primary foreground
#123116black
#123116black
Secondary
#78bf4fyellowgreen
#78bf4fyellowgreen
Secondary foreground
#1d3112black
#1d3112black
Muted
#dde1dbgainsboro
#20241eblack
Muted foreground
#41473edarkslategray
#bbc1b8silver
Accent
#4fbf96mediumaquamarine
#4fbf96mediumaquamarine
Accent foreground
#123125darkslategray
#123125darkslategray
Destructive
#d34f03chocolate
#fc7b31coral
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4fbf5emediumseagreen
#4fbf5emediumseagreen

Contrast

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

Light mode
Text on background18.56:1AAA
Text on card18.63:1AAA
Primary button6.08:1AA
Secondary button6.27:1AA
Muted text7.23:1AAA
Accent6.21:1AA
Destructive4.28:1AA Large
Dark mode
Text on background18.37:1AAA
Text on card18.28:1AAA
Primary button6.08:1AA
Secondary button6.27:1AA
Muted text8.53:1AAA
Accent6.21:1AA
Destructive8.03:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.987 0.006 149.612);
  --foreground: oklch(0.163 0.04 147.458);
  --muted: oklch(0.905 0.01 133.675);
  --muted-foreground: oklch(0.389 0.017 133.888);
  --popover: oklch(0.98 0.009 149.576);
  --popover-foreground: oklch(0.144 0.035 147.911);
  --card: oklch(0.98 0.009 149.576);
  --card-foreground: oklch(0.144 0.035 147.911);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.719 0.171 146.01);
  --primary-foreground: oklch(0.28 0.061 146.417);
  --secondary: oklch(0.735 0.164 135.629);
  --secondary-foreground: oklch(0.286 0.058 135.34);
  --accent: oklch(0.73 0.12 165.926);
  --accent-foreground: oklch(0.284 0.043 166.742);
  --destructive: oklch(0.599 0.18 41.927);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.719 0.171 146.01);
  --chart-1: oklch(0.719 0.171 146.01);
  --chart-2: oklch(0.735 0.164 135.629);
  --chart-3: oklch(0.73 0.12 165.926);
  --chart-4: oklch(0.751 0.155 135.375);
  --chart-5: oklch(0.726 0.179 145.812);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.157 0.028 148.125);
  --foreground: oklch(0.98 0.009 149.576);
  --muted: oklch(0.256 0.014 133.949);
  --muted-foreground: oklch(0.805 0.014 133.718);
  --popover: oklch(0.173 0.033 147.633);
  --popover-foreground: oklch(0.987 0.006 149.612);
  --card: oklch(0.173 0.033 147.633);
  --card-foreground: oklch(0.987 0.006 149.612);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.719 0.171 146.01);
  --primary-foreground: oklch(0.28 0.061 146.417);
  --secondary: oklch(0.735 0.164 135.629);
  --secondary-foreground: oklch(0.286 0.058 135.34);
  --accent: oklch(0.73 0.12 165.926);
  --accent-foreground: oklch(0.284 0.043 166.742);
  --destructive: oklch(0.723 0.178 46.808);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.719 0.171 146.01);
  --chart-1: oklch(0.719 0.171 146.01);
  --chart-2: oklch(0.735 0.164 135.629);
  --chart-3: oklch(0.73 0.12 165.926);
  --chart-4: oklch(0.751 0.155 135.375);
  --chart-5: oklch(0.726 0.179 145.812);
}