【发布时间】:2019-07-04 21:56:21
【问题描述】:
我在当前项目中使用 SASS (.scss)。
HTML
<div class="colours colours--blue">
<!-- This should be blue -->
</div>
<div class="colours colours--yellow">
<!-- This should be yellow -->
</div>
<div class="colours colours--blue colours--yellow">
<!-- This should be green -->
</div>
SCSS
.colours {
width: 50px;
height: 50px;
&--blue {
background-color: blue;
}
&--yellow {
background-color: yellow;
}
&--blue (AND) &--yellow { /* <<< HOW TO CREATE THIS SELECTOR? */
background-color: green;
}
}
【问题讨论】: