My host provider updated my application's version of WordPress to 6.7.2. Since then I have noticed on the frontend / public facing / client side of my application the following CSS file is now being loaded "wp-includes/css/dist/components/style.css"
I'm not sure where this has come from but in the theme I wrote for my application I added the following code to my functions.php file:
/**
* REMOVE GUTENBERG BLOCK LIBRARY CSS FROM LOADING ON FRONTEND
*/
function remove_wp_block_library_css()
{
wp_dequeue_style("wp-block-library");
wp_dequeue_style("wp-block-library-theme");
wp_dequeue_style("wc-block-style"); // REMOVE WOOCOMMERCE BLOCK CSS
wp_dequeue_style("global-styles"); // REMOVE THEME.JSON
}
remove_action("wp_enqueue_scripts", "wp_enqueue_global_styles");
remove_action("wp_footer", "wp_enqueue_global_styles", 1);
add_action("wp_enqueue_scripts", "remove_wp_block_library_css", 100);
function wps_deregister_styles()
{
wp_dequeue_style("global-styles");
}
add_action("wp_enqueue_scripts", "wps_deregister_styles", 100);
Previously, before the upgrade it prevented any Gutenburg / Wordpress styling being rendered. Obviously the above isn't enough? Has anyone else experienced this and managed to prevent the "wp-includes/css/dist/components/style.css" being output/loaded without the use of a third party plugin?