From 0556665f64b68f72910c4eabcdba0feec7679ce4 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 18 May 2017 17:05:58 -0700 Subject: [PATCH] Fix @supports (not ...). (#125) --- CHANGELOG.md | 2 ++ lib/src/parse/stylesheet.dart | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f59a3fb8..ff565c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ * Fix a bug where Sass would crash with a "Bad state: no element" error on some rare `@extend` rules. +* Fix `not` in parentheses in `@supports` conditions. + ## 1.0.0-alpha.9 * Elements without a namespace (such as `div`) are no longer unified with diff --git a/lib/src/parse/stylesheet.dart b/lib/src/parse/stylesheet.dart index cc1c58fc..0e59a795 100644 --- a/lib/src/parse/stylesheet.dart +++ b/lib/src/parse/stylesheet.dart @@ -2524,7 +2524,10 @@ abstract class StylesheetParser extends Parser { if (next == $n || next == $N) { var negation = _trySupportsNegation(); - if (negation != null) return negation; + if (negation != null) { + scanner.expectChar($rparen); + return negation; + } } var name = _expression(); @@ -2551,6 +2554,7 @@ abstract class StylesheetParser extends Parser { return null; } + whitespace(); return new SupportsNegation( _supportsConditionInParens(), scanner.spanFrom(start)); }