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§
source§impl<'a> Options<'a>
impl<'a> Options<'a>
sourcepub const fn style(self, style: OutputStyle) -> Self
pub const fn style(self, style: OutputStyle) -> Self
grass
currently offers 2 different output styles
OutputStyle::Expanded
writes each selector and declaration on its own line.OutputStyle::Compressed
removes as many extra characters as possible and writes the entire stylesheet on a single line.
By default, output is expanded.
sourcepub const fn quiet(self, quiet: bool) -> Self
pub const fn quiet(self, quiet: bool) -> Self
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.
sourcepub fn load_path<P: AsRef<Path>>(self, path: P) -> Self
pub fn load_path<P: AsRef<Path>>(self, path: P) -> Self
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.
sourcepub fn load_paths<P: AsRef<Path>>(self, paths: &[P]) -> Self
pub fn load_paths<P: AsRef<Path>>(self, paths: &[P]) -> Self
Append multiple loads paths
Note that this method does not remove existing load paths
See Options::load_path
for more information about
load paths
sourcepub const fn allows_charset(self, allows_charset: bool) -> Self
pub const fn allows_charset(self, allows_charset: bool) -> Self
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.
sourcepub const fn unicode_error_messages(self, unicode_error_messages: bool) -> Self
pub const fn unicode_error_messages(self, unicode_error_messages: bool) -> Self
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.
sourcepub const fn input_syntax(self, syntax: InputSyntax) -> Self
pub const fn input_syntax(self, syntax: InputSyntax) -> Self
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.