digitalsparky / jekyll-minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
GNU General Public License v3.0
245 stars 25 forks source link

CSS assets minification can't be disabled #42

Closed kekbait closed 5 years ago

kekbait commented 6 years ago

First of all, thanks a lot for this great plugin :smile:

I noticed that the minification of CSS assets can't be disabled with compress_css: false.

It looks like you are using CSSminify2 to minify css files in the output_css function : https://github.com/digitalsparky/jekyll-minifier/blob/8689d20533129e3d3b018a3212cd3e3d5075042e/lib/jekyll-minifier.rb#L76 but the compress_css argument is only used with the HTMLCompressor : https://github.com/digitalsparky/jekyll-minifier/blob/8689d20533129e3d3b018a3212cd3e3d5075042e/lib/jekyll-minifier.rb#L66

That why this condition : https://github.com/digitalsparky/jekyll-minifier/blob/8689d20533129e3d3b018a3212cd3e3d5075042e/lib/jekyll-minifier.rb#L22 will compress the CSS files no matter what.

Could we use the compress_css argument to prevent this too ?

musikele commented 5 years ago

Hi have the same problem; I write SCSS and I use jekyll to minify it, but for some reason I get the output css not valid.

E.g. I get

margin: calc(100%-24px)

Instead of

margin: calc(100% - 24px) 

The space is important in this case.

musikele commented 5 years ago

My walkaround is to set:

jekyll-minifier:
  compress_css: false 
  exclude: '*.css'
digitalsparky commented 5 years ago

Fixed in 0.1.8.