WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

Add template name as a CSS class in the editor #67179

Open colinduwe opened 1 day ago

colinduwe commented 1 day ago

What problem does this address?

I have a theme with page templates that have different background colors. If the user swaps the template, the editor's background color should match the front end. But currently the page template slug isn't added as a class to the editor like it is to the on the front end.

What is your proposed solution?

I worked around it by adding it via the admin_body_class filter but it would be nice to add it on the editor automatically.