Web theming

Semantic color tokens, themes, and component styling.

Archived Web reference

Semantic color tokens, themes, and component styling.

Archived Web development reference. These CSS rules apply to the Vue web player and site, not to native WinUI XAML. The current token files in the checkout take precedence over older examples.

Token layers

  1. src/styles/tokens/of-color-tokens.css defines brand, neutral, and semantic base values.
  2. of-theme-mapping.css maps those values to the active theme and light or dark color scheme.
  3. of-component-tokens.css supplies component-level roles.
  4. Components consume semantic --of-* values rather than hard-coded palette colors.

Use the token matching the meaning of a UI element: --of-danger-* for destructive actions, --of-playing-* for the playing state, --of-like-* for favorites, --of-pro-* for commercial badges, and --of-warm-* for marketing accents. Player-specific variants come from --of-player-* tokens. This keeps themes consistent when the user changes appearance.

Themes and color schemes

The web player supports its own theme choices, including Mist and Paper; some Material styling is reserved or under development. Light, dark, and system color schemes are distinct from the theme choice. WinUI’s native appearance is separate and does not automatically inherit Web tokens.

Cold-start appearance is applied before Vue mounts to reduce a flash of the wrong theme. src/composables/usePlayerColor.js derives player color variants, and a custom accent creates hover, active, soft, and border values. In dark mode, derive adjusted variants rather than reusing the light ones unchanged.

Extending a theme

Add values at the theme mapping layer, then style components against semantic roles. Do not introduce a new hard-coded color in a Vue component. Keep scoped component rules for local layout and interactions; reserve global rules for shared page foundations. Check contrast, hover, focus, disabled, and destructive states in both color schemes. Respect reduced-motion preferences and verify that transitions do not delay basic controls.