Struct grass::Options

source ·
pub struct Options<'a> { /* private fields */ }
Expand description

Configuration for Sass compilation

The simplest usage is grass::Options::default(); however, a builder pattern is also exposed to offer more control.

Implementations§

This option allows you to control the file system that Sass will see.

By default, it uses StdFs, which is backed by std::fs, allowing direct, unfettered access to the local file system.

grass currently offers 2 different output styles

By default, output is expanded.

This flag tells Sass not to emit any warnings when compiling. By default, Sass emits warnings when deprecated features are used or when the @warn rule is encountered. It also silences the @debug rule.

By default, this value is false and warnings are emitted.

All Sass implementations allow users to provide load paths: paths on the filesystem that Sass will look in when locating modules. For example, if you pass node_modules/susy/sass as a load path, you can use @import "susy" to load node_modules/susy/sass/susy.scss.

Imports will always be resolved relative to the current file first, though. Load paths will only be used if no relative file exists that matches the module’s URL. This ensures that you can’t accidentally mess up your relative imports when you add a new library.

This method will append a single path to the list.

Append multiple loads paths

Note that this method does not remove existing load paths

See Options::load_path for more information about load paths

This flag tells Sass whether to emit a @charset declaration or a UTF-8 byte-order mark.

By default, Sass will insert either a @charset declaration (in expanded output mode) or a byte-order mark (in compressed output mode) if the stylesheet contains any non-ASCII characters.

This flag tells Sass only to emit ASCII characters as part of error messages.

By default Sass will emit non-ASCII characters for these messages.

This flag does not affect the CSS output.

This option forces Sass to parse input using the given syntax.

By default, Sass will attempt to read the file extension to determine the syntax. If this is not possible, it will default to InputSyntax::Scss

This flag only affects the first file loaded. Files that are loaded using @import, @use, or @forward will always have their syntax inferred.

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.