Moonlight 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).
| Token | Light | Dark |
|---|---|---|
| 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 | #ec1c09red | #ec1c09red |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #31323fdarkslategray | #31323fdarkslategray |
| Input | #373948darkslategray | #373948darkslategray |
| Ring | #7aadfflightskyblue | #7aadfflightskyblue |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 10.24:1 | AAA |
| Text on card | 12.79:1 | AAA |
| Primary button | 7.43:1 | AAA |
| Secondary button | 7.68:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 7.78:1 | AAA |
| Destructive | 4.43:1 | AA Large |
| Text on background | 10.24:1 | AAA |
| Text on card | 12.79:1 | AAA |
| Primary button | 7.43:1 | AAA |
| Secondary button | 7.68:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 7.78:1 | AAA |
| Destructive | 4.43:1 | AA Large |
Paste this into your globals.css to use Moonlight 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.6 0.236 30.033);
--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.6 0.236 30.033);
--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);
}