Skip to content

Commit

Permalink
Fix :has(+ &) (#1938)
Browse files Browse the repository at this point in the history
Closes #1937
  • Loading branch information
nex3 authored Apr 19, 2023
1 parent c55235d commit 3091de5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.62.1

* Fix a bug where `:has(+ &)` and related constructs would drop the leading
combinator.

## 1.62.0

* Deprecate the use of multiple `!global` or `!default` flags on the same
Expand Down
13 changes: 12 additions & 1 deletion lib/src/ast/selector/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,18 @@ class SelectorList extends Selector {
}
}
} else if (newComplexes.isEmpty) {
newComplexes.addAll(resolved);
newComplexes.addAll(complex.leadingCombinators.isEmpty
? resolved
: resolved.map((resolvedComplex) => ComplexSelector(
resolvedComplex.leadingCombinators.isEmpty
? complex.leadingCombinators
: [
...complex.leadingCombinators,
...resolvedComplex.leadingCombinators
],
resolvedComplex.components,
complex.span,
lineBreak: resolvedComplex.lineBreak)));
} else {
var previousComplexes = newComplexes;
newComplexes = [
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.3.1

* No user-visible changes.

## 6.3.0

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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: 6.3.0
version: 6.3.1-dev
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=2.17.0 <3.0.0"

dependencies:
sass: 1.62.0
sass: 1.62.1-dev

dev_dependencies:
dartdoc: ^5.0.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.62.0
version: 1.62.1-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 3091de5

Please sign in to comment.