【发布时间】:2019-06-14 16:18:08
【问题描述】:
我正在使用Bulma CSS framework,他们在某些颜色样式上使用 !important。
基本上是这样的:
.has-text-grey-light {
color: #b5b5b5 !important;
}
我想在我的 SASS 文件中像这样覆盖悬停时的颜色:
.content ul{
list-style-type: none;
margin:0;
padding:0;
li{
a{
&.has-text-grey-light:hover{
color: lighten($grey-light, 15%) !important;
}
}
}
}
但是 !important 规则使它无法编译。知道我们是否可以将 !important 与 SCSS 函数一起使用?
【问题讨论】:
-
你用哪个 sass 引擎编译?我使用在线编译器进行了快速测试:sassmeister.com,它可以正常工作。
-
你得到什么错误?它应该可以工作。
-
愚蠢的我!这是因为我输入了错误的颜色格式,而不是因为!important。但是因为匆忙,我没有完全阅读它,只是认为这是因为!important。它现在正在工作。