mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-23 06:12: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 `@`.
|
/// [start] should point before the `@`.
|
||||||
AtRootRule _atRootRule(LineScannerState start) {
|
AtRootRule _atRootRule(LineScannerState start) {
|
||||||
var next = scanner.peekChar();
|
if (scanner.peekChar() == $lparen) {
|
||||||
var query = next == $hash || next == $lparen ? _queryExpression() : null;
|
var query = _queryExpression();
|
||||||
whitespace();
|
whitespace();
|
||||||
return new AtRootRule(children(_ruleChild), scanner.spanFrom(start),
|
return new AtRootRule(children(_ruleChild), scanner.spanFrom(start),
|
||||||
query: query);
|
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.
|
/// Consumes a `@content` rule.
|
||||||
|
@ -178,6 +178,8 @@ class _PerformVisitor
|
|||||||
///
|
///
|
||||||
/// Otherwise, this leaves [nodes] as-is and returns [_root].
|
/// Otherwise, this leaves [nodes] as-is and returns [_root].
|
||||||
CssParentNode _trimIncluded(List<CssParentNode> nodes) {
|
CssParentNode _trimIncluded(List<CssParentNode> nodes) {
|
||||||
|
if (nodes.isEmpty) return _root;
|
||||||
|
|
||||||
var parent = _parent;
|
var parent = _parent;
|
||||||
int innermostContiguous;
|
int innermostContiguous;
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user