mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-03 18:17:45 +01:00
Fix blank lists in property values.
This commit is contained in:
parent
870a2a4f4a
commit
c44481ba29
@ -245,7 +245,7 @@ class _PerformVisitor implements StatementVisitor, ExpressionVisitor<Value> {
|
|||||||
// If the value is an empty list, preserve it, because converting it to CSS
|
// If the value is an empty list, preserve it, because converting it to CSS
|
||||||
// will throw an error that we want the user to see.
|
// will throw an error that we want the user to see.
|
||||||
if (cssValue != null &&
|
if (cssValue != null &&
|
||||||
(!cssValue.value.isBlank || cssValue.value is SassList)) {
|
(!cssValue.value.isBlank || _isEmptyList(cssValue.value))) {
|
||||||
_parent.addChild(new CssDeclaration(name, cssValue, node.span));
|
_parent.addChild(new CssDeclaration(name, cssValue, node.span));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,6 +259,9 @@ class _PerformVisitor implements StatementVisitor, ExpressionVisitor<Value> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns whether [value] is an empty [SassList].
|
||||||
|
bool _isEmptyList(Value value) => value is List && value.contents.isEmpty;
|
||||||
|
|
||||||
Value visitEachRule(EachRule node) {
|
Value visitEachRule(EachRule node) {
|
||||||
var list = node.list.accept(this);
|
var list = node.list.accept(this);
|
||||||
var setVariables = node.variables.length == 1
|
var setVariables = node.variables.length == 1
|
||||||
|
Loading…
Reference in New Issue
Block a user