diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b090a20b..446259fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.50.0 +* `@extend` now treats [`:where()`] the same as `:is()`. + +[`:where()`]: https://developer.mozilla.org/en-US/docs/Web/CSS/:where + ### Command Line Interface * Closing the standard input stream will now cause the `--watch` command to stop diff --git a/lib/src/extend/extension_store.dart b/lib/src/extend/extension_store.dart index 1378bf7ac..316dd1718 100644 --- a/lib/src/extend/extension_store.dart +++ b/lib/src/extend/extension_store.dart @@ -831,14 +831,15 @@ class ExtensionStore { // become `.foo:not(.bar)`. However, this is a narrow edge case and // supporting it properly would make this code and the code calling it // a lot more complicated, so it's not supported for now. - if (innerPseudo.normalizedName != 'is' && - innerPseudo.normalizedName != 'matches') { + if (!const {'is', 'matches', 'where'} + .contains(innerPseudo.normalizedName)) { return []; } return innerSelector.components; case 'is': case 'matches': + case 'where': case 'any': case 'current': case 'nth-child': diff --git a/lib/src/extend/functions.dart b/lib/src/extend/functions.dart index b015233ce..8afb3112b 100644 --- a/lib/src/extend/functions.dart +++ b/lib/src/extend/functions.dart @@ -24,6 +24,7 @@ import '../utils.dart'; final _subselectorPseudos = { 'is', 'matches', + 'where', 'any', 'nth-child', 'nth-last-child' @@ -747,6 +748,7 @@ bool _selectorPseudoIsSuperselector( case 'is': case 'matches': case 'any': + case 'where': var selectors = _selectorPseudoArgs(compound2, pseudo1.name); return selectors .any((selector2) => selector1.isSuperselector(selector2)) || diff --git a/lib/src/parse/selector.dart b/lib/src/parse/selector.dart index 06f80cf62..77d156885 100644 --- a/lib/src/parse/selector.dart +++ b/lib/src/parse/selector.dart @@ -15,6 +15,7 @@ final _selectorPseudoClasses = { "not", "is", "matches", + "where", "current", "any", "has", diff --git a/pkg/sass_api/CHANGELOG.md b/pkg/sass_api/CHANGELOG.md index d17cedd2c..fec7dfb5b 100644 --- a/pkg/sass_api/CHANGELOG.md +++ b/pkg/sass_api/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.0-beta.41 + +* No user-visible changes. + ## 1.0.0-beta.40 * No user-visible changes. diff --git a/pkg/sass_api/pubspec.yaml b/pkg/sass_api/pubspec.yaml index 757471f8f..ff82e71f8 100644 --- a/pkg/sass_api/pubspec.yaml +++ b/pkg/sass_api/pubspec.yaml @@ -2,7 +2,7 @@ name: sass_api # Note: Every time we add a new Sass AST node, we need to bump the *major* # version because it's a breaking change for anyone who's implementing the # visitor interface(s). -version: 1.0.0-beta.40 +version: 1.0.0-beta.41 description: Additional APIs for Dart Sass. homepage: https://github.com/sass/dart-sass @@ -10,7 +10,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: - sass: 1.49.11 + sass: 1.50.0 dependency_overrides: sass: {path: ../..} diff --git a/pubspec.yaml b/pubspec.yaml index 99a6d535f..4cc216bd0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.50.0-dev +version: 1.50.0 description: A Sass implementation in Dart. homepage: https://github.com/sass/dart-sass