Cacao for shadcn/ui

Cacao is a shadcn/ui theme built around a purple primary color (#c251e1) with muted light purple accents (#d4ccd7). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the purple primary (#c251e1) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fdfbfewhite
#000000black
Foreground
#030104black
#f9f5faghostwhite
Card
#fbf7fdghostwhite
#030303black
Card foreground
#000000black
#fbf8fbsnow
Popover
#fbf7fdghostwhite
#030303black
Popover foreground
#000000black
#fbf8fbsnow
Primary
#c251e1mediumorchid
#c251e1mediumorchid
Primary foreground
#000000black
#000000black
Secondary
#e4e2e4gainsboro
#19131bblack
Secondary foreground
#4c474ddarkslategray
#b7a3bddarkgray
Muted
#e4d3e8gainsboro
#27172cblack
Muted foreground
#535053darkslategray
#aeacafdarkgray
Accent
#d4ccd7lightgrey
#312235darkslategray
Accent foreground
#3c313fdarkslategray
#ccb7d1thistle
Destructive
#ac3506firebrick
#f75718orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c251e1mediumorchid
#c251e1mediumorchid

Contrast

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

Light mode
Text on background20.22:1AAA
Text on card19.85:1AAA
Primary button5.55:1AA
Secondary button7.02:1AAA
Muted text5.60:1AA
Accent7.85:1AAA
Destructive6.40:1AA
Dark mode
Text on background19.46:1AAA
Text on card19.61:1AAA
Primary button5.55:1AA
Secondary button7.80:1AAA
Muted text7.50:1AAA
Accent8.00:1AAA
Destructive3.32:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.004 318.889);
  --foreground: oklch(0.084 0.02 320.863);
  --muted: oklch(0.887 0.034 318.877);
  --muted-foreground: oklch(0.435 0.006 318.885);
  --popover: oklch(0.981 0.008 318.887);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.981 0.008 318.887);
  --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.639 0.225 318.229);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.914 0.004 318.889);
  --secondary-foreground: oklch(0.405 0.011 318.881);
  --accent: oklch(0.854 0.018 318.883);
  --accent-foreground: oklch(0.331 0.027 318.858);
  --destructive: oklch(0.502 0.162 37.563);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.639 0.225 318.229);
  --chart-1: oklch(0.639 0.225 318.229);
  --chart-2: oklch(0.914 0.004 318.889);
  --chart-3: oklch(0.854 0.018 318.883);
  --chart-4: oklch(0.938 0.003 318.89);
  --chart-5: oklch(0.64 0.233 318.156);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.974 0.007 318.888);
  --muted: oklch(0.235 0.046 318.753);
  --muted-foreground: oklch(0.747 0.005 318.888);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(0.983 0.005 318.889);
  --card: oklch(0.092 0 180);
  --card-foreground: oklch(0.983 0.005 318.889);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.639 0.225 318.229);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.198 0.017 318.857);
  --secondary-foreground: oklch(0.742 0.042 318.87);
  --accent: oklch(0.278 0.04 318.815);
  --accent-foreground: oklch(0.806 0.042 318.872);
  --destructive: oklch(0.665 0.206 38.412);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.639 0.225 318.229);
  --chart-1: oklch(0.639 0.225 318.229);
  --chart-2: oklch(0.198 0.017 318.857);
  --chart-3: oklch(0.278 0.04 318.815);
  --chart-4: oklch(0.23 0.022 318.852);
  --chart-5: oklch(0.64 0.233 318.156);
}