sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.96k stars 360 forks source link

`unifyCompound` is not commutative when applied to pseudo classes of pseudo elements #2335

Closed mattrberry closed 1 month ago

mattrberry commented 2 months ago

The following produces .y.x::scrollbar:vertical as expected

print(unifyCompound(
  CompoundSelector.parse('.x'),
  CompoundSelector.parse('.y::scrollbar:vertical'),
));

However, swapping the operands produces .x.y:vertical::scrollbar

print(unifyCompound(
  CompoundSelector.parse('.y::scrollbar:vertical'),
  CompoundSelector.parse('.x'),
));
Goodwine commented 1 month ago

To clarify, because I was confused, the issue is not that .x and .y switched places. The issue is that :vertical and ::scrollbar switched places