mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 05:41:14 +01:00
Implement CssNode.toString() using toCss().
This commit is contained in:
parent
e607e7914f
commit
cc56ea0f13
@ -15,6 +15,4 @@ class CssComment extends CssNode {
|
||||
CssComment(this.text, this.span);
|
||||
|
||||
/*=T*/ accept/*<T>*/(CssVisitor/*<T>*/ visitor) => visitor.visitComment(this);
|
||||
|
||||
String toString() => text;
|
||||
}
|
||||
|
@ -22,6 +22,4 @@ class CssDeclaration extends CssNode {
|
||||
|
||||
/*=T*/ accept/*<T>*/(CssVisitor/*<T>*/ visitor) =>
|
||||
visitor.visitDeclaration(this);
|
||||
|
||||
String toString() => "$name: $value;";
|
||||
}
|
||||
|
@ -72,16 +72,4 @@ class CssMediaQuery implements AstNode {
|
||||
modifier: modifier == ourModifier ? this.modifier : other.modifier,
|
||||
features: features.toList()..addAll(other.features));
|
||||
}
|
||||
|
||||
String toString() {
|
||||
var buffer = new StringBuffer();
|
||||
if (modifier != null) buffer.write("$modifier ");
|
||||
if (type != null) {
|
||||
buffer.write(type);
|
||||
if (features.isNotEmpty) buffer.write(" and ");
|
||||
}
|
||||
|
||||
buffer.write(features.join(" and "));
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import '../../visitor/interface/css.dart';
|
||||
import '../../visitor/serialize.dart';
|
||||
import '../node.dart';
|
||||
|
||||
abstract class CssNode extends AstNode {
|
||||
@ -25,6 +26,8 @@ abstract class CssNode extends AstNode {
|
||||
_parent._children[i]._indexInParent--;
|
||||
}
|
||||
}
|
||||
|
||||
String toString() => toCss(this);
|
||||
}
|
||||
|
||||
// New at-rule implementations should add themselves to at-root's exclude logic.
|
||||
|
@ -20,6 +20,4 @@ class CssStyleRule extends CssParentNode {
|
||||
visitor.visitStyleRule(this);
|
||||
|
||||
CssStyleRule copyWithoutChildren() => new CssStyleRule(selector, span);
|
||||
|
||||
String toString() => "$selector {${children.join(" ")}}";
|
||||
}
|
||||
|
@ -16,6 +16,4 @@ class CssStylesheet extends CssParentNode {
|
||||
visitor.visitStylesheet(this);
|
||||
|
||||
CssStylesheet copyWithoutChildren() => new CssStylesheet(span);
|
||||
|
||||
String toString() => children.join(" ");
|
||||
}
|
||||
|
@ -12,6 +12,4 @@ class CssValue<T> implements AstNode {
|
||||
final FileSpan span;
|
||||
|
||||
CssValue(this.value, this.span);
|
||||
|
||||
String toString() => value.toString();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user