When I import a less file with the (reference) directive, I expect to see no CSS output from that file.
However, I am seeing content being output from the imported file when a mixin contains an & selector.
mixin.less
.mixin-no-parent-selector() {
background-color: red;
}
.mixin-with-parent-selector() {
&:first-child{ // USING AN & SELECTOR HERE
background-color: blue;
}
}
less-for-reference.less
.container-1 {
.mixin-no-parent-selector();
}
.container-2{
.mixin-with-parent-selector()
}
style.less
/*!
* styles.less
*/
@import "mixin.less";
@import (reference) "less-for-reference.less";
Expected Output
Actual Output
/*!
* styles.less
*/
.container-2:first-child{
background-color: blue;
}