mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-10 06:48:36 +01:00
e8756eb02d
This shaves off a significant amount of time, since now we don't have to do what is essentially a full copy of the CSS tree. We may want to use interfaces to provide an immutable view of the CSS tree for use outside of the perform visitor.
28 lines
755 B
Dart
28 lines
755 B
Dart
// Copyright 2016 Google Inc. Use of this source code is governed by an
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
import 'package:source_span/source_span.dart';
|
|
|
|
import '../../visitor/css.dart';
|
|
import 'node.dart';
|
|
import 'value.dart';
|
|
|
|
class CssAtRule extends CssParentNode {
|
|
final String name;
|
|
|
|
final CssValue<String> value;
|
|
|
|
final FileSpan span;
|
|
|
|
CssAtRule(this.name, {this.value, this.span});
|
|
|
|
/*=T*/ accept/*<T>*/(CssVisitor/*<T>*/ visitor) =>
|
|
visitor.visitAtRule(this);
|
|
|
|
String toString() {
|
|
var buffer = new StringBuffer("@$name");
|
|
if (value != null) buffer.write(" $value");
|
|
return children == null ? "$buffer;" : "$buffer {${children.join(" ")}}";
|
|
}
|
|
} |