本文介绍了使用Compass Mixin添加!important的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如果我在CSS中使用罗盘,并使用以下函数或mixin:If I'm using compass for CSS and use a function or mixin like: @include background-image(linear-gradient(#a3cce0, #fff)); 是否有任何简单的方法可以将罗盘添加!对它生成的每一行都重要!is there any easy way to have compass add !important to every line it generates?推荐答案 更新:sass的新版本现在支持以下语法:UPDATE: new versions of sass support this syntax now:@include border-radius(5px !important);只需这样做(如@naoufal答案中所述)。Just do this (as noted in @naoufal answer). ---旧答案--- --- old answer ---您不能将!important与罗盘混合使用,但罪魁祸首不是罗盘,应该责怪You can not use !important with compass mixings, but the culprit is not compass, you should blame sass for this.@include border-radius(5px) !important; #=> SASS Syntax Error 这篇关于使用Compass Mixin添加!important的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-26 16:11