Expand description
CSS length/percentage units.
Supports: px, %, em, rem, vw, vh, fr, auto, plus a bare
number (interpreted as px).
Resolution to absolute pixels happens through LengthContext, which
carries the viewport dimensions, parent size (for %), and font sizes
(for em / rem).
Structs§
Enums§
- Length
- A pure CSS length, no percentage allowed (e.g.
font-size,box-shadow). - Length
Percentage - A CSS length OR percentage (e.g.
width,padding,top). - Parsed
Length - Internal parsed representation. Once parsed we know which unit it is.
Functions§
- parse_
length - Parse a CSS length/percentage string. Whitespace tolerated.
- parse_
origin_ component - Parse a CSS length/percentage string that may also contain transform-origin
axis keywords (
left,center,right,top,bottom).