Themes

Sunshine and moonlight theme color palettes

Themes

DuskMoonUI ships with two built-in themes. Apply them with data-theme="sunshine" for light mode or data-theme="moonlight" for dark mode.

Sunshine (Light Theme)

A warm, inviting light theme with golden accents.

Brand Colors

Primary, Secondary, Tertiary

primary
primary-container
secondary
secondary-container
tertiary
tertiary-container

Semantic Colors

Info, Success, Warning, Error

info
container
success
container
warning
container
error
container

Surface Colors

Surface Scale

lowest
low
container
high
highest
surface-dim
surface
surface-bright

Base Scale

Base 100-900

100
200
300
400
500
600
700
800
900

Accent & Neutral

Accent, Neutral, Outline

accent
neutral
outline
outline-variant

Source Code

View Sunshine theme CSS
[data-theme="sunshine"] {
  color-scheme: light;

  /* Brand Colors */
  --color-primary: oklch(95.86% 0.0693 95.91);
  --color-primary-content: oklch(20% 0 0);
  --color-primary-container: oklch(95% 0.035 95.91);
  --color-on-primary-container: oklch(25% 0.03 95.91);

  --color-secondary: oklch(87.42% 0.143 87.01);
  --color-secondary-content: oklch(27.42% 0.143 87.01);
  --color-secondary-container: oklch(94% 0.05 87.01);
  --color-on-secondary-container: oklch(25% 0.05 87.01);

  --color-tertiary: oklch(80% 0.085 235);
  --color-tertiary-content: oklch(18% 0.010 235);
  --color-tertiary-container: oklch(95% 0.035 235);
  --color-on-tertiary-container: oklch(22% 0.012 235);

  /* Surface Colors */
  --color-surface: oklch(100% 0 0);
  --color-surface-dim: oklch(96% 0.01 85);
  --color-surface-bright: oklch(100% 0 0);
  --color-surface-container-lowest: oklch(100% 0 0);
  --color-surface-container-low: oklch(99% 0.01 85);
  --color-surface-container: oklch(97% 0.01 85);
  --color-surface-container-high: oklch(96% 0.01 85);
  --color-surface-container-highest: oklch(94% 0.01 85);
  --color-on-surface: oklch(27% 0.02 260);
  --color-on-surface-variant: oklch(50% 0.02 260);
  --color-surface-variant: oklch(94% 0.02 85);

  /* Semantic Colors */
  --color-info: oklch(41.94% 0.114 254.39);
  --color-info-content: oklch(91.94% 0.114 254.39);
  --color-info-container: oklch(95% 0.03 235);
  --color-on-info-container: oklch(35% 0.08 235);

  --color-success: oklch(67.21% 0.19 133.55);
  --color-success-content: oklch(27.21% 0.19 133.55);
  --color-success-container: oklch(93% 0.04 150);
  --color-on-success-container: oklch(30% 0.08 150);

  --color-warning: oklch(68.19% 0.203 42.44);
  --color-warning-content: oklch(18.19% 0.6 42);
  --color-warning-container: oklch(93% 0.05 80);
  --color-on-warning-container: oklch(38% 0.10 80);

  --color-error: oklch(61.17% 0.237 28.15);
  --color-error-content: oklch(90.01% 0.153 84.78);
  --color-error-container: oklch(93% 0.04 25);
  --color-on-error-container: oklch(32% 0.10 25);

  /* Base Scale */
  --color-base-100: oklch(100% 0.1 255);
  --color-base-200: oklch(85% 0.1 255);
  --color-base-300: oklch(70% 0.1 255);
  --color-base-400: oklch(55% 0.06 255);
  --color-base-500: oklch(45% 0.05 255);
  --color-base-600: oklch(35% 0.04 255);
  --color-base-700: oklch(25% 0.03 255);
  --color-base-800: oklch(18% 0.02 255);
  --color-base-900: oklch(12% 0.01 255);
  --color-base-content: oklch(10% 0 255);

  /* Accent & Neutral */
  --color-accent: oklch(85.23% 0.14 327);
  --color-accent-content: oklch(41% 0.112 45.904);
  --color-neutral: oklch(0% 0 0);
  --color-neutral-content: oklch(80% 0.1 50);
  --color-neutral-variant: oklch(50% 0.02 260);

  /* Outline */
  --color-outline: oklch(75% 0.01 260);
  --color-outline-variant: oklch(85% 0.01 260);

  /* Inverse */
  --color-inverse-surface: oklch(25% 0.02 260);
  --color-inverse-on-surface: oklch(95% 0.01 260);
  --color-inverse-primary: oklch(80% 0.14 55);

  /* Shadow & Scrim */
  --color-shadow: oklch(0% 0 0);
  --color-scrim: oklch(0% 0 0 / 50%);

  /* Shape */
  --radius-selector: 0rem;
  --radius-field: 0.5rem;
  --radius-box: 2rem;
  --size-selector: 0.1875rem;
  --size-field: 0.1875rem;
  --border: 0.5px;
  --depth: 1;
  --noise: 1;
}

Moonlight (Dark Theme)

A cool, sophisticated dark theme optimized for low-light environments.

Brand Colors

Primary, Secondary, Tertiary

primary
primary-container
secondary
secondary-container
tertiary
tertiary-container

Semantic Colors

Info, Success, Warning, Error

info
container
success
container
warning
container
error
container

Surface Colors

Surface Scale

lowest
low
container
high
highest
surface-dim
surface
surface-bright

Base Scale

Base 100-900

100
200
300
400
500
600
700
800
900

Accent & Neutral

Accent, Neutral, Outline

accent
neutral
outline
outline-variant

Source Code

View Moonlight theme CSS
[data-theme="moonlight"] {
  color-scheme: dark;

  /* Brand Colors */
  --color-primary: oklch(85.45% 0 0);
  --color-primary-content: oklch(14.94% 0.031 39.947);
  --color-primary-container: oklch(25% 0.01 0);
  --color-on-primary-container: oklch(85% 0.01 0);

  --color-secondary: oklch(83.33% 0.0981 73.78);
  --color-secondary-content: oklch(14.507% 0.035 2.72);
  --color-secondary-container: oklch(28% 0.03 73.78);
  --color-on-secondary-container: oklch(88% 0.03 73.78);

  --color-tertiary: oklch(72% 0.090 255);
  --color-tertiary-content: oklch(14% 0.012 255);
  --color-tertiary-container: oklch(28% 0.030 255);
  --color-on-tertiary-container: oklch(88% 0.010 255);

  /* Surface Colors */
  --color-surface: oklch(20% 0.02 260);
  --color-surface-dim: oklch(17% 0.02 260);
  --color-surface-bright: oklch(28% 0.02 260);
  --color-surface-container-lowest: oklch(14% 0.02 260);
  --color-surface-container-low: oklch(20% 0.02 260);
  --color-surface-container: oklch(22% 0.02 260);
  --color-surface-container-high: oklch(25% 0.02 260);
  --color-surface-container-highest: oklch(28% 0.01 260);
  --color-on-surface: oklch(95% 0.01 260);
  --color-on-surface-variant: oklch(75% 0.01 260);
  --color-surface-variant: oklch(30% 0.02 260);

  /* Semantic Colors */
  --color-info: oklch(82.42% 0.098 240.77);
  --color-info-content: oklch(17.111% 0.017 206.015);
  --color-info-container: oklch(32% 0.06 235);
  --color-on-info-container: oklch(88% 0.06 235);

  --color-success: oklch(82.19% 0.0621 133.3);
  --color-success-content: oklch(17.112% 0.017 144.778);
  --color-success-container: oklch(30% 0.05 150);
  --color-on-success-container: oklch(85% 0.06 150);

  --color-warning: oklch(76.36% 0.175 61.96);
  --color-warning-content: oklch(17.113% 0.016 74.427);
  --color-warning-container: oklch(35% 0.06 80);
  --color-on-warning-container: oklch(90% 0.06 80);

  --color-error: oklch(46.38% 0.1898 29.17);
  --color-error-content: oklch(86.38% 0.298 39.17);
  --color-error-container: oklch(30% 0.08 25);
  --color-on-error-container: oklch(88% 0.06 25);

  /* Base Scale */
  --color-base-100: oklch(22% 0.019 237.69);
  --color-base-200: oklch(20% 0.019 237.69);
  --color-base-300: oklch(18% 0.019 237.69);
  --color-base-400: oklch(26% 0.019 237.69);
  --color-base-500: oklch(32% 0.019 237.69);
  --color-base-600: oklch(40% 0.018 237.69);
  --color-base-700: oklch(55% 0.017 237.69);
  --color-base-800: oklch(70% 0.016 237.69);
  --color-base-900: oklch(85% 0.015 237.69);
  --color-base-content: oklch(77.383% 0.043 245.096);

  /* Accent & Neutral */
  --color-accent: oklch(75.65% 0.1303 335.51);
  --color-accent-content: oklch(14.258% 0.033 299.844);
  --color-neutral: oklch(23% 0 0);
  --color-neutral-content: oklch(52.43% 0 0);
  --color-neutral-variant: oklch(55% 0.01 260);

  /* Outline */
  --color-outline: oklch(44% 0.01 260);
  --color-outline-variant: oklch(35% 0.01 260);

  /* Inverse */
  --color-inverse-surface: oklch(95% 0.01 260);
  --color-inverse-on-surface: oklch(25% 0.02 260);
  --color-inverse-primary: oklch(55% 0.16 255);

  /* Shadow & Scrim */
  --color-shadow: oklch(0% 0 0);
  --color-scrim: oklch(0% 0 0 / 60%);

  /* Shape */
  --radius-selector: 0rem;
  --radius-field: 0.5rem;
  --radius-box: 2rem;
  --size-selector: 0.1875rem;
  --size-field: 0.1875rem;
  --border: 0.5px;
  --depth: 1;
  --noise: 1;
}

Usage

Apply a Theme

<!-- Light theme -->
<html data-theme="sunshine">

<!-- Dark theme -->
<html data-theme="moonlight">

<!-- Auto (follows system preference) -->
<html>

Theme Switching

// Toggle between themes
function toggleTheme() {
  const html = document.documentElement;
  const current = html.getAttribute('data-theme');
  html.setAttribute('data-theme', current === 'sunshine' ? 'moonlight' : 'sunshine');
}

// Respect system preference
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.setAttribute('data-theme', prefersDark ? 'moonlight' : 'sunshine');

Use Color Tokens

<!-- Background colors -->
<div class="bg-primary">Primary background</div>
<div class="bg-surface-container">Surface container</div>

<!-- Text colors -->
<p class="text-on-surface">Main text</p>
<p class="text-on-surface-variant">Secondary text</p>

<!-- Borders -->
<div class="border border-outline">Outlined element</div>