Expand description
The values runtime systems hold on an element over what its styles say.
An element’s styles are a function of the cascade: the user-agent and skin
sheets, the app’s stylesheet, what its markup declares and what a script
set with set_style. A restyle recomputes them from all of that, so a
class removed takes with it every property only that class set.
Some values are not the cascade’s to decide. A hidden <if> is
display: none while its signal is false; an open popup sits where the
edge-flip put it; a virtualized row sits in its slot; a hovered button
fades toward its tint. The system that owns such a value holds it here,
in StyleOverrides, instead of writing the live component behind the
cascade’s back. The live components are always the cascade’s result with
every held value laid over it, so a restyle that recomputes the cascade
keeps them: it records the new resting values here and leaves the held
fields alone, and when a system lets go the field drops back to what the
cascade says now, not what it said when the system took hold.
Holders stack by StyleOwner::RANK: a press tint over a hover tint over
a toggle’s checked fill over the cascade. A holder that blends toward its
own value from whatever is under it (a tint fading in) reads that through
StyleOverrides::below.
Structs§
- Live
- The live components of one element, read when a holder takes a field nobody held yet: at that moment the live value is the cascade’s.
- Style
Fields - The style values a runtime system can hold on an element.
- Style
Overrides - The values runtime systems hold on one element; see the module docs.
- Style
Values - A value for some of the
StyleFields;Noneleaves a field out.
Traits§
- Style
Owner - A runtime system that holds style values on elements.
Functions§
- hold_on
- Hold
valuesforOon one element and write what it shows now: the form for a holder that reaches the element through the world rather than through a query. Inserts theStyleOverridesthe element lacks. - release_
on - Stop holding anything for
Oon one element and write what it shows now; seehold_on. - write_
on - Write
valuesonto an element’s live components, touching only what differs.