dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

Extension doesn't trim `a > b` when superselector `a b` is present

Open connorskees opened this issue 2 years ago • 1 comments

Reopening https://github.com/sass/sass-spec/pull/1872 seems to have exposed a regression in dart-sass's behavior for trimming complex selectors.

The reproduction is:

a b {
  @extend %c;
}

a > b {
  @extend %c;
}

%c {
  color: red;
}

which on the most recent version of dart-sass will produce

a b, a > b {
   color: red;
}

The expected output (and what dart-sass emitted in a prior version) is

a b {
   color: red;
}

This is because the presence of a b makes a > b redundant.

connorskees avatar Jan 25 '23 00:01 connorskees

Marking this as cosmetic because it doesn't actually affect the CSS semantics.

nex3 avatar Jan 30 '23 21:01 nex3