Struct css::Stylesheet
[−]
[src]
pub struct Stylesheet { pub rules: CssRules, pub source_map_url: Option<String>, pub source_url: Option<String>, }
Represents an entire CSS stylesheet. The values of property declarations are currently stored as a string. Parsing property declarations is a monster job. If you feel like helping...
Fields
rules: CssRules
The stylesheet's rules.
source_map_url: Option<String>
An optional source map for this stylesheet.
source_url: Option<String>
An optional source URL for this stylesheet.
Methods
impl Stylesheet
[src]
fn to_css<W: Write>(
&self,
destination: &mut W,
include_source_urls: bool
) -> Result
[src]
&self,
destination: &mut W,
include_source_urls: bool
) -> Result
fn parse<'i>(
css: &'i str
) -> Result<Self, PreciseParseError<CustomParseError<'i>>>
[src]
css: &'i str
) -> Result<Self, PreciseParseError<CustomParseError<'i>>>
Parses a string of CSS to produce a stylesheet. Can be used with the contents of a CSS file. Assumes the string is UTF-8 encoded. Does not use a stream of bytes as parsing CSS involves going backwards and forwards a lot... CSS parsing is somewhat evil and is not particularly efficient. The parser does apply a few small modifications to the incoming CSS, normalizing some pseudo-class, psuedo-element and media query names. The parser does not parse properties as such, simply keeping them as a CSS string. Hopefully it will one day - there are only 200 odd specialist rules to implement.
Trait Implementations
impl Debug for Stylesheet
[src]
impl Clone for Stylesheet
[src]
fn clone(&self) -> Stylesheet
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more