Sweet for shadcn/ui

Sweet is a shadcn/ui theme built around a green primary color (#cbd39c) with indigo accents (#a49cd3). The light mode uses a neutral background (#fcfcf8). Dark mode keeps the green primary (#cbd39c) on a green-tinted background (#0a0b05).

Color palette

TokenLightDark
Background
#fcfcf8snow
#0a0b05black
Foreground
#000000black
#fafbf9snow
Card
#fcfcf8snow
#0a0b05black
Card foreground
#000000black
#fafbf9snow
Popover
#fcfcf8snow
#0a0b05black
Popover foreground
#000000black
#fafbf9snow
Primary
#cbd39ctan
#cbd39ctan
Primary foreground
#272b13black
#272b13black
Secondary
#a49cd3lightsteelblue
#a49cd3lightsteelblue
Secondary foreground
#16132bblack
#16132bblack
Muted
#d2cfe2lightgrey
#201d30darkslategray
Muted foreground
#4e4b63darkslategray
#a09cb4darkgray
Accent
#a49cd3lightsteelblue
#a49cd3lightsteelblue
Accent foreground
#16132bblack
#16132bblack
Destructive
#651c01maroon
#e33e02orangered
Destructive foreground
#feb59aburlywood
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#cbd39ctan
#cbd39ctan

Contrast

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

Light mode
Text on background20.41:1AAA
Text on card20.41:1AAA
Primary button9.28:1AAA
Secondary button7.11:1AAA
Muted text5.49:1AA
Accent7.11:1AAA
Destructive7.15:1AAA
Dark mode
Text on background19.07:1AAA
Text on card19.07:1AAA
Primary button9.28:1AAA
Secondary button7.11:1AAA
Muted text6.20:1AA
Accent7.11:1AAA
Destructive4.22:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.006 113.421);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.863 0.026 292.728);
  --muted-foreground: oklch(0.424 0.04 291.469);
  --popover: oklch(0.99 0.006 113.421);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.99 0.006 113.421);
  --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.848 0.074 114.938);
  --primary-foreground: oklch(0.277 0.04 116.09);
  --secondary: oklch(0.719 0.081 291.106);
  --secondary-foreground: oklch(0.204 0.047 288.442);
  --accent: oklch(0.719 0.081 291.106);
  --accent-foreground: oklch(0.204 0.047 288.442);
  --destructive: oklch(0.342 0.111 38.03);
  --destructive-foreground: oklch(0.835 0.094 40.817);
  --ring: oklch(0.848 0.074 114.938);
  --chart-1: oklch(0.848 0.074 114.938);
  --chart-2: oklch(0.719 0.081 291.106);
  --chart-3: oklch(0.719 0.081 291.106);
  --chart-4: oklch(0.75 0.071 291.458);
  --chart-5: oklch(0.853 0.079 115.047);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.144 0.014 114.024);
  --foreground: oklch(0.986 0.002 113.339);
  --muted: oklch(0.242 0.036 290.303);
  --muted-foreground: oklch(0.704 0.035 292.352);
  --popover: oklch(0.144 0.014 114.024);
  --popover-foreground: oklch(0.986 0.002 113.339);
  --card: oklch(0.144 0.014 114.024);
  --card-foreground: oklch(0.986 0.002 113.339);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.848 0.074 114.938);
  --primary-foreground: oklch(0.277 0.04 116.09);
  --secondary: oklch(0.719 0.081 291.106);
  --secondary-foreground: oklch(0.204 0.047 288.442);
  --accent: oklch(0.719 0.081 291.106);
  --accent-foreground: oklch(0.204 0.047 288.442);
  --destructive: oklch(0.607 0.209 35.627);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.848 0.074 114.938);
  --chart-1: oklch(0.848 0.074 114.938);
  --chart-2: oklch(0.719 0.081 291.106);
  --chart-3: oklch(0.719 0.081 291.106);
  --chart-4: oklch(0.75 0.071 291.458);
  --chart-5: oklch(0.853 0.079 115.047);
}