jekyll-minifier
jekyll-minifier copied to clipboard
Problem with calc() minify (bis)
CSS minifying is breaking calc() function removing the needed spaces. It the same problem explained here : https://github.com/digitalsparky/jekyll-minifier/issues/5
And still a problem in last version (0.1.10)
Also suffering same issue where spaces from the CSS calc() function are being removed making the style fail.
Example:
max-width: calc(100% + 40px);
is output as
max-width: calc(100%+40px);
which doesn't work. I have tried a "workaround"
max-width: calc(100% - - 40px);
which also doesn't work.
I've had to remove jekyll-minifier from my build.
Ran into the same issue. Fixed it with this little patch:
--- vendor/bundle/ruby/2.6.0/gems/cssminify2-2.0.1/lib/cssminify2/cssmin-orig.rb 2021-02-20 22:16:46.000000000 +0100
+++ vendor/bundle/ruby/2.6.0/gems/cssminify2-2.0.1/lib/cssminify2/cssmin.rb 2021-02-20 22:16:41.000000000 +0100
@@ -212,2 +212,6 @@
css = css.gsub(/(:|\s)0+\.(\d+)/) { "#{$1.to_s}.#{$2.to_s}" }
+
+ #
+ # Put space back between ' + ' i. e. in calc() operations
+ css = css.gsub(/\+/i, ' + ')
Any update on this? Still a big issue
I also ran into this recently. Didn't appear to be an issue on Firefox, but broke on Edge and Safari because there wasn't space on both sides of a -
operator. Was only able to fix it by turning CSS minification completely off in _config.yml
.