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

The stylesheet's rules.

An optional source map for this stylesheet.

An optional source URL for this stylesheet.

Methods

impl Stylesheet
[src]

[src]

Serializes a Stylesheet to a file path, optionally including source-map and source-url comments. Will create or truncate stylesheet_file_path as required. Convenience method wrapped to_css().

[src]

Serializes a Stylesheet as a string, optionally including source-map and source-url comments. Convenience method wrapped to_css().

[src]

Serializes a Stylesheet to a vector of UTF-8 encoded bytes. Convenience method wrapped to_css_string().

[src]

Serializes a Stylesheet, optionally including source-map and source-url comments.

[src]

Loads and parses a Stylesheet.

[src]

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]

[src]

Formats the value using the given formatter.

impl Clone for Stylesheet
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl HasCssRules for Stylesheet
[src]

[src]

[src]

[src]

[src]

[src]