4

I am using grunt-contrib-cssmin, which is a wrapper over the clean-css plugin.

I have tried every option to disable optimizations done by clean-css, I only want clean-css to minify my css files, but unfortunately its changing them, for example changing:

background:none;

to:

background:0 0;

How I can disable this optimization? This GitHub link shows these optimizations are done by clean-css.

SW4
  • 69,876
  • 20
  • 132
  • 137
Muhammad Raza
  • 424
  • 5
  • 22

1 Answers1

1

Well, as you tested. No option for clean-css will output the css in the way you want, mostly because the plugin objective is create a more performatic and less verbose css, but not necessarily just stripping whitespaces. Which is more of a development choice than a bug.

As you expect both inputs:background: none or background: transparent will output to the less verbose:

background:0 0;

Since you seem to only want to concatenate your css, I suggest you cssshrink which has a grunt wrapper called grunt-cssshrink

Rigotti
  • 2,766
  • 23
  • 28