Title: minify css and calc function bug report
Last modified: August 16, 2020

---

# minify css and calc function bug report

 *  Resolved [Cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * (@cyberchicken)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/minify-css-and-calc-function-bug-report/)
 * I revive some other’s posts about an unresolved issue:
    [https://wordpress.org/support/topic/minify-css-and-calc-function/](https://wordpress.org/support/topic/minify-css-and-calc-function/)
   [https://wordpress.org/support/topic/css-minify-removes-mandatory-spaces-in-calc/](https://wordpress.org/support/topic/css-minify-removes-mandatory-spaces-in-calc/)
 * they say the third is the good one.
 * I cannot be more precise than cmeeren, my example is just marginally different.
   
   Take any wp theme; in w3tc turn on “minify” with “CSS minifier: Minify” and “
   Inline CSS minification”; in the customizer css add any rule that use calc(),
   like `body{font-size:calc(100px + 10px);}` and in the output you get `body{font-
   size:calc(100px+10px)}` which is invalid and discarded.
 * BUT if I choose “**CSS Tidy**” as minifier the rule is preserved and everything
   works (and the performance is almost the same if not better).
 * I don’t know if you are using a third party library for minification or not, 
   but a very very simple thing you can do is change the default minifier from Minify
   to Css Tidy. The malfunctions would drop to 0!
 * Bye, let me know.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/minify-css-and-calc-function-bug-report/#post-13265256)
 * Hello [@cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * Thank you for taking the time to post your findings.
    As you may have seen in
   the mentioned posts, we were unable to replicate the issue. Just to confirm, 
   as per your post, the calc function spaces are being removed when using CSS minifier:
   Minify (default), but if you switch to CSS Tidy the spaces are not removed? Thanks!
 *  Thread Starter [Cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * (@cyberchicken)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-css-and-calc-function-bug-report/#post-13273837)
 * > Just to confirm, as per your post, the calc function spaces are being removed
   > when using CSS minifier: Minify (default), but if you switch to CSS Tidy the
   > spaces are not removed?
 * Yes!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-css-and-calc-function-bug-report/#post-13273967)
 * Hello [@cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * Thank you for the information.
    We’ll make sure to investigate this further and
   advise the users to use CSS tidy in those specific use cases. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘minify css and calc function bug report’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/minify-css-and-calc-function-bug-report/#post-13273967)
 * Status: resolved