Expand description
Layer priority for CssRuleBlock. Lower numbers cascade first;
higher numbers override earlier layers at the same specificity.
u8 leaves 256 slots, so a new layer can be inserted between any
two existing slots without renumbering consumers. The gaps between
named slots are intentional — fill them with custom intermediate
layers if/when @layer lands.
Constants§
- AUTHOR
- Default for parser-produced rules: the app author’s CSS.
Everything coming out of
Css::from_stringlives here. - INLINE
- Inline
style="..."/NodeData::set_css(...)rules — used once the inline-vs-component unification (separate plan) folds inline storage into the same Vec. - RUNTIME
- Reserved for direct-rule runtime overrides. Today the
prop_cache handles runtime overrides via
user_overridden_properties; this slot is reserved so a future “push a CssRuleBlock at runtime” path stays above inline. Used only when a callback writes a full rule, not a single property. - SYSTEM
- Stylesheets the host system reports (system fonts, theme CSS
derived from
SystemStyle). One step above UA so they win against framework defaults but lose against anything the app author writes. - UA
- User-Agent / framework defaults. Widget code that emits its own default CSS uses this. Lowest priority — anything else overrides it.