Skip to main content

parse_clip_rect

Function parse_clip_rect 

Source
pub fn parse_clip_rect(
    input: &str,
) -> Result<StyleClipRect, StyleClipRectParseError<'_>>
Expand description

Parses a StyleClipRect from a string slice.

Accepts:

  • auto โ€” equivalent to rect(auto, auto, auto, auto).
  • rect(<top>, <right>, <bottom>, <left>) โ€” comma-separated form.
  • rect(<top> <right> <bottom> <left>) โ€” legacy space-separated form.

Each edge is either auto or a <length>. Negative lengths are permitted.

ยงErrors

Returns an error if input is not a valid CSS clip-rect value.