Skip to main content

Module css_vars

Module css_vars 

Source
Expand description

CSS var(--name [, fallback]) resolver shared by the cascade in crate::css and the runtime’s IR loader.

Structs§

LenientResolution
Outcome of resolve_lenient: the substituted text plus a human-readable message for every var() call that could not resolve, in the order encountered. warnings is empty when every call resolved.

Functions§

resolve
Recursively replaces every var(--name) and var(--name, fallback) substring in src with the matching entry from vars.
resolve_lenient
Same substitution as resolve, but never fails: an unresolvable var() call (unknown name with no fallback, unterminated call, or a recursion/cycle depth over 16) degrades to an empty string and records a message in LenientResolution::warnings, instead of aborting the rest of src.