Archived topic
Gutenberg code editor supper narrow
3 replies · Started by Paul on March 11, 2019
See screenshot here: https://www.screencast.com/t/tFvsvzEAP
This is really annoying when working with long articles, as I have to scroll like a madman and I can only have a small part of the article in view at once.
I read this about changing the width: https://wordpress.org/gutenberg/handbook/designers-developers/developers/themes/theme-support/#changing-the-width-of-the-editor
But I don't see a style-editor.css file in GP.
Anyway, how can I set the code editor to a workable length?
Hi there,
Try adding this function to your site:
add_action( 'enqueue_block_editor_assets', function() {
wp_add_inline_style( 'generate-block-editor-styles', 'body .edit-post-text-editor {max-width: 800px;}' );
} );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if that helps or not :)
Thanks Tom, unfortunately I had to switch back to the classic editor, because I had the Gutenberg failing to update posts bug for some of my posts.
That's why I'm late to reply, because frankly I haven't tried if it works yet.
I will keep it handy in the back of my mind though, for when I do eventually switch over to Gutenberg.
Thanks
Sounds good :)