Adding !important using a Compass Mixin

前端 未结 6 1853
孤城傲影
孤城傲影 2020-12-29 18:07

If I\'m using compass for CSS and use a function or mixin like:

   @include background-image(linear-gradient(#a3cce0, #fff)); 

is there any

6条回答
  •  鱼传尺愫
    2020-12-29 18:54

    Just spent hours figuring this out but there is a quick trick you can do. At the top of your SASS file add the following:

    $i: unquote("!important");
    

    in your style do the following:

    color: #CCCCCC $i;
    

    output is:

    color: #CCCCCC !important;
    

    full sample:

    $i: unquote("!important");
    
    .some-style {
        color: white $i;
    }
    

    output:

    .some-style {
        color: white !important;
    }
    

提交回复
热议问题