mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 22:02:00 +01:00
Allow @at-root with selectors.
This commit is contained in:
parent
95508b2713
commit
9b05b1c24e
@ -425,11 +425,17 @@ abstract class StylesheetParser extends Parser {
|
||||
///
|
||||
/// [start] should point before the `@`.
|
||||
AtRootRule _atRootRule(LineScannerState start) {
|
||||
var next = scanner.peekChar();
|
||||
var query = next == $hash || next == $lparen ? _queryExpression() : null;
|
||||
if (scanner.peekChar() == $lparen) {
|
||||
var query = _queryExpression();
|
||||
whitespace();
|
||||
return new AtRootRule(children(_ruleChild), scanner.spanFrom(start),
|
||||
query: query);
|
||||
} else if (lookingAtChildren()) {
|
||||
return new AtRootRule(children(_ruleChild), scanner.spanFrom(start));
|
||||
} else {
|
||||
var child = _styleRule();
|
||||
return new AtRootRule([child], scanner.spanFrom(start));
|
||||
}
|
||||
}
|
||||
|
||||
/// Consumes a `@content` rule.
|
||||
|
@ -178,6 +178,8 @@ class _PerformVisitor
|
||||
///
|
||||
/// Otherwise, this leaves [nodes] as-is and returns [_root].
|
||||
CssParentNode _trimIncluded(List<CssParentNode> nodes) {
|
||||
if (nodes.isEmpty) return _root;
|
||||
|
||||
var parent = _parent;
|
||||
int innermostContiguous;
|
||||
var i = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user