减去以下值:
.parent {
.child {
h1& {
color: red;
}
}
}
编译为:
h1.parent .child {color:red};
我需要的是:
.parent h1.child {color:red};
感谢您的建议。
我的问题与问题Less Immediate Parent Selector相似,但并不完全相同。因为选择器由元素和类名组成。问题是如何在不影响根选择器的情况下用元素限定类名。
发布于 2015-09-07 07:56:27
这将适用于此特定示例。虽然我很欣赏它没有回答你的一般问题。
.parent {
h1 {
&.child {
color: red;
}
}
}
https://stackoverflow.com/questions/32228899
复制