Hi @yulich
Thanks for bringing up this concern. I understand your perspective about WooCommerce Blocks appearing to “deactivate” your theme styles. However, it’s important to clarify that WC Blocks don’t actually remove any styling from your theme.
When you mention that the plugin deactivates your theme styles, could you please provide more detail about what exactly you’re observing? Is there a specific aspect of your site’s styling that isn’t behaving as expected when WooCommerce Blocks is activated?
To give you some more context, WooCommerce Blocks use a different kind of markup compared to shortcodes or PHP templates. This means the styles your theme applies to shortcodes or PHP templates might not be applied in the same way to blocks, leading to a change in the look of the site when you use WC Blocks. This is not so much a deactivation, but more of a difference in how styles are applied due to the different nature of blocks versus shortcodes and PHP templates.
Please rest assured, the goal of WC Blocks is to offer more customization and features, with the expectation that themes will add styling for blocks if they wish, or leave the default styling, which should integrate well with most themes.
It would be really helpful if you could share more about the issues you’re experiencing and the theme you’re using. That way, we can give you more targeted advice.
Looking forward to hearing from you soon.
Thread Starter
yulich
(@yulich)
@johnlund thank you for quick response. I didn’t mean to offend the development team. I suppose my review was too early and emotional. I’ve tested the plugin one more time. It works good, but the styling requires some efforts. You need to rewrite the styling totally and there is no way to deactivate the plugin styling (at least I couldn’t find it). You mentioned different nature of blocks versus shortcodes and PHP templates. And that’s why it is not as good for theme developers but good for users. If there is any way to disable blocks styling I would appreciate if you share.
Hi there,
Thanks for getting back with the additional details!
You mentioned different nature of blocks versus shortcodes and PHP templates. And that’s why it is not as good for theme developers but good for users. If there is any way to disable blocks styling I would appreciate if you share.
A user from this forum thread was finally able to disable the styling. Can you please give this a try and let us know how it goes?
If that does now work, please try the below:
/**
* Disable WooCommerce block styles (back-end).
*/
function themesharbor_disable_woocommerce_block_editor_styles() {
wp_deregister_style( 'wc-block-editor' );
wp_deregister_style( 'wc-blocks-style' );
}
add_action( 'enqueue_block_assets', 'themesharbor_disable_woocommerce_block_editor_styles', 1, 1 );
The above snippet will dequeue the styles that are enqueued at the backend by WooCommerce Blocks.
If you want to dequeue the frontend styles, please give the below a try:
/**
* Disable WooCommerce block styles (front-end).
*/
function themesharbor_disable_woocommerce_block_styles() {
wp_dequeue_style( 'wc-blocks-style' );
}
add_action( 'wp_enqueue_scripts', 'themesharbor_disable_woocommerce_block_styles' );
Looking forward to your reply!