Independent Publisher CSS caching / minify questions
-
Hi,
I’m using W3TC (with minify mode set to auto) with the Independent Publisher theme, and I have two questions:
-
The theme does an “Ajax call” (not really Ajax but more like linking to a dynamic stylesheet) to output theme customizer settings as CSS. I’ve noticed that this CSS isn’t minified or combined with the other stylesheets.
It might not make sense to cache this, as it technically is dynamic, but since the customizer settings are not changed very often, it would be nice to be able to minify and cache this CSS. Is there anything I can do on my install or change in the theme to enable this?
-
I would like to override some of the customizer CSS, so I have set up a child theme and made sure my child theme stylesheet is referenced after the customizer CSS in the output HTML. (Due to how the styles are enqueued in the parent theme, I ended up calling
add_action('wp_enqueue_scripts', ...)
with a larger priority value (lower priority) so that my child theme stylesheet is added last.)When I enable CSS minify though, my child theme stylesheet is minified/combined with the parent CSS and appears before the customizer CSS (the order of stylesheets is reversed), so now the customizer CSS is overriding my child theme styles. (As I mentioned in the previous question, the customizer CSS isn’t cached or minified/combined.)
So with minify off, the ordering in the output HTML is:
- Parent stylesheets
- Customizer stylesheet
- Child stylesheet
Then with minify on:
- Parent and child stylesheets (minified/combined)
- Customizer stylesheet
I’ve adjusted my child theme stylesheet for this situation (adding
!important
where necessary), and I believe I can also work around this by switching the minify mode to manual and managing which stylesheets are minified/combined myself, but honestly neither work-around is very appealing to me.Is there something I can do in the child theme to avoid this situation? Or anything else I can do to help debug/fix this issue?
Thanks!
-
The theme does an “Ajax call” (not really Ajax but more like linking to a dynamic stylesheet) to output theme customizer settings as CSS. I’ve noticed that this CSS isn’t minified or combined with the other stylesheets.
- The topic ‘Independent Publisher CSS caching / minify questions’ is closed to new replies.