Skip to main content

apply_css_with_media

Function apply_css_with_media 

Source
pub fn apply_css_with_media(
    ir: &mut LayoutIR,
    css: &Stylesheet,
    media: &MediaContext,
) -> Result<Vec<CssWarning>, ParseError>
Expand description

Same as apply_css but honours @media blocks against the given MediaContext.

A bad declaration (unknown property, unparseable value, unresolvable var()) is skipped and reported as a CssWarning - it never takes down the rest of the stylesheet, matching CSS error-recovery semantics. The returned list is deduplicated, so a rule that matches a thousand elements reports each defect once.