说我有:
.apple {
color: red;
}
现在,让我们说我也得到了:
.big {
.apple {
font-size: 1.25em;
}
}
有没有办法让.big
选择器放在.apple
规则中?在伪代码中,类似于:
.apple {
color: red;
&:[WHEN INSIDE `.big`] {
font-size: 1.25em;
}
}
答案 0 :(得分:4)
您将&
放在最后:
.apple {
color: red;
.big & {
font-size: 1.25em;
}
}