Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一堂课 .red
我想对红色类的标签应用更多规则。
我知道我可以这样做:
label { ...stuff... &.red { color: red; } }
但对于组织我宁愿是这样的:
.red { color: red; label & { font-weight: normal; } }
但这当然没有给label .red我label.red
label .red
label.red
有没有办法做到这一点?
没有。不允许。您必须像第一个示例一样编写它,或者根本不嵌套它。