Moonlight II for shadcn/ui

Moonlight II is a shadcn/ui theme built around a vivid blue primary color (#7aadff) with muted blue accents (#3f4364). The light mode uses a blue-tinted background (#212335). Dark mode keeps the vivid blue primary (#7aadff) on a blue-tinted background (#212335).

Color palette

TokenLightDark
Background
#212335darkslategray
#212335darkslategray
Foreground
#c7d2f5lightblue
#c7d2f5lightblue
Card
#1d1f2fdarkslategray
#1d1f2fdarkslategray
Card foreground
#dde4f9lavender
#dde4f9lavender
Popover
#1b1d2cblack
#1b1d2cblack
Popover foreground
#f2f5fdaliceblue
#f2f5fdaliceblue
Primary
#7aadfflightskyblue
#7aadfflightskyblue
Primary foreground
#001b47midnightblue
#001b47midnightblue
Secondary
#2d3b53darkslategray
#2d3b53darkslategray
Secondary foreground
#cdd6e4gainsboro
#cdd6e4gainsboro
Muted
#2f303cdarkslategray
#2f303cdarkslategray
Muted foreground
#acaebedarkgray
#acaebedarkgray
Accent
#3f4364darkslategray
#3f4364darkslategray
Accent foreground
#e6e7eflavender
#e6e7eflavender
Destructive
#f61804red
#f61804red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#31323fdarkslategray
#31323fdarkslategray
Input
#373948darkslategray
#373948darkslategray
Ring
#7aadfflightskyblue
#7aadfflightskyblue

Contrast

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

Light mode
Text on background10.24:1AAA
Text on card12.79:1AAA
Primary button7.43:1AAA
Secondary button7.68:1AAA
Muted text5.91:1AA
Accent7.78:1AAA
Destructive4.15:1AA Large
Dark mode
Text on background10.24:1AAA
Text on card12.79:1AAA
Primary button7.43:1AAA
Secondary button7.68:1AAA
Muted text5.91:1AA
Accent7.78:1AAA
Destructive4.15:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.264 0.034 278.934);
  --foreground: oklch(0.867 0.049 270.794);
  --muted: oklch(0.314 0.021 280.145);
  --muted-foreground: oklch(0.754 0.023 280.783);
  --popover: oklch(0.237 0.028 279.079);
  --popover-foreground: oklch(0.97 0.011 271.302);
  --card: oklch(0.246 0.03 279.026);
  --card-foreground: oklch(0.919 0.03 271.081);
  --border: oklch(0.322 0.023 280.02);
  --input: oklch(0.35 0.026 279.984);
  --primary: oklch(0.747 0.131 259.576);
  --primary-foreground: oklch(0.236 0.09 258.538);
  --secondary: oklch(0.351 0.046 259.704);
  --secondary-foreground: oklch(0.874 0.022 259.945);
  --accent: oklch(0.393 0.057 278.542);
  --accent-foreground: oklch(0.929 0.011 281.087);
  --destructive: oklch(0.617 0.246 30.004);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.747 0.131 259.576);
  --chart-1: oklch(0.747 0.131 259.576);
  --chart-2: oklch(0.351 0.046 259.704);
  --chart-3: oklch(0.393 0.057 278.542);
  --chart-4: oklch(0.378 0.05 259.695);
  --chart-5: oklch(0.746 0.135 259.562);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.264 0.034 278.934);
  --foreground: oklch(0.867 0.049 270.794);
  --muted: oklch(0.314 0.021 280.145);
  --muted-foreground: oklch(0.754 0.023 280.783);
  --popover: oklch(0.237 0.028 279.079);
  --popover-foreground: oklch(0.97 0.011 271.302);
  --card: oklch(0.246 0.03 279.026);
  --card-foreground: oklch(0.919 0.03 271.081);
  --border: oklch(0.322 0.023 280.02);
  --input: oklch(0.35 0.026 279.984);
  --primary: oklch(0.747 0.131 259.576);
  --primary-foreground: oklch(0.236 0.09 258.538);
  --secondary: oklch(0.351 0.046 259.704);
  --secondary-foreground: oklch(0.874 0.022 259.945);
  --accent: oklch(0.393 0.057 278.542);
  --accent-foreground: oklch(0.929 0.011 281.087);
  --destructive: oklch(0.617 0.246 30.004);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.747 0.131 259.576);
  --chart-1: oklch(0.747 0.131 259.576);
  --chart-2: oklch(0.351 0.046 259.704);
  --chart-3: oklch(0.393 0.057 278.542);
  --chart-4: oklch(0.378 0.05 259.695);
  --chart-5: oklch(0.746 0.135 259.562);
}