neat icon indicating copy to clipboard operation
neat copied to clipboard

calc( + ) neat minification error

Open rollthecoder opened this issue 9 years ago • 6 comments

This an example that works fine margin-left: calc(33.33333% + 0px);

But the compressor remove extra spaces margin-left: calc(33.33333%+0px); And this becomes as invalid css

Temporary fix. I modified inside neat folder every mixin

For example width: calc(100% + #{($_grid-gutter * 2)}); To width: calc(100% - -#{($_grid-gutter * 2)});

It fix the problem when the css is monified

Any idea.

rollthecoder avatar May 04 '17 16:05 rollthecoder

What compressor/minifier are you using?

Also what is running your sass.

whmii avatar May 04 '17 16:05 whmii

I am running sass with gulp. The compressor is "liferay css compressor" is the cms automatic compressor.

rollthecoder avatar May 04 '17 16:05 rollthecoder

I did a quick search if this issue and it seems just about every CSS compressor has run afoul and had to fix this issue. The CSS spec calls for spaces between math operators in calc, which means compressors need to not strip whitespace inside those operations. Unfortunately, the issue here is not with Neat, but with liferay

kgcreative avatar May 04 '17 17:05 kgcreative

Yeah i know. The issue is not with neat. It is only with every compressor.

rollthecoder avatar May 04 '17 17:05 rollthecoder

Both cssmin and postCSS with cssnano properly compress calc functions. I've had no issue with either on my pipeline

kgcreative avatar May 04 '17 17:05 kgcreative

Seems like this is simply not an issue with Neat. Closing

whmii avatar May 12 '17 16:05 whmii