Germanized CSS file not being loaded when using Virtue Premium
-
Hi,
I am seeing some layout artefact after updating my plugins. After investigation I found out that this is because a CSS from WooCommerce Germanized is not loaded which is /wp-content/plugins/woocommerce-germanized/assets/css/woocommerce-gzd-layout.min.css?ver=1.9.9
It is loaded when Storefront theme is used, but with Virtue Premium it is not.
Steps to reproduce:
1. Install WooCommerce Germanized and Storefront
2. Load any page and have Network Tab of DevTools open: Notice that woocommerce-gzd-layout CSS file gets loaded.
3. Now use Virtue Premium instead of Storefront as theme
4. The woocommerce-gzd-layout CSS file is not loaded anymore.Upon this finding I talked to the Virtue Premium developers and he’s saying that they are following the recommended best practices outlined by WooCommerce:
if a theme wants to add its own CSS to style woocommerce then it unhooks woocommerce default stylesheets.
https://docs.woocommerce.com/document/disable-the-default-stylesheet/
This is intended to only unhook woocommerce core stylesheets. Notice that is says “This is the recommended process if you’re building a custom theme.”
Every extension to woocommerce that I’ve come across that needs their own styles adds there own styles through normal WordPress enqueuing. For some reason, Germanized is not doing that. Instead of enqueuing their own files they are hooking their css into woocommerce core as if their css is part of woocommerce core default styles. (but of course, it’s not). So when any theme like virtue unhooks woocommerce core default styles in favor of there own they are inadvertently unhooking Germanized specific css.
As I understand for the Virtue developers it would only be possible by doing “hacks” to work around this issue, for instance, having an if-condition and whenever Germanized is used/loaded, then correctly enqueuing the Germanized css.
But I am not sure if they will do this. By the looks of it it might a better root fix for the problem if Germanized would enque its CSS files as outlined above.
In the end I am just a user of Germanized and Virtue Premium and cannot say what would be the best solution.
- The topic ‘Germanized CSS file not being loaded when using Virtue Premium’ is closed to new replies.