Compile topic

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

Classes

AsyncCallable
An interface for functions and mixins that can be invoked from Sass by passing in arguments.
Callable
An interface for functions and mixins that can be invoked from Sass by passing in arguments.
CompileResult
The result of compiling a Sass document to CSS, along with metadata about the compilation process.
Logger
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
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>
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
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>
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
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>
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
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
Prints a warning message associated with the current @import or function call.

Enums

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

Exceptions / Errors

SassException
An exception thrown by Sass.