Custom WordPress Block Editor Not Working After WordPress Update 5.8

Hey everyone! I’m just stopping by with a quick post because after upgrading to WordPress 5.8 I almost lost my mind.

I mentioned in a previous post that I had customized my editor for a better readability, with a child theme for Twenty Twenty; I didn’t get the chance to publish how I had achieved that but now it’s one less post to update.

Straight to the point: I had customized my editor re writing the /assets/css/editor-style-block.css file. It worked like a charm until today.

After the WordPress Update 5.8, now we need (if you did the same I did) to:

  • one, add two lines to functions.php
  • two, create a new file and use other selectors, as the guys from CSS-Tricks.com explain.

To fix my issue, I did the following:

Step 1. New CSS File

I need to write in Open Sans, with bigger line-height among other things. So, I created a new file “my-editor-style-block.css” in which I wrote the following:

/*This is New*/
p.rich-text.block-editor-rich-text__editable,
ol.rich-text.block-editor-rich-text__editable,
ol.rich-text.block-editor-rich-text__editable li,
ul.rich-text.block-editor-rich-text__editable,
ul.rich-text.block-editor-rich-text__editable li,
[role="textbox"].rich-text.block-editor-rich-text__editable p /*quotes*/,
blockquote.rich-text.block-editor-rich-text__editable /*citations*/
{
	font-family: 'Open Sans', sans-serif;
	font-weight: 300;
	font-size:20px;
	line-height:1.5em;
	color:#111;
}

h2.rich-text.block-editor-rich-text__editable {
	font-size: 30px;
	color: #222;
}

h3.rich-text.block-editor-rich-text__editable {
	font-size: 25px;
	color: #888;
}

This file also goes inside yourchildtheme/assets/css.

Step 2) New Lines in Functions.php

// Gutenberg custom stylesheet
// Thanks to https://css-tricks.com/getting-the-wordpress-block-editor-to-look-like-the-front-end-design/
add_theme_support('editor-styles');
add_editor_style( '/assets/css/my-editor-style-block.css' ); // make sure path reflects where the file is located

That’s it!

I felt in a huge mess this morning because I was to publish a few posts when I upgraded to WordPress 5.8, and then I had to use Word to write…🤦🏻‍♀️

So, quick post just in case you’re losing your mind too.

See you soon!

Any thoughts?