PrinterOptions

Type Alias PrinterOptions 

Source
pub type PrinterOptions<'a> = PrinterOptions<'a>;
Expand description

Options that control how attributes and CSS values are serialized

Aliased Type§

pub struct PrinterOptions<'a> {
    pub minify: bool,
    pub project_root: Option<&'a str>,
    pub targets: Targets,
    pub analyze_dependencies: Option<DependencyOptions>,
    pub pseudo_classes: Option<PseudoClasses<'a>>,
}

Fields§

§minify: bool

Whether to minify the CSS, i.e. remove white space.

§project_root: Option<&'a str>

An optional project root path, used to generate relative paths for sources used in CSS module hashes.

§targets: Targets

Targets to output the CSS for.

§analyze_dependencies: Option<DependencyOptions>

Whether to analyze dependencies (i.e. @import and url()). If true, the dependencies are returned as part of the ToCssResult.

When enabled, @import and url() dependencies are replaced with hashed placeholders that can be replaced with the final urls later (after bundling).

§pseudo_classes: Option<PseudoClasses<'a>>

A mapping of pseudo classes to replace with class names that can be applied from JavaScript. Useful for polyfills, for example.