Density for shadcn/ui

Density is a shadcn/ui theme built around a near-black primary color (#050a06) with near-black accents (#0a0509). The light mode uses a neutral background (#f7fdf8). Dark mode keeps the near-black primary (#050a06) on a green-tinted background (#040b05).

Color palette

TokenLightDark
Background
#f7fdf8mintcream
#040b05black
Foreground
#030c05black
#f9fafaghostwhite
Card
#f7fdf8mintcream
#040b05black
Card foreground
#030c05black
#f9fafaghostwhite
Popover
#f7fdf8mintcream
#040b05black
Popover foreground
#030c05black
#f9fafaghostwhite
Primary
#050a06black
#050a06black
Primary foreground
#81c18adarkseagreen
#81c18adarkseagreen
Secondary
#0a0509black
#0a0509black
Secondary foreground
#c181b7rosybrown
#c181b7rosybrown
Muted
#efebefwhitesmoke
#141013black
Muted foreground
#4a4549darkslategray
#bab5basilver
Accent
#0a0509black
#0a0509black
Accent foreground
#c181b7rosybrown
#c181b7rosybrown
Destructive
#ca2f0cfirebrick
#f35430tomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#050a06black
#050a06black

Contrast

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

Light mode
Text on background19.18:1AAA
Text on card19.18:1AAA
Primary button9.42:1AAA
Secondary button6.82:1AA
Muted text7.95:1AAA
Accent6.82:1AA
Destructive5.34:1AA
Dark mode
Text on background19.02:1AAA
Text on card19.02:1AAA
Primary button9.42:1AAA
Secondary button6.82:1AA
Muted text9.36:1AAA
Accent6.82:1AA
Destructive3.43:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.987 0.008 150.139);
  --foreground: oklch(0.14 0.024 149.134);
  --muted: oklch(0.944 0.007 330.337);
  --muted-foreground: oklch(0.396 0.011 330.602);
  --popover: oklch(0.987 0.008 150.139);
  --popover-foreground: oklch(0.14 0.024 149.134);
  --card: oklch(0.987 0.008 150.139);
  --card-foreground: oklch(0.14 0.024 149.134);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.137 0.015 149.601);
  --primary-foreground: oklch(0.752 0.102 148.286);
  --secondary: oklch(0.127 0.016 330.903);
  --secondary-foreground: oklch(0.685 0.107 332.124);
  --accent: oklch(0.127 0.016 330.903);
  --accent-foreground: oklch(0.685 0.107 332.124);
  --destructive: oklch(0.55 0.196 33.032);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.137 0.015 149.601);
  --chart-1: oklch(0.137 0.015 149.601);
  --chart-2: oklch(0.127 0.016 330.903);
  --chart-3: oklch(0.127 0.016 330.903);
  --chart-4: oklch(0.164 0.025 332.065);
  --chart-5: oklch(0.138 0.016 149.54);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.139 0.019 149.388);
  --foreground: oklch(0.985 0.002 150.226);
  --muted: oklch(0.179 0.01 330.956);
  --muted-foreground: oklch(0.778 0.009 330.4);
  --popover: oklch(0.139 0.019 149.388);
  --popover-foreground: oklch(0.985 0.002 150.226);
  --card: oklch(0.139 0.019 149.388);
  --card-foreground: oklch(0.985 0.002 150.226);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.137 0.015 149.601);
  --primary-foreground: oklch(0.752 0.102 148.286);
  --secondary: oklch(0.127 0.016 330.903);
  --secondary-foreground: oklch(0.685 0.107 332.124);
  --accent: oklch(0.127 0.016 330.903);
  --accent-foreground: oklch(0.685 0.107 332.124);
  --destructive: oklch(0.657 0.202 34.046);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.137 0.015 149.601);
  --chart-1: oklch(0.137 0.015 149.601);
  --chart-2: oklch(0.127 0.016 330.903);
  --chart-3: oklch(0.127 0.016 330.903);
  --chart-4: oklch(0.164 0.025 332.065);
  --chart-5: oklch(0.138 0.016 149.54);
}