0

目前我正在使用以下插件:

gulp-clean-css

这是我的布局:

<div class="checkbox">
  <label>
    <input type="checkbox" disabled="disabled" checked="checked">
    <span class="checkbox-material" style="margin-right: 10px">
       <span class="check"></span>
    </span>I'm supposed to be checked and disabled
  </label>
</div>

然后在我的 CSS 中:

.checkbox input[type=checkbox]:checked+.checkbox-material .check {
    color: #2196f3; // when the input's disabled is set to false
}


.checkbox input[type=checkbox][disabled]:checked+.checkbox-material .check{
        color:#9E9E9E!important;cursor:not-allowed!important; // When the input is disabled
}

问题是当我运行优化的代码时,(缩小)第二个选择器没有被考虑在内。虽然它存在于样式表中

有任何想法吗?

4

0 回答 0