Sparse for shadcn/ui

Sparse is a shadcn/ui theme built around a violet primary color (#b390ee) with purple accents (#e290ee). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#b390ee) on a neutral background (#050307).

Color palette

TokenLightDark
Background
#fcfbfewhite
#050307black
Foreground
#06030dblack
#fcfcfdwhite
Card
#f9f7fcghostwhite
#07040bblack
Card foreground
#040209black
#ffffffwhite
Popover
#f9f7fcghostwhite
#07040bblack
Popover foreground
#040209black
#ffffffwhite
Primary
#b390eeplum
#b390eeplum
Primary foreground
#1f0a43midnightblue
#1f0a43midnightblue
Secondary
#909deecornflowerblue
#909deecornflowerblue
Secondary foreground
#0a1143midnightblue
#0a1143midnightblue
Muted
#eeeff6whitesmoke
#090a11black
Muted foreground
#404354darkslategray
#abaebfdarkgray
Accent
#e290eeviolet
#e290eeviolet
Accent foreground
#3b0a43midnightblue
#3b0a43midnightblue
Destructive
#dc0d09red
#f73936tomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b390eeplum
#b390eeplum

Contrast

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

Light mode
Text on background19.86:1AAA
Text on card19.45:1AAA
Primary button6.88:1AA
Secondary button7.00:1AAA
Muted text8.54:1AAA
Accent7.22:1AAA
Destructive5.10:1AA
Dark mode
Text on background20.04:1AAA
Text on card20.33:1AAA
Primary button6.88:1AA
Secondary button7.00:1AAA
Muted text8.98:1AAA
Accent7.22:1AAA
Destructive3.75:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 302.876);
  --foreground: oklch(0.111 0.031 303.58);
  --muted: oklch(0.954 0.01 279.19);
  --muted-foreground: oklch(0.387 0.028 278.122);
  --popover: oklch(0.98 0.007 302.822);
  --popover-foreground: oklch(0.097 0.026 303.98);
  --card: oklch(0.98 0.007 302.822);
  --card-foreground: oklch(0.097 0.026 303.98);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.722 0.138 299.861);
  --primary-foreground: oklch(0.22 0.098 293.217);
  --secondary: oklch(0.718 0.12 276.278);
  --secondary-foreground: oklch(0.213 0.092 269.657);
  --accent: oklch(0.769 0.156 322.064);
  --accent-foreground: oklch(0.263 0.107 321.919);
  --destructive: oklch(0.565 0.228 29.08);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.722 0.138 299.861);
  --chart-1: oklch(0.722 0.138 299.861);
  --chart-2: oklch(0.718 0.12 276.278);
  --chart-3: oklch(0.769 0.156 322.064);
  --chart-4: oklch(0.752 0.104 276.864);
  --chart-5: oklch(0.719 0.143 299.71);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.104 0.016 303.497);
  --foreground: oklch(0.992 0.001 302.916);
  --muted: oklch(0.146 0.015 277.185);
  --muted-foreground: oklch(0.754 0.024 278.844);
  --popover: oklch(0.12 0.018 303.448);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.12 0.018 303.448);
  --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.722 0.138 299.861);
  --primary-foreground: oklch(0.22 0.098 293.217);
  --secondary: oklch(0.718 0.12 276.278);
  --secondary-foreground: oklch(0.213 0.092 269.657);
  --accent: oklch(0.769 0.156 322.064);
  --accent-foreground: oklch(0.263 0.107 321.919);
  --destructive: oklch(0.639 0.225 27.075);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.722 0.138 299.861);
  --chart-1: oklch(0.722 0.138 299.861);
  --chart-2: oklch(0.718 0.12 276.278);
  --chart-3: oklch(0.769 0.156 322.064);
  --chart-4: oklch(0.752 0.104 276.864);
  --chart-5: oklch(0.719 0.143 299.71);
}