diff --git a/README.md b/README.md index 40a9bfaea..7f3478c0d 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,8 @@ Sass to update the reference behavior. 13. The reference combinator is not supported. See [issue 303][]. +14. Universal selector unification is symmetrical. See [issue 2247][]. + [issue 1599]: https://github.com/sass/sass/issues/1599 [issue 1126]: https://github.com/sass/sass/issues/1126 [issue 2120]: https://github.com/sass/sass/issues/2120 @@ -191,5 +193,6 @@ Sass to update the reference behavior. [issue 2228]: https://github.com/sass/sass/issues/2228 [issue 2245]: https://github.com/sass/sass/issues/2245 [issue 303]: https://github.com/sass/sass/issues/303 +[issue 2247]: https://github.com/sass/sass/issues/2247 Disclaimer: this is not an official Google product. diff --git a/lib/src/ast/selector/pseudo.dart b/lib/src/ast/selector/pseudo.dart index 4bccbe18a..2bded677e 100644 --- a/lib/src/ast/selector/pseudo.dart +++ b/lib/src/ast/selector/pseudo.dart @@ -84,6 +84,9 @@ class PseudoSelector extends SimpleSelector { } List unify(List compound) { + if (compound.length == 1 && compound.first is UniversalSelector) { + return compound.first.unify([this]); + } if (compound.contains(this)) return compound; var result = []; diff --git a/lib/src/ast/selector/simple.dart b/lib/src/ast/selector/simple.dart index 25dfb9930..22d31dfb1 100644 --- a/lib/src/ast/selector/simple.dart +++ b/lib/src/ast/selector/simple.dart @@ -56,6 +56,9 @@ abstract class SimpleSelector extends Selector { /// Returns `null` if unification is impossible—for example, if there are /// multiple ID selectors. List unify(List compound) { + if (compound.length == 1 && compound.first is UniversalSelector) { + return compound.first.unify([this]); + } if (compound.contains(this)) return compound; var result = [];