sass library
We strongly recommend importing this library with the prefix sass
.
Classes
- AsyncCallable Compile
- An interface for functions and mixins that can be invoked from Sass by passing in arguments.
- AsyncImporter Importer
-
An interface for importers that resolves URLs in
@import
s to the contents of Sass files. - CalculationInterpolation Value
- A deprecated representation of a string injected into a SassCalculation using interpolation.
- CalculationOperation Value
- A binary operation that can appear in a SassCalculation.
- Callable Compile
- An interface for functions and mixins that can be invoked from Sass by passing in arguments.
- ColorSpace Value
- A color space whose channel names and semantics Sass knows.
- CompileResult Compile
- The result of compiling a Sass document to CSS, along with metadata about the compilation process.
- FilesystemImporter Importer
-
An importer that loads files from a load path on the filesystem, either
relative to the path passed to FilesystemImporter.new or absolute
file:
URLs. - GamutMapMethod Value
- Different algorithms that can be used to map an out-of-gamut Sass color into the gamut for its color space.
- Importer Importer
-
An interface for importers that resolves URLs in
@import
s to the contents of Sass files. - ImporterResult Importer
- The result of importing a Sass stylesheet, as returned by Importer.load.
- InterpolationMethod Value
- The method by which two colors are interpolated to find a color in the middle.
- Logger Compile
- An interface for loggers that print messages produced by Sass stylesheets.
- PackageImporter Importer
-
An importer that loads stylesheets from
package:
imports. - SassArgumentList Value
- A SassScript argument list.
- SassBoolean Value
- A SassScript boolean value.
- SassCalculation Value
- A SassScript calculation.
- SassColor Value
- A SassScript color.
- SassFunction Value
- A SassScript function reference.
- SassList Value
- A SassScript list.
- SassMap Value
- A SassScript map.
- SassMixin Value
- A SassScript mixin reference.
- SassNumber Value
- A SassScript number.
- SassString Value
- A SassScript string.
- Value Value
- A SassScript value.
Enums
- CalculationOperator Value
- An enumeration of possible operators for CalculationOperation.
- Deprecation
- A deprecated feature in the language.
- HueInterpolationMethod Value
- The method by which two hues are adjusted when interpolating between colors.
- ListSeparator Value
- An enum of list separator types.
- OutputStyle Compile
- An enum of generated CSS styles.
- Syntax Compile
- An enum of syntaxes that Sass can parse.
Extensions
- SassApiValue on Value Value
-
Extension methods that are only visible through the
sass_api
package.
Constants
- sassFalse → const SassBoolean Value
-
The SassScript
false
value. - sassNull → const Value Value
-
The SassScript
null
value. - sassTrue → const SassBoolean Value
-
The SassScript
true
value.
Functions
-
compile(
String path, {bool color = false, Logger? logger, Iterable< CompileImporter> ? 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< CompileAsyncImporter> ? 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< CompileImporter> ? 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< CompileAsyncImporter> ? 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< CompileImporter> ? 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< CompileAsyncImporter> ? 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< CompileImporter> ? 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. -
compileToResultAsync(
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, bool sourceMap = false, bool charset = true, Iterable<Deprecation> ? silenceDeprecations, Iterable<Deprecation> ? fatalDeprecations, Iterable<Deprecation> ? futureDeprecations}) → Future<CompileResult> - Like compileToResult, except it runs asynchronously.
-
fakeFromImport<
T> (T callback()) → T -
Runs
callback
in a context where AsyncImporter.fromImport returnstrue
. -
warn(
String message, {bool deprecation = false}) → void Compile -
Prints a warning message associated with the current
@import
or function call.
Exceptions / Errors
- SassException Compile
- An exception thrown by Sass.