pub struct Compiler { /* private fields */ }
Expand description

CSS Modules compiler.

Intended to be used inside build script.

Example:

// build.rs

fn main() {
    css_mod::Compiler::new()
        .add_modules("src/**/*.css").unwrap()
        .compile("assets/app.css").unwrap();
}

Implementations

Adds CSS module to compile.

Arguments:

  • path: File path, which may be absolute or relative to package root directory.

Adds CSS modules to compile.

Arguments:

  • pattern: Glob pattern, which may be absolute or relative to package root directory.

Parses and transforms input CSS modules.

Generates CSS bundle file ready to include in HTML page, and name mappings rust code ready to include into rust project with css_mod::init!().

Arguments:

  • css_bundle_path: File path for output CSS bundle, which may be absolute or relative to package root directory.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.