Spelt for shadcn/ui

Spelt is a shadcn/ui theme built around a muted green primary color (#3d643a) with muted green accents (#3a644b). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted green primary (#3d643a) on a green-tinted background (#070e06).

Color palette

TokenLightDark
Background
#ffffffwhite
#070e06black
Foreground
#061504black
#f5faf5whitesmoke
Card
#fcfcfcsnow
#091108black
Card foreground
#041103black
#f9fcf8mintcream
Popover
#ffffffwhite
#070e06black
Popover foreground
#061504black
#f5faf5whitesmoke
Primary
#3d643adarkolivegreen
#3d643adarkolivegreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#53643adarkolivegreen
#53643adarkolivegreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#eeefeblinen
#121410black
Muted foreground
#565f49darkolivegreen
#adb6a0darkgray
Accent
#3a644bdarkslategray
#3a644bdarkslategray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#af3f12firebrick
#e85d26chocolate
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#3d643adarkolivegreen
#3d643adarkolivegreen

Contrast

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

Light mode
Text on background18.80:1AAA
Text on card18.90:1AAA
Primary button6.77:1AA
Secondary button6.43:1AA
Muted text5.81:1AA
Accent6.73:1AA
Destructive5.91:1AA
Dark mode
Text on background18.49:1AAA
Text on card18.49:1AAA
Primary button6.77:1AA
Secondary button6.43:1AA
Muted text8.80:1AAA
Accent6.73:1AA
Destructive6.03:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.177 0.043 141.384);
  --muted: oklch(0.95 0.006 125.132);
  --muted-foreground: oklch(0.471 0.036 126.139);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.177 0.043 141.384);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.16 0.037 141.227);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.464 0.081 142.307);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.478 0.068 127.224);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.466 0.063 157.234);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.52 0.156 39.002);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.464 0.081 142.307);
  --chart-1: oklch(0.464 0.081 142.307);
  --chart-2: oklch(0.478 0.068 127.224);
  --chart-3: oklch(0.466 0.063 157.234);
  --chart-4: oklch(0.51 0.073 127.252);
  --chart-5: oklch(0.468 0.089 142.239);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.153 0.02 142.112);
  --foreground: oklch(0.98 0.008 143.096);
  --muted: oklch(0.188 0.009 125.716);
  --muted-foreground: oklch(0.762 0.032 125.638);
  --popover: oklch(0.153 0.02 142.112);
  --popover-foreground: oklch(0.98 0.008 143.096);
  --card: oklch(0.167 0.024 142.273);
  --card-foreground: oklch(0.987 0.005 143.109);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.464 0.081 142.307);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.478 0.068 127.224);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.466 0.063 157.234);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.651 0.185 39.773);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.464 0.081 142.307);
  --chart-1: oklch(0.464 0.081 142.307);
  --chart-2: oklch(0.478 0.068 127.224);
  --chart-3: oklch(0.466 0.063 157.234);
  --chart-4: oklch(0.51 0.073 127.252);
  --chart-5: oklch(0.468 0.089 142.239);
}