Sweets for shadcn/ui

Sweets is a shadcn/ui theme built around a deep red primary color (#2b0d0d) with deep indigo accents (#0d0d2b). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep red primary (#2b0d0d) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#170303black
#ffffffwhite
Card
#fcfcfcsnow
#030303black
Card foreground
#120202black
#ffffffwhite
Popover
#fcfcfcsnow
#030303black
Popover foreground
#120202black
#ffffffwhite
Primary
#2b0d0dblack
#2b0d0dblack
Primary foreground
#dc8e8edarksalmon
#dc8e8edarksalmon
Secondary
#0d2b0dblack
#0d2b0dblack
Secondary foreground
#40c440limegreen
#40c440limegreen
Muted
#e7f3e7honeydew
#0c180cblack
Muted foreground
#546454dimgray
#9bab9bdarkgray
Accent
#0d0d2bblack
#0d0d2bblack
Accent foreground
#8e8edcmediumpurple
#8e8edcmediumpurple
Destructive
#d02f0bfirebrick
#e9350corangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#2b0d0dblack
#2b0d0dblack

Contrast

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

Light mode
Text on background19.98:1AAA
Text on card19.84:1AAA
Primary button7.11:1AAA
Secondary button6.71:1AA
Muted text5.52:1AA
Accent6.35:1AA
Destructive5.11:1AA
Dark mode
Text on background21.00:1AAA
Text on card20.67:1AAA
Primary button7.11:1AAA
Secondary button6.71:1AA
Muted text7.55:1AAA
Accent6.35:1AA
Destructive4.23:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.14 0.042 24.259);
  --muted: oklch(0.952 0.021 145.411);
  --muted-foreground: oklch(0.484 0.033 145.045);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.127 0.037 23.957);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.127 0.037 23.957);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.209 0.05 22.337);
  --primary-foreground: oklch(0.726 0.096 19.655);
  --secondary: oklch(0.258 0.063 143.461);
  --secondary-foreground: oklch(0.723 0.207 143.066);
  --accent: oklch(0.181 0.059 278.793);
  --accent-foreground: oklch(0.678 0.115 282.91);
  --destructive: oklch(0.561 0.201 32.938);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.209 0.05 22.337);
  --chart-1: oklch(0.209 0.05 22.337);
  --chart-2: oklch(0.258 0.063 143.461);
  --chart-3: oklch(0.181 0.059 278.793);
  --chart-4: oklch(0.298 0.077 143.347);
  --chart-5: oklch(0.209 0.052 22.721);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.193 0.03 144.318);
  --muted-foreground: oklch(0.725 0.03 145.258);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.092 0 180);
  --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.209 0.05 22.337);
  --primary-foreground: oklch(0.726 0.096 19.655);
  --secondary: oklch(0.258 0.063 143.461);
  --secondary-foreground: oklch(0.723 0.207 143.066);
  --accent: oklch(0.181 0.059 278.793);
  --accent-foreground: oklch(0.678 0.115 282.91);
  --destructive: oklch(0.608 0.22 32.853);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.209 0.05 22.337);
  --chart-1: oklch(0.209 0.05 22.337);
  --chart-2: oklch(0.258 0.063 143.461);
  --chart-3: oklch(0.181 0.059 278.793);
  --chart-4: oklch(0.298 0.077 143.347);
  --chart-5: oklch(0.209 0.052 22.721);
}