Changelog
Fix an edge case with BEM mixins where using a pseudo-element selector within a modifier would generate the wrong class for the nested elements.
@include b('block') {
@include m('highlighted:nth-child(2n)') {
@include e('item') {
background-color: color(border, light);
}
}
// SAME AS
@include b('block') {
@include m('highlighted') {
&:nth-child(2n)') {
@include e('item') {
background-color: color(border, light);
}
}
}
Before
The generated class name for the item
element: .block--highlighted:nth-child(2n) .block--highlighted__item
is wrong.
After
The class .block--highlighted:nth-child(2n) .block__item
is properly returned for the edge case defined above.