Skip to content

Theme engine: applying and validating theme/package compatibility #5

Description

@einari

Context

Screenplay's theme construct declares compatible with <package>
relationships. Scene needs the runtime side: applying a theme's
styling/tokens to components from compatible packages, and surfacing the
compatibility warning when a profile pairs a theme with a package it
doesn't declare support for.

Proposal

  • Implement theme application as a token/styling layer resolved against
    the active ui profile's package list — Scene.React applies theme
    Aurora's tokens to PrimeReact and Internal.Widgets components
    specifically, not globally.
  • Surface the same compatibility warning at both design time (Studio's
    theme picker should filter to compatible themes before you can pick
    wrong) and build time (Stage should warn on a profile that pairs an
    incompatible theme/package combination).
  • Theme switching must be a live re-resolution against the same running
    profile — no reload — since this is required for the Studio gallery
    preview (see UI starter/gallery issue) to feel instantaneous.

Open questions

  • Token model shape (colors, spacing, typography, etc.) — needs its own
    design pass, out of scope for this issue beyond confirming it's owned
    here rather than per-renderer.

Dependencies

Depends on

Blocks

Part of the screen work — build order and full dependency map: #7


Implementation notes

Token application is Scene.React (it maps tokens onto real components from real packages). Compatibility validation is needed in C# too, because Stage must warn at build time (Cratis/Stage#39) and Studio must filter at design time (Cratis/StudioIssues#160) — so validate in the C# side next to Scene.Model and re-use the same rules in the engine, against a shared spec corpus. See #1.

The token model's own shape is explicitly out of scope here beyond confirming it is owned in Scene rather than per-renderer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    screenScreen/UI work: Screenplay UI constructs, Scene runtime, Stage rendering, Studio designers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions