Melodic for shadcn/ui

Melodic is a shadcn/ui theme built around a vivid violet primary color (#5118fb) with vivid green accents (#c3fb18). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the vivid violet primary (#5118fb) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fcfbfewhite
#000000black
Foreground
#000000black
#fcfcfdwhite
Card
#fcfbfewhite
#000000black
Card foreground
#000000black
#fcfcfdwhite
Popover
#fcfbfewhite
#000000black
Popover foreground
#000000black
#fcfcfdwhite
Primary
#5118fbblueviolet
#5118fbblueviolet
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#c3fb18greenyellow
#c3fb18greenyellow
Secondary foreground
#354601darkgreen
#354601darkgreen
Muted
#e0e3d9gainsboro
#24261cblack
Muted foreground
#5f6156dimgray
#a6a99edarkgray
Accent
#c3fb18greenyellow
#c3fb18greenyellow
Accent foreground
#354601darkgreen
#354601darkgreen
Destructive
#8a0000darkred
#ff0a0ared
Destructive foreground
#ffbdbdlightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5118fbblueviolet
#5118fbblueviolet

Contrast

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

Light mode
Text on background20.38:1AAA
Text on card20.38:1AAA
Primary button7.29:1AAA
Secondary button8.47:1AAA
Muted text4.84:1AA
Accent8.47:1AAA
Destructive6.39:1AA
Dark mode
Text on background20.48:1AAA
Text on card20.48:1AAA
Primary button7.29:1AAA
Secondary button8.47:1AAA
Muted text6.41:1AA
Accent8.47:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 297.765);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.911 0.014 118.089);
  --muted-foreground: oklch(0.488 0.017 118.462);
  --popover: oklch(0.99 0.003 297.765);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.99 0.003 297.765);
  --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.49 0.287 278.611);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.917 0.226 124.715);
  --secondary-foreground: oklch(0.367 0.09 124.114);
  --accent: oklch(0.917 0.226 124.715);
  --accent-foreground: oklch(0.367 0.09 124.114);
  --destructive: oklch(0.397 0.163 29.234);
  --destructive-foreground: oklch(0.858 0.077 18.77);
  --ring: oklch(0.49 0.287 278.611);
  --chart-1: oklch(0.49 0.287 278.611);
  --chart-2: oklch(0.917 0.226 124.715);
  --chart-3: oklch(0.917 0.226 124.715);
  --chart-4: oklch(0.92 0.221 124.066);
  --chart-5: oklch(0.491 0.292 277.813);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.991 0.002 297.782);
  --muted: oklch(0.263 0.018 119.066);
  --muted-foreground: oklch(0.728 0.016 118.211);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.991 0.002 297.782);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.991 0.002 297.782);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.49 0.287 278.611);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.917 0.226 124.715);
  --secondary-foreground: oklch(0.367 0.09 124.114);
  --accent: oklch(0.917 0.226 124.715);
  --accent-foreground: oklch(0.367 0.09 124.114);
  --destructive: oklch(0.63 0.256 28.983);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.49 0.287 278.611);
  --chart-1: oklch(0.49 0.287 278.611);
  --chart-2: oklch(0.917 0.226 124.715);
  --chart-3: oklch(0.917 0.226 124.715);
  --chart-4: oklch(0.92 0.221 124.066);
  --chart-5: oklch(0.491 0.292 277.813);
}