libsass icon indicating copy to clipboard operation
libsass copied to clipboard

Nested decendent selector becomes unested (regresssion)

Open byoungb opened this issue 6 years ago • 3 comments

input.scss

From bootstrap 3

@mixin table-row-variant($state, $background) {
  .table > thead > tr,
  .table > tbody > tr,
  .table > tfoot > tr {
    > td.#{$state},
    > th.#{$state},
    &.#{$state} > td,
    &.#{$state} > th {
      background-color: $background;
    }
  }
}
@include table-row-variant(active, green);

Actual results

libsass 3.6.2 libsass 3.6.3

> td.active, 
> th.active, 
.table > thead > tr.active > td, 
.table > thead > tr.active > th, 
.table > tbody > tr.active > td, 
.table > tbody > tr.active > th, 
.table > tfoot > tr.active > td, 
.table > tfoot > tr.active > th {
    background-color: green;
}

Expected result

libsass 3.6.1

.table > thead > tr > td.active, 
.table > thead > tr > th.active, 
.table > thead > tr.active > td, 
.table > thead > tr.active > th, 
.table > tbody > tr.active > td, 
.table > tbody > tr.active > th, 
.table > tfoot > tr.active > td, 
.table > tfoot > tr.active > th {
    background-color: green;
}

version info: libsass-python Bad

$ sassc --version
sassc 0.19.4 (sass/libsass 3.6.3)

Bad

$ sassc --version
sassc 0.19.3 (sass/libsass 3.6.2)

Good

$ sassc --version
sassc 0.19.2 (sass/libsass 3.6.1)

byoungb avatar Dec 12 '19 16:12 byoungb

Minimal reproduction case:

parent {
  td,
  &.#{active} {
    foo: bar;
  }
}

mgreter avatar Dec 12 '19 18:12 mgreter

Sorry for the regression, was a small oversight on my side :( And unfortunately the specs didn't catch this one either ...

mgreter avatar Dec 12 '19 18:12 mgreter

@mgreter Please add a spec to sass-spec that covers this (and follows the style guide).

nex3 avatar Dec 17 '19 23:12 nex3