【问题标题】:Using sass function with !important将 sass 函数与 !important 一起使用
【发布时间】: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。它现在正在工作。

标签: sass bulma


【解决方案1】:

愚蠢的我!这是因为我输入了错误的颜色格式,而不是因为 !important。但是由于匆忙,我没有完整阅读它,只是认为这是因为!important。它现在正在工作。

【讨论】:

    猜你喜欢
    • 2015-12-12
    • 2012-10-15
    • 1970-01-01
    • 2013-01-02
    • 2018-04-08
    • 1970-01-01
    • 2020-11-30
    • 2018-08-23
    • 1970-01-01
    相关资源
    最近更新 更多