css – How to add my theme’s style to woocommerce blocks?

Question

I have found plenty of articles on how to remove the styling from the Woocommerce blocks, but I can find nothing about how to actually use your theme’s styling to replace the removed styling from the woocommerce blocks.

Basically I’m using a product tag woocommerce block but it is using the native styling from woocommerce in regards to the button styling and title in each of the cards within the block.

I have removed the styling with this block of code.

function cc_deregister_styles() {
    wp_deregister_style( 'wc-blocks-style' );
    wp_dequeue_style( 'wc-blocks-style' );
}
add_action( 'enqueue_block_assets', 'cc_deregister_styles', 100 );

My question is, what do I do to get my styling added in? When I look at the page there is practically zero styling to the cards within the product tag block now. It’s a bunch of li items with their bullet point and not aligned.

I tried doing something like this, but it didn’t work.

function cc_deregister_styles() {
    wp_deregister_style( 'wc-blocks-style' );
    wp_dequeue_style( 'wc-blocks-style' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() .     '/style.css');
}
add_action( 'enqueue_block_assets', 'cc_deregister_styles', 100 );

So what do I do to add my theme back in?

0
Seth 2 months 2022-09-24T16:08:26-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse