UI: .uitheme theme asset

Goal

Introduce a serializable .uitheme asset that represents the visual theme of the UI system. The asset allows the entire application or game to change its appearance without modifying code, enabling designers to author and swap themes directly from the editor.

The initial implementation focuses on serializing DVUI's Theme structure as JSON. Future iterations may extend the format with additional editor-specific metadata and asset references.

Context / integration points

  • MVP (#47 ) hardcodes the active UI theme.
  • DVUI already exposes a Theme structure describing colors, spacing, typography, borders, etc.
  • Turian currently has no dedicated theme asset type.
  • The editor should treat themes like any other project asset (create, rename, duplicate, inspect, reference).
  • This issue intentionally does not depend on a font asset system (#XXX). Theme fonts initially reference system fonts or built-in font names.

Design

  • Introduce a new asset type: .uitheme.
  • Serialize and deserialize DVUI's Theme structure using JSON.
  • Support loading themes through the Asset Database.
  • The active UI root references a Theme asset.
  • Expose all editable properties through the Inspector.
  • Allow switching themes at runtime by replacing the loaded asset.
  • Keep the asset format stable and human-readable.

Future versions may:

  • Reference Font assets instead of font names.
  • Support inheritance or theme variants.
  • Support project-wide default themes.
  • Support light/dark theme switching.

Tasks

  • Define the .uitheme asset type.
  • Implement JSON serialization/deserialization.
  • Integrate loading with the Asset Database.
  • Create an Inspector editor for Theme properties.
  • Allow UI roots to reference Theme assets.
  • Support hot reload when the asset changes.
  • Add default theme templates.

Acceptance criteria

  • Theme assets appear in the Asset Browser.
  • Double-clicking opens the Inspector.
  • Editing values immediately updates previewed UI.
  • Projects can contain multiple themes.
  • UI can swap themes without recompilation.

Dependencies

Independent.

Later integrates with the Font Asset system.

Out of scope

  • Font asset references.
  • Theme inheritance.
  • Runtime animation between themes.
  • Per-widget theme overrides.
Edited by Bruno Massa