Skip to main content

Module design

Module design 

Source
Expand description

Which design system the Renderer resolved the theme to, and the registrations a runtime wakes its readers through.

The theme names a system or asks for the platform’s, and the answer is worked out in the Renderer where the platform is known. Most screens never need it: colour, shape, spacing and type are roles, and a role is the same declaration whatever answers it.

What roles cannot carry is a screen that is a different screen. Apple’s calculator has no memory row and clears with AC; Windows’ has one and clears with C. Both are calculators and neither is a restyling of the other.

So the Renderer reports its answer the way it reports a size class: once, and again only when the answer changes. This module is that value plus the readers that asked to be told. How a reader asks is the authoring layer’s: the Dioxus adapter’s use_design_system hook holds a DesignSystemSubscription.

Structs§

DesignSystemSubscription
A registration for changes to the resolved design system. Dropping it ends the registration, so a runtime keeps it for as long as the reader it wakes is alive: with a component’s hook state, or a scope’s remembered values.

Functions§

design_system
The system the Renderer last reported. Available outside a component too.
subscribe
Registers notify to be called each time the Renderer reports a different design system. What notify does is the runtime’s business: mark a scope dirty, most often.