• Hello,

    This is more a question than a problem.

    We’re about to rewrite the blank theme we use for custom theme conception. One of the requirement we gave ourselves is to use conditional comments for CSS within our themes and all our custom plugins. Preliminary evaluation all points to using the built in functionality $wp_styles->add_data('css-slug','condional','IE 6');.

    Another requirement is to continue using minification. We were using a collection of plugins including WP-Minify, which disappeared some time ago.
    We are evaluating to start using W3 Total Cache.

    The question is: how does W3 Total Cache deal with minification of enqueued styles with conditional comments? If it does not, how can we make it work?

    I am more than willing to give a hand in this.

    Charles

    https://www.ads-software.com/extend/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Frederick Townes

    (@fredericktownes)

    Auto mode of minify looks for enqueue to see which files to minify, however it does not minify (in either mode) the files in conditionals.

    Thread Starter Charles St-Pierre

    (@charleskakidcm)

    I want to be crystal clear.

    I’m not talking about conditionnal comments hard coded in the head template.

    I’m talking about styles and scripts added with wp_enqueue_style(script) to which was added the conditionnal with the built in method add_data.

    WP writes the conditionnal comment when printing the styles. What happens to those styles when W3TotalCache encounters this situation?

    Do they get printed in their conditionnal comments after the minified includes?
    Do they get absorbed in the minification, with no regards to the conditionnal comment?
    Do they get scrapped?

    Finally, how does the minification engine assembles the files? Would it be thinkable to modify this engine to pass through the style list object, repackage the minification to print the regular styles first, then output the LESS THAN IE 8 conditionnal comment with all matching stylesheets, then IE 7, and so on, and so forth?

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    Sorry, W3TC is looking for what exists in the source and tries to either match them in manual mode or replace the local files in auto mode. It uses the minify engine to process the files according to whatever settings policy is used. It doesn’t process files inside conditionals.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: W3 Total Cache] CSS minification and Conditional Comments’ is closed to new replies.