Skip to main content

parse_origin_component

Function parse_origin_component 

Source
pub fn parse_origin_component(s: &str) -> Option<ParsedLength>
Expand description

Parse a CSS length/percentage string that may also contain transform-origin axis keywords (left, center, right, top, bottom).

Keywords are normalised to ParsedLength::Percent so that the regular resolve machinery handles them — the caller must still choose the correct axis dimension (width for x, height for y) in the LengthContext.