Theme Tokens

Complete reference for all DuskMoonUI color tokens and design tokens

Theme Tokens

Complete reference for all CSS custom properties (design tokens) available in @duskmoon-dev/core themes.

Overview

Each theme defines 65+ color tokens plus shape and depth tokens. All color tokens are generated from @duskmoon-dev/design YAML files in OKLCH format.

/* Tokens are CSS custom properties on [data-theme] selectors */
[data-theme="sunshine"] {
  --color-primary: oklch(72% 0.17 75);
  /* ... */
}

Brand Colors (12 tokens)

TokenCSS VariableDescription
Primary--color-primaryMain brand color
Primary Content--color-primary-contentText on primary
Primary Container--color-primary-containerLighter primary for backgrounds
On Primary Container--color-on-primary-containerText on primary container
Secondary--color-secondarySecondary brand color
Secondary Content--color-secondary-contentText on secondary
Secondary Container--color-secondary-containerLighter secondary for backgrounds
On Secondary Container--color-on-secondary-containerText on secondary container
Tertiary--color-tertiaryTertiary accent color
Tertiary Content--color-tertiary-contentText on tertiary
Tertiary Container--color-tertiary-containerLighter tertiary for backgrounds
On Tertiary Container--color-on-tertiary-containerText on tertiary container

Usage

<div class="bg-primary text-primary-content">Primary surface</div>
<div class="bg-primary-container text-on-primary-container">Container</div>

Surface Colors (10 tokens)

TokenCSS VariableDescription
Surface--color-surfaceDefault background
Surface Dim--color-surface-dimDimmed background
Surface Bright--color-surface-brightBrighter background
Surface Container Lowest--color-surface-container-lowestLowest elevation
Surface Container Low--color-surface-container-lowLow elevation
Surface Container--color-surface-containerDefault elevation
Surface Container High--color-surface-container-highHigh elevation
Surface Container Highest--color-surface-container-highestHighest elevation
On Surface--color-on-surfaceText on surface
On Surface Variant--color-on-surface-variantSecondary text on surface

MD3 Elevation Mapping

Lowest → Low → Default → High → Highest
  (0)    (1)    (2)      (3)     (4)

Semantic Colors (16 tokens)

TokenCSS VariableDescription
Info--color-infoInformational state
Info Content--color-info-contentText on info
Info Container--color-info-containerInfo background
On Info Container--color-on-info-containerText on info container
Success--color-successSuccess state
Success Content--color-success-contentText on success
Success Container--color-success-containerSuccess background
On Success Container--color-on-success-containerText on success container
Warning--color-warningWarning state
Warning Content--color-warning-contentText on warning
Warning Container--color-warning-containerWarning background
On Warning Container--color-on-warning-containerText on warning container
Error--color-errorError state
Error Content--color-error-contentText on error
Error Container--color-error-containerError background
On Error Container--color-on-error-containerText on error container

Neutral Colors (10 tokens)

TokenCSS VariableDescription
Base 100--color-base-100Lightest neutral
Base 200--color-base-200Light neutral
Base 300-900--color-base-{N}Neutral scale
Base Content--color-base-contentDefault text color

Outline Colors (2 tokens)

TokenCSS VariableDescription
Outline--color-outlineDefault border color
Outline Variant--color-outline-variantSubtle border color

Accent Colors (2 tokens)

TokenCSS VariableDescription
Accent--color-accentAccent highlight
Accent Content--color-accent-contentText on accent

Neutral Colors (3 tokens)

TokenCSS VariableDescription
Neutral--color-neutralNeutral base
Neutral Content--color-neutral-contentText on neutral
Neutral Variant--color-neutral-variantMuted neutral

Inverse Colors (3 tokens)

TokenCSS VariableDescription
Inverse Surface--color-inverse-surfaceReversed surface
Inverse On Surface--color-inverse-on-surfaceText on inverse surface
Inverse Primary--color-inverse-primaryPrimary for inverse contexts

Shadow & Scrim (2 tokens)

TokenCSS VariableDescription
Shadow--color-shadowShadow color
Scrim--color-scrimOverlay backdrop

Elevation Shadows (6 tokens)

Theme-aware shadow tokens that use --color-shadow with color-mix() for proper opacity. These adapt automatically when switching themes.

TokenCSS VariableDescription
XS--shadow-xsSubtle elevation (1px)
SM--shadow-smLow elevation (cards)
MD--shadow-mdMedium elevation (dropdowns)
LG--shadow-lgHigh elevation (modals)
XL--shadow-xlHigher elevation
2XL--shadow-2xlMaximum elevation
<div class="shadow-sm">Low elevation card</div>
<div class="shadow-lg">Modal dialog</div>

MD3 Elevation Levels (6 tokens)

Semantic shadow tokens that map Material Design 3 elevation levels to shadow effects. These provide a hierarchy-based API on top of the size-based shadow tokens.

LevelCSS VariableMaps ToDescription
0--shadow-elevation-0noneFlat surface
1--shadow-elevation-1--shadow-xsSlight lift
2--shadow-elevation-2--shadow-smCard surface
3--shadow-elevation-3--shadow-mdDropdown/menu
4--shadow-elevation-4--shadow-lgDialog/modal
5--shadow-elevation-5--shadow-xlTop-level overlay
<!-- Utility classes -->
<div class="elevation-2">Card surface</div>
<div class="elevation-4">Modal dialog</div>

<!-- Tailwind shadow utilities -->
<div class="shadow-elevation-3">Dropdown menu</div>

Spacing Tokens

Generated from @duskmoon-dev/design YAML. Available as CSS custom properties on :root.

TokenCSS VariableValueDescription
Spacing 0–24--spacing-{N}0px96pxLayout spacing scale

Radius Tokens

TokenCSS VariableValueDescription
None--radius-none0pxNo rounding
XS--radius-xs4pxSubtle rounding
SM--radius-sm8pxSmall rounding
MD--radius-md12pxMedium rounding
LG--radius-lg16pxLarge rounding
XL--radius-xl20pxExtra large rounding
2XL--radius-2xl28pxMaximum rounding
Full--radius-full9999pxPill shape

Elevation Tokens

TokenCSS VariableValueDescription
Level 0--elevation-level00pxNo elevation
Level 1--elevation-level11pxSubtle lift
Level 2--elevation-level23pxCard elevation
Level 3--elevation-level36pxRaised elevation
Level 4--elevation-level48pxDialog elevation
Level 5--elevation-level512pxMaximum elevation

Focus / Hover States

Components use color-mix() to compute focus and hover states at runtime rather than dedicated focus tokens:

/* Hover state — darken by mixing with black */
.btn-primary:hover {
  background-color: color-mix(in oklch, var(--color-primary), black 10%);
}

/* Focus ring — semi-transparent currentColor */
.btn:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 20%, transparent);
}

Transparency

.custom-transparent {
  background-color: color-mix(in oklch, var(--color-primary) 50%, transparent);
}

Available Themes

ThemeModePrimary HueCharacter
sunshineLightWarm orangeEnergetic, warm
moonlightDarkSoft blueSerene, elegant
oceanDarkDeep blueCalm, immersive
forestLightRich greenNatural, grounded
sunsetLightWarm coralVibrant, expressive

Custom Themes

Override any token with a [data-theme] selector:

[data-theme="my-theme"] {
  color-scheme: light;
  --color-primary: oklch(62% 0.22 265);
  --color-primary-content: oklch(100% 0 0);
  /* ... define all tokens */
}

See Customization for full details.