Melody for shadcn/ui

Melody is a shadcn/ui theme built around a deep yellow primary color (#1c1907) with deep green accents (#161c07). The light mode uses a neutral background (#fcfbf8). Dark mode keeps the deep yellow primary (#1c1907) on a yellow-tinted background (#0a0905).

Color palette

TokenLightDark
Background
#fcfbf8snow
#0a0905black
Foreground
#090801black
#faf9f5whitesmoke
Card
#fbfaf4floralwhite
#0e0c07black
Card foreground
#050401black
#fcfbf8snow
Popover
#fbfaf4floralwhite
#0e0c07black
Popover foreground
#050401black
#fcfbf8snow
Primary
#1c1907black
#1c1907black
Primary foreground
#bfa531goldenrod
#bfa531goldenrod
Secondary
#1c0e07black
#1c0e07black
Secondary foreground
#dc9979darksalmon
#dc9979darksalmon
Muted
#f5eeeblinen
#140d0ablack
Muted foreground
#4c4642darkslategray
#bdb6b3silver
Accent
#161c07black
#161c07black
Accent foreground
#92bf31yellowgreen
#92bf31yellowgreen
Destructive
#a03d03saddlebrown
#fb782dtomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1c1907black
#1c1907black

Contrast

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

Light mode
Text on background19.43:1AAA
Text on card19.54:1AAA
Primary button7.27:1AAA
Secondary button7.95:1AAA
Muted text8.08:1AAA
Accent8.05:1AAA
Destructive6.65:1AA
Dark mode
Text on background18.87:1AAA
Text on card18.86:1AAA
Primary button7.27:1AAA
Secondary button7.95:1AAA
Muted text9.59:1AAA
Accent8.05:1AAA
Destructive7.83:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.005 96.231);
  --foreground: oklch(0.131 0.022 101.541);
  --muted: oklch(0.953 0.009 46.755);
  --muted-foreground: oklch(0.398 0.011 46.571);
  --popover: oklch(0.983 0.008 96.264);
  --popover-foreground: oklch(0.104 0.018 101.541);
  --card: oklch(0.983 0.008 96.264);
  --card-foreground: oklch(0.104 0.018 101.541);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.211 0.03 97.097);
  --primary-foreground: oklch(0.724 0.132 95.967);
  --secondary: oklch(0.182 0.028 46.15);
  --secondary-foreground: oklch(0.741 0.093 45.707);
  --accent: oklch(0.215 0.038 124.039);
  --accent-foreground: oklch(0.745 0.171 125.935);
  --destructive: oklch(0.491 0.144 42.87);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.211 0.03 97.097);
  --chart-1: oklch(0.211 0.03 97.097);
  --chart-2: oklch(0.182 0.028 46.15);
  --chart-3: oklch(0.215 0.038 124.039);
  --chart-4: oklch(0.218 0.038 45.093);
  --chart-5: oklch(0.212 0.032 97.112);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.141 0.011 98.829);
  --foreground: oklch(0.982 0.006 96.241);
  --muted: oklch(0.169 0.014 46.098);
  --muted-foreground: oklch(0.78 0.009 46.728);
  --popover: oklch(0.156 0.012 97.621);
  --popover-foreground: oklch(0.988 0.004 96.215);
  --card: oklch(0.156 0.012 97.621);
  --card-foreground: oklch(0.988 0.004 96.215);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.211 0.03 97.097);
  --primary-foreground: oklch(0.724 0.132 95.967);
  --secondary: oklch(0.182 0.028 46.15);
  --secondary-foreground: oklch(0.741 0.093 45.707);
  --accent: oklch(0.215 0.038 124.039);
  --accent-foreground: oklch(0.745 0.171 125.935);
  --destructive: oklch(0.716 0.18 46.477);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.211 0.03 97.097);
  --chart-1: oklch(0.211 0.03 97.097);
  --chart-2: oklch(0.182 0.028 46.15);
  --chart-3: oklch(0.215 0.038 124.039);
  --chart-4: oklch(0.218 0.038 45.093);
  --chart-5: oklch(0.212 0.032 97.112);
}