As a theme author, you may find yourself frustrated trying to get the WordPress “Gutenberg” editor to style itself to match your template’s actual appearance.

I wrote a small chunk of Javascript (included below) which watches the template selection dropdown and adds a class to your chosen wrapper in the editor when a new template is chosen (and when the page loads, of course).

I’m not sure this is an “oversight” as such, but seems like such a basic requirement for a “WYSIWYG” editor that I’m puzzled WordPress doesn’t already do this.