I'm looking for a tool that allows you to merge 2 large CSS files. All the ones I've tried so far (like CSSMerge) haven't worked out. Some of them just randomly remove properties. Others choke on the non-standard properties like -webkit and -moz and give me errors. And I also need something that preserves the case of each rule. CSSMerge changed all rules to lower-case.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Try
CSS Compressor & Minifier
It have lots of options, you can compress and/or minify css.
- Copy both CSS files into CSS input
- Turn on Sort selectors and properties
- Obtain output
- Manually remove duplicates
- Re-enter input
- compress or minify your output
回答2:
Try SASS, you'll need ruby, but it's awesome for CSS generally. It will merge props though, as well as all it's other awesomeness.