Sparse for shadcn/ui

Sparse is a shadcn/ui theme built around a deep green primary color (#08260f) with deep red accents (#260f08). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep green primary (#08260f) on a neutral background (#020302).

Color palette

TokenLightDark
Background
#ffffffwhite
#020302black
Foreground
#010402black
#f4faf6whitesmoke
Card
#ffffffwhite
#020302black
Card foreground
#010402black
#f4faf6whitesmoke
Popover
#ffffffwhite
#020302black
Popover foreground
#010402black
#f4faf6whitesmoke
Primary
#08260fblack
#08260fblack
Primary foreground
#2cce52limegreen
#2cce52limegreen
Secondary
#0f0826black
#0f0826black
Secondary foreground
#d9d1f5lavender
#d9d1f5lavender
Muted
#dddce0gainsboro
#201f23black
Muted foreground
#575757dimgray
#a8a8a8darkgray
Accent
#260f08black
#260f08black
Accent foreground
#e3957ddarksalmon
#e3957ddarksalmon
Destructive
#660805maroon
#f6423ctomato
Destructive foreground
#fba5a2lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#08260fblack
#08260fblack

Contrast

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

Light mode
Text on background20.59:1AAA
Text on card20.59:1AAA
Primary button7.77:1AAA
Secondary button13.28:1AAA
Muted text5.29:1AA
Accent7.68:1AAA
Destructive6.85:1AA
Dark mode
Text on background19.49:1AAA
Text on card19.49:1AAA
Primary button7.77:1AAA
Secondary button13.28:1AAA
Muted text6.85:1AA
Accent7.68:1AAA
Destructive3.64:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.098 0.019 152.361);
  --muted: oklch(0.897 0.005 296.988);
  --muted-foreground: oklch(0.456 0 180);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.098 0.019 152.361);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.098 0.019 152.361);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.239 0.056 148.336);
  --primary-foreground: oklch(0.747 0.211 146.448);
  --secondary: oklch(0.166 0.059 289.284);
  --secondary-foreground: oklch(0.878 0.051 296.033);
  --accent: oklch(0.202 0.041 37.953);
  --accent-foreground: oklch(0.742 0.102 37.673);
  --destructive: oklch(0.327 0.126 29.143);
  --destructive-foreground: oklch(0.806 0.102 21.723);
  --ring: oklch(0.239 0.056 148.336);
  --chart-1: oklch(0.239 0.056 148.336);
  --chart-2: oklch(0.166 0.059 289.284);
  --chart-3: oklch(0.202 0.041 37.953);
  --chart-4: oklch(0.191 0.074 287.94);
  --chart-5: oklch(0.241 0.058 148.178);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.095 0.01 152.767);
  --foreground: oklch(0.98 0.009 153.095);
  --muted: oklch(0.244 0.006 296.611);
  --muted-foreground: oklch(0.733 0 180);
  --popover: oklch(0.095 0.01 152.767);
  --popover-foreground: oklch(0.98 0.009 153.095);
  --card: oklch(0.095 0.01 152.767);
  --card-foreground: oklch(0.98 0.009 153.095);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.239 0.056 148.336);
  --primary-foreground: oklch(0.747 0.211 146.448);
  --secondary: oklch(0.166 0.059 289.284);
  --secondary-foreground: oklch(0.878 0.051 296.033);
  --accent: oklch(0.202 0.041 37.953);
  --accent-foreground: oklch(0.742 0.102 37.673);
  --destructive: oklch(0.646 0.217 27.225);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.239 0.056 148.336);
  --chart-1: oklch(0.239 0.056 148.336);
  --chart-2: oklch(0.166 0.059 289.284);
  --chart-3: oklch(0.202 0.041 37.953);
  --chart-4: oklch(0.191 0.074 287.94);
  --chart-5: oklch(0.241 0.058 148.178);
}