【发布时间】:2017-10-24 21:14:50
【问题描述】:
我正在尝试为其中包含复选框的标签设置样式。当复选框被选中时,我希望标签改变颜色。
<label>
<input type="checkbox">
</label>
使用 SASS 和 & 符号,这应该是可能的:
input {
background-color: red;
&:checked {
label & {
background-color: green;
}
}
}
我运行了一个测试,这很有效,但是,这在 Shopify 中不起作用。事实上, Shopify 似乎根本没有编译它。我错过了什么吗?
【问题讨论】:
标签: css sass shopify parent-selector