在grunt-contrib-cssmin中使用clean-css兼容性选项 [英] Use clean-css compatibility options in grunt-contrib-cssmin

查看:124
本文介绍了在grunt-contrib-cssmin中使用clean-css兼容性选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE10中用clean-css遇到了问题。我需要关闭大括号优化后的空格。



我使用grunt-contrib-cssmin插件来自动执行所有这些优化,但是我不' t看到从这个插件中访问兼容性标志的方法。



任何人都可以将兼容性设置来自grunt-contrib-cssmin插件的clean-css?

昨天进入这个相同的问题,并找到了解决方法: https://github.com/gruntjs/grunt-contrib-cssmin/issues/192 。基本上,如果您想特别关闭它,请在Gruntfile的cssmin部分尝试以下操作:

 选项:{
兼容性:{
属性:{
spaceAfterClosingBrace:true
}
}
}


  

code> options:{
compatible:'ie8'
}

无论哪种方式,我希望这有助于!


I ran into an issue with clean-css in IE10. I'm needing to turn off the spaces after closing braces optimization.

I'm using the grunt-contrib-cssmin plugin to automate all these optimizations, but I don't see a way to access the compatibility flags from within this plugin.

Has anyone been able to target the compatibility settings of clean-css from the grunt-contrib-cssmin plugin?

解决方案

Ran into this same issue yesterday, and found the solution here: https://github.com/gruntjs/grunt-contrib-cssmin/issues/192. Basically, if you want to turn that off specifically, try this in the cssmin part of your Gruntfile:

options: {
    compatibility: {
        properties: {
            spaceAfterClosingBrace: true
        }
    }
}

However, the issue I had was with IE8 not IE10, so I just simply use:

options: {
    compatibility: 'ie8'
}

Either way, I hope this helps!

这篇关于在grunt-contrib-cssmin中使用clean-css兼容性选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆