To override Gutenberg’s styles you need to add your own stylesheet. So hook into enqueue_block_editor_assets
and then add your own stylesheet in which you target the selectors you wanna override. In the following example I placed a stylesheet in a custom theme’s assets/
folder.
functions.php
:
// Add backend styles for Gutenberg.
add_action('enqueue_block_editor_assets', 'gutenberg_editor_assets');
function gutenberg_editor_assets() {
// Load the theme styles within Gutenberg.
wp_enqueue_style('my-gutenberg-editor-styles', get_theme_file_uri('/assets/gutenberg-editor-styles.css'), FALSE);
}
assets/gutenberg-editor-styles.css
:
.editor-post-title__input {
border: 1px solid black;
}