• Resolved Cyberchicken

    (@cyberchicken)


    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/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

    (@vmarko)

    Hello @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

    (@cyberchicken)

    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

    (@vmarko)

    Hello @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.