If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?

In updating to WordPress 5.0.1 I noticed when examining my Sources from Chrome’s DevTools that a new file and directory were created, a stylesheet named style.min.css in a dist directory:

/wp-includes/css/dist/block-library
  style.min.css

From research and memory there is wp_dequeue_style() and I can do:

add_action('wp_print_styles',function() {
    wp_dequeue_style('wp-block-library');
},100);

that removes the file from Source but I’m unsure on a custom theme if there are any adverse effects or another way to remove the file? Is there another way to remove Gutenberg CSS from WordPress 5.0.1 and if I dequeue will that cause any problems?

Here are some Github issues I found when searching:

  • How to remove gutenberg CSS
  • Column Block CSS Media Query

1 Answer
1

You probably do not need to dequeue it if you do not use gutenberg. It should be used only with the block editor. Obviously there might be bugs, but if you are using the classic editor plugin to avoid the gutenberg **** you can open a bug report with it.

But there is nothing wrong with dequeuing it if you decide to disable gutenberg “by hand”, or you can not be bothered to wait until relevant bugs are fixed.

A notice regarding the future is probably needed here. As wordpress wants to have everything as blocks this CSS might get reused in other parts of the system in the future, therefor as always, be careful in which context you dequeue the CSS.

Leave a Comment