Skip to main content

parse_stylesheet

Function parse_stylesheet 

Source
pub fn parse_stylesheet(input: &str) -> Stylesheet
Expand description

Parse a CSS string into a Stylesheet (§5.4.3).

Implements parse a stylesheet from CSS Syntax §5.4.3: tokenize the input (with §5.3 preprocessing), then consume a stylesheet's contents (§5.5.1) to produce the list of rules.

§Examples

use muskitty_css_parser::parse_stylesheet;

let ss = parse_stylesheet("a { color: red; }");
assert_eq!(ss.rules.len(), 1);