mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 12:44:42 +01:00
Fix @import with supports().
This commit is contained in:
parent
9031a7f554
commit
eab36eafe5
@ -6,6 +6,8 @@
|
||||
|
||||
* Properly handle variable scoping in `@at-root` and nested properties.
|
||||
|
||||
* Fix `@import` with a `supports()` clause.
|
||||
|
||||
## 1.0.0-alpha.8
|
||||
|
||||
* Add the `content-exists()` function.
|
||||
|
@ -690,9 +690,8 @@ abstract class StylesheetParser extends Parser {
|
||||
whitespace();
|
||||
var queries = _tryImportQueries();
|
||||
if (_isPlainImportUrl(url)) {
|
||||
var interpolation =
|
||||
new Interpolation([scanner.substring(start.position)], urlSpan);
|
||||
return new StaticImport(interpolation, scanner.spanFrom(start),
|
||||
return new StaticImport(
|
||||
new Interpolation([urlSpan.text], urlSpan), scanner.spanFrom(start),
|
||||
supports: queries?.item1, media: queries?.item2);
|
||||
} else if (_inControlDirective || _inMixin) {
|
||||
_disallowedAtRule(ruleStart);
|
||||
@ -729,6 +728,8 @@ abstract class StylesheetParser extends Parser {
|
||||
whitespace();
|
||||
supports = new SupportsNegation(
|
||||
_supportsConditionInParens(), scanner.spanFrom(start));
|
||||
} else if (scanner.peekChar() == $lparen) {
|
||||
supports = _supportsCondition();
|
||||
} else {
|
||||
var name = _expression();
|
||||
scanner.expectChar($colon);
|
||||
|
@ -618,7 +618,7 @@ class _PerformVisitor
|
||||
var url = _interpolationToValue(import.url);
|
||||
var supports = import.supports;
|
||||
var resolvedSupports = supports is SupportsDeclaration
|
||||
? "${supports.name.accept(this).toCssString()}: "
|
||||
? "(${supports.name.accept(this).toCssString()}: "
|
||||
"${supports.value.accept(this).toCssString()})"
|
||||
: (supports == null ? null : _visitSupportsCondition(supports));
|
||||
var mediaQuery =
|
||||
@ -627,7 +627,7 @@ class _PerformVisitor
|
||||
var node = new CssImport(url, import.span,
|
||||
supports: resolvedSupports == null
|
||||
? null
|
||||
: new CssValue(resolvedSupports, import.supports.span),
|
||||
: new CssValue("supports($resolvedSupports)", import.supports.span),
|
||||
media: mediaQuery);
|
||||
|
||||
if (_parent != _root) {
|
||||
|
Loading…
Reference in New Issue
Block a user