sass library Null safety

We strongly recommend importing this library with the prefix sass.

Classes

Argument AST
An argument declared as part of an ArgumentDeclaration.
ArgumentDeclaration AST Parsing
An argument declaration, as for a function or mixin definition.
ArgumentInvocation AST
A set of arguments passed in to a function or mixin.
AstNode AST
A node in an abstract syntax tree. [...]
AsyncCallable
An interface for functions and mixins that can be invoked from Sass by passing in arguments. [...]
AsyncImportCache Dependencies
An in-memory cache of parsed stylesheets that have been imported by Sass.
AsyncImporter
An interface for importers that resolves URLs in @imports to the contents of Sass files. [...]
AtRootRule AST
An @at-root rule. [...]
AtRule AST
An unknown at-rule.
BinaryOperationExpression AST
A binary operator, as in 1 + 2 or $this and $other.
BinaryOperator AST
A binary operator constant.
BooleanExpression AST
A boolean literal, true or false.
CalculationExpression AST
A calculation literal.
CalculationInterpolation Value
A string injected into a SassCalculation using interpolation. [...]
CalculationOperation Value
A binary operation that can appear in a SassCalculation.
CalculationOperator Value
An enumeration of possible operators for CalculationOperation.
Callable
An interface for functions and mixins that can be invoked from Sass by passing in arguments. [...]
CallableDeclaration AST
An abstract class for callables (functions or mixins) that are declared in user code.
CallableInvocation AST
An abstract class for invoking a callable (a function or mixin).
ColorExpression AST
A color literal.
CompileResult
The result of compiling a Sass document to CSS, along with metadata about the compilation process.
ConfiguredVariable AST
A variable configured by a with clause in a @use or @forward rule.
ContentBlock AST
An anonymous block of code that's invoked for a ContentRule.
ContentRule AST
A @content rule. [...]
DebugRule AST
A @debug rule. [...]
Declaration AST
A declaration (that is, a name: value pair).
DynamicImport AST
An import that will load a Sass file at runtime.
EachRule AST
An @each rule. [...]
ElseClause AST
An @else clause in an @if rule.
ErrorRule AST
An @error rule. [...]
Expression AST Parsing
A SassScript expression in a Sass syntax tree.
ExpressionVisitor<T> Visitor
An interface for visitors that traverse SassScript expressions. [...]
ExtendRule AST
An @extend rule. [...]
FilesystemImporter
An importer that loads files from a load path on the filesystem.
ForRule AST
A @for rule. [...]
ForwardRule AST
A @forward rule.
FunctionExpression AST
A function invocation. [...]
FunctionRule AST
A function declaration. [...]
IfClause AST
An @if or @else if clause in an @if rule.
IfExpression AST
A ternary expression. [...]
IfRule AST
An @if rule. [...]
IfRuleClause AST
The superclass of @if and @else clauses.
Import AST
An abstract superclass for different types of import.
ImportCache Dependencies
An in-memory cache of parsed stylesheets that have been imported by Sass.
Importer
An interface for importers that resolves URLs in @imports to the contents of Sass files. [...]
ImporterResult
The result of importing a Sass stylesheet, as returned by Importer.load.
ImportRule AST
An @import rule.
IncludeRule AST
A mixin invocation.
InterpolatedFunctionExpression AST
An interpolated function invocation. [...]
Interpolation AST
Plain text interpolated with Sass expressions.
ListExpression AST
A list literal.
ListSeparator Value
An enum of list separator types.
Logger
An interface for loggers that print messages produced by Sass stylesheets. [...]
LoudComment AST
A loud CSS-style comment.
MapExpression AST
A map literal.
MediaRule AST
A @media rule.
MixinRule AST
A mixin declaration. [...]
NullExpression AST
A null literal.
NumberExpression AST
A number literal.
OutputStyle
An enum of generated CSS styles.
PackageImporter
An importer that loads stylesheets from package: imports.
ParenthesizedExpression AST
An expression wrapped in parentheses.
ParentStatement<T extends List<Statement>?> AST
A Statement that can have child statements. [...]
RecursiveAstVisitor Visitor
A visitor that recursively traverses each statement and expression in a Sass AST. [...]
RecursiveStatementVisitor Visitor
A visitor that recursively traverses each statement in a Sass AST. [...]
ReturnRule AST
A @return rule. [...]
SassArgumentList Value
A SassScript argument list. [...]
SassBoolean Value
A SassScript boolean value.
SassCalculation Value
A SassScript calculation. [...]
SassColor Value
A SassScript color.
SassDeclaration AST
A common interface for any node that declares a Sass member.
SassDependency AST
A common interface for UseRules, ForwardRules, and DynamicImports.
SassFunction Value
A SassScript function reference. [...]
SassList Value
A SassScript list.
SassMap Value
A SassScript map.
SassNode AST
A node in the abstract syntax tree for an unevaluated Sass or SCSS file.
SassNumber Value
A SassScript number. [...]
SassReference AST
A common interface for any node that references a Sass member.
SassString Value
A SassScript string. [...]
SelectorExpression AST
A parent selector reference, &.
SilentComment AST
A silent Sass-style comment.
Statement AST
A statement in a Sass syntax tree.
StatementSearchVisitor<T> Visitor
A StatementVisitor whose visit* methods default to returning null, but which returns the first non-null value returned by any method. [...]
StatementVisitor<T> Visitor
An interface for visitors that traverse Sass statements. [...]
StaticImport AST
An import that produces a plain CSS @import rule.
StringExpression AST
A string literal.
StyleRule AST
A style rule. [...]
Stylesheet AST Parsing
A Sass stylesheet. [...]
SupportsAnything AST
A supports condition that represents the forwards-compatible <general-enclosed> production.
SupportsCondition AST
An abstract class for defining the condition a @supports rule selects.
SupportsDeclaration AST
A condition that selects for browsers where a given declaration is supported.
SupportsFunction AST
A function-syntax condition.
SupportsInterpolation AST
An interpolated condition.
SupportsNegation AST
A negated condition.
SupportsOperation AST
An operation defining the relationship between two conditions.
SupportsRule AST
A @supports rule.
Syntax
An enum of syntaxes that Sass can parse.
UnaryOperationExpression AST
A unary operator, as in +$var or not fn().
UnaryOperator AST
A unary operator constant.
UseRule AST
A @use rule.
Value Value
A SassScript value. [...]
ValueExpression AST
An expression that directly embeds a Value. [...]
VariableDeclaration AST
A variable declaration. [...]
VariableExpression AST
A Sass variable.
WarnRule AST
A @warn rule. [...]
WhileRule AST
A @while rule. [...]

Extensions

SassApiColor Value
Extension methods that are only visible through the sass_api package. [...]

Constants

sassFalse → const SassBoolean Value
The SassScript false value. [...]
SassBoolean._(false)
sassNull → const Value Value
The SassScript null value. [...]
_SassNull()
sassTrue → const SassBoolean Value
The SassScript true value. [...]
SassBoolean._(true)

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. [...]
@Deprecated("Use compileToResult() instead.")
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. [...]
@Deprecated("Use compileToResultAsync() instead.")
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. [...]
@Deprecated("Use compileStringToResult() instead.")
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. [...]
@Deprecated("Use compileStringToResultAsync() instead.")
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}) 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}) 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}) 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}) Future<CompileResult>
Like compileToResult, except it runs asynchronously. [...]
findDependencies(Stylesheet stylesheet) Tuple2<List<Uri>, List<Uri>> Dependencies
Returns two lists of dependencies for stylesheet. [...]
isIdentifier(String text) bool Parsing
Returns whether text is a valid CSS identifier.
parseIdentifier(String text) String Parsing
Parses text as a CSS identifier and returns the result. [...]
warn(String message, {bool deprecation = false}) → void
Prints a warning message associated with the current @import or function call. [...]

Exceptions / Errors

SassException
An exception thrown by Sass.
SassFormatException Parsing
An exception thrown when Sass parsing has failed.