AshUi.Verifiers.StylesheetResolution (ash_ui v0.1.0)

Copy Markdown View Source

Compile-time stylesheet resolution discipline (DESIGN.md §9).

  • A document-producing (routed) resource must have effective stylesheets: either locally declared via ash_ui do stylesheets [...] end, or SUPPLIED by a substrate extension through the supplier seam.
  • Supplied + locally declared is a conflict — one assembly channel only.
  • A non-routed (embedded/component) resource must not declare stylesheets; it is covered by the pages that mount it.

The supplier seam

A substrate extension's transformer supplies the effective stylesheets by persisting {:ash_ui, :supplied_stylesheets} with a list of paths:

dsl_state
|> Spark.Dsl.Transformer.persist(
  {:ash_ui, :supplied_stylesheets},
  ["platform/tokens.css", "skins/mail.css"]
)

When that marker is a list, it becomes the resource's effective stylesheet set (persisted as :ash_ui_stylesheets and returned by AshUi.Info.stylesheets/1); the resource must then declare none locally. There are no default stylesheets and no runtime fallbacks.