I’ve been playing around with the new Gutenberg plugin for WordPress. It’s direction is great and I really love it, but as a plugin it has an annoying problem which really rubs me the wrong way. To ensure that it supports themes well, it has included it’s own CSS to add styling. This is highly annoying when you are trying to style your own theme and a darned plugin starts overriding them.

This will not be a problem if/when Gutenberg is merged into WordPress core, because themes will be able to simply include support by defautl. But in the mean time it’s annoying as heck (for me). So to fix this issue, I’m using the following short script (can be included in your theme, plugin, mu-plugin etc) which disables the Gutenberg CSS file, allowing you to use your themes CSS instead.

<?php

add_action( 'init', 'disable_gutenberg_junk' );
/**
 * Disable Gutenberg junk.
 */
function disable_gutenberg_junk() {
	remove_action( 'wp_enqueue_scripts', 'gutenberg_common_scripts_and_styles' );
}