Skip to content

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

@connorskees

Description

@connorskees

Reopening sass/sass-spec#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions