Skip to content

Commit

Permalink
handle code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodwine committed Sep 27, 2024
1 parent d399f1c commit 945e90c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 27 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
selector, regardless of which selector they came from. Previously, this
reordering only applied to pseudo-selectors in the second selector.

* Prioritizes components from the first selector in the output.

## 1.79.3

* Update the `$channel` parameter in the suggested replacement for
Expand Down
23 changes: 2 additions & 21 deletions lib/src/extend/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,11 @@ List<ComplexSelector>? unifyComplex(
/// If no such selector can be produced, returns `null`.
CompoundSelector? unifyCompound(
CompoundSelector compound1, CompoundSelector compound2) {
var result = <SimpleSelector>[];
var result = compound1.components;
var pseudoResult = <SimpleSelector>[];
var pseudoElementFound = false;

// Compound selectors may not contain more than one pseudo-element selectors.
if (compound1.components
.followedBy(compound2.components)
.whereType<PseudoSelector>()
.where((pseudo) => pseudo.isElement)
.toSet()
.length >
1) {
return null;
}

for (var simple in [...compound1.components, null, ...compound2.components]) {
// The relative order of pseudo selectors is preserved only in the original
// selector. We use `null` as a signal to know when we transition from the
// first components into the second components.
if (simple == null) {
pseudoElementFound = false;
continue;
}

for (var simple in compound2.components) {
// All pseudo-classes are unified separately after a pseudo-element to
// preserve their relative order with the pseudo-element.
if (pseudoElementFound && simple is PseudoSelector) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sass-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-parser",
"version": "0.2.2",
"version": "0.2.3",
"description": "A PostCSS-compatible wrapper of the official Sass parser",
"repository": "sass/sass",
"author": "Google Inc.",
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 @@
## 12.0.4

* No user-visible changes.

## 12.0.3

* 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: 12.0.3
version: 12.0.4
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
sass: 1.79.3
sass: 1.79.4

dev_dependencies:
dartdoc: ^8.0.14
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.79.3
version: 1.79.4
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 945e90c

Please sign in to comment.