Layout: Removal of semantic classnames when using 'disable-layout-styles' #60569
Labels
[Feature] Layout
Layout block support, its UI controls, and style output.
[Type] Bug
An existing feature does not function as intended
Description
As per the developer documentation a theme can opt out of [https://developer.wordpress.org/block-editor/explanations/architecture/styles/#opting-out-of-generated-layout-styles generated layout styles] by setting
add_theme_support( 'disable-layout-styles' );
within their theme. The generated styles are no longer inlined, but the blocks will still retain their semantic class names, such asis-layout-constrained
.Since 6.5 this is no longer the case within the editor. Public display of a page still shows the semantic class names, but within the editor, those classes are being removed causing styling issues for themes.
I've replicated this within in Twenty Twenty Four.
From what I can tell, this appears to have been introduced as part of changes within Gutenberg 17.1. As I've also tested with WP 6.4.3 and activating/deactivating Gutenberg 17.1 and seen the same removal of editor classes when it's active.
I've also tested using a group block set as a row, it should have the
is-layout-flex
class within the editor to match the public view, but it does not.Expected behaviour
The CSS should not be inlined as requested by the theme support opt-in, but the semantic classes should still remain in the editor.
Step-by-step reproduction instructions
is-layout-constrained
add_theme_support( 'disable-layout-styles' );
to thefunctions.php
fileScreenshots, screen recording, code snippet
Block markup
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: