Compile topic

APIs for compiling Sass source files to CSS, and providing options for that compilation.

Classes

AsyncCallable Compile
An interface for functions and mixins that can be invoked from Sass by passing in arguments.
Callable Compile
An interface for functions and mixins that can be invoked from Sass by passing in arguments.
CompileResult Compile
The result of compiling a Sass document to CSS, along with metadata about the compilation process.
Logger Compile
An interface for loggers that print messages produced by Sass stylesheets.

Functions

compile(String path, {bool color = false, Logger? logger, Iterable<Importer>? importers, Iterable<String>? loadPaths, PackageConfig? packageConfig, Iterable<Callable>? functions, OutputStyle? style, bool quietDeps = false, bool verbose = false, void sourceMap(SingleMapping map)?, bool charset = true}) String Compile
Like compileToResult, but returns CompileResult.css rather than returning CompileResult directly.
compileAsync(String path, {bool color = false, Logger? logger, Iterable<AsyncImporter>? importers, PackageConfig? packageConfig, Iterable<String>? loadPaths, Iterable<AsyncCallable>? functions, OutputStyle? style, bool quietDeps = false, bool verbose = false, void sourceMap(SingleMapping map)?}) Future<String> Compile
Like compile, except it runs asynchronously.
compileString(String source, {Syntax? syntax, bool color = false, Logger? logger, Iterable<Importer>? importers, PackageConfig? packageConfig, Iterable<String>? loadPaths, Iterable<Callable>? functions, OutputStyle? style, Importer? importer, Object? url, bool quietDeps = false, bool verbose = false, void sourceMap(SingleMapping map)?, bool charset = true, bool indented = false}) String Compile
Like compileStringToResult, but returns CompileResult.css rather than returning CompileResult directly.
compileStringAsync(String source, {Syntax? syntax, bool color = false, Logger? logger, Iterable<AsyncImporter>? importers, PackageConfig? packageConfig, Iterable<String>? loadPaths, Iterable<AsyncCallable>? functions, OutputStyle? style, AsyncImporter? importer, Object? url, bool quietDeps = false, bool verbose = false, void sourceMap(SingleMapping map)?, bool charset = true, bool indented = false}) Future<String> Compile
Like compileString, except it runs asynchronously.
compileStringToResult(String source, {Syntax? syntax, bool color = false, Logger? logger, Iterable<Importer>? importers, PackageConfig? packageConfig, Iterable<String>? loadPaths, Iterable<Callable>? functions, OutputStyle? style, Importer? importer, Object? url, bool quietDeps = false, bool verbose = false, bool sourceMap = false, bool charset = true, Iterable<Deprecation>? silenceDeprecations, Iterable<Deprecation>? fatalDeprecations, Iterable<Deprecation>? futureDeprecations}) CompileResult Compile
Compiles source to CSS and returns a CompileResult containing the CSS and additional metadata about the compilation..
compileStringToResultAsync(String source, {Syntax? syntax, bool color = false, Logger? logger, Iterable<AsyncImporter>? importers, PackageConfig? packageConfig, Iterable<String>? loadPaths, Iterable<AsyncCallable>? functions, OutputStyle? style, AsyncImporter? importer, Object? url, bool quietDeps = false, bool verbose = false, bool sourceMap = false, bool charset = true, Iterable<Deprecation>? silenceDeprecations, Iterable<Deprecation>? fatalDeprecations, Iterable<Deprecation>? futureDeprecations}) Future<CompileResult> Compile
Like compileStringToResult, except it runs asynchronously.
compileToResult(String path, {bool color = false, Logger? logger, Iterable<Importer>? importers, Iterable<String>? loadPaths, PackageConfig? packageConfig, Iterable<Callable>? functions, OutputStyle? style, bool quietDeps = false, bool verbose = false, bool sourceMap = false, bool charset = true, Iterable<Deprecation>? silenceDeprecations, Iterable<Deprecation>? fatalDeprecations, Iterable<Deprecation>? futureDeprecations}) CompileResult Compile
Loads the Sass file at path, compiles it to CSS, and returns a CompileResult containing the CSS and additional metadata about the compilation.
warn(String message, {bool deprecation = false}) → void Compile
Prints a warning message associated with the current @import or function call.

Enums

OutputStyle Compile
An enum of generated CSS styles.
Syntax Compile
An enum of syntaxes that Sass can parse.

Exceptions / Errors

SassException Compile
An exception thrown by Sass.