Fix horizontal flex layout in classic themes.#60154
Conversation
|
Size Change: +373 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
I just learned that the problem reported in #60078 also occurs in the grid layout:
The selector changed in this PR only excludes flex layout, but the lower CSS specificity also solves the grid layout issue:
If we do not want to apply this margin style itself even when using the grid layout, how about updating the selector as shown below?
:where(.editor-styles-wrapper) :where(:not(.is-layout-flex):not(.is-layout-grid)) > .wp-block
Or how about simply reducing the specificity without considering any particular layout?
:where(.editor-styles-wrapper) .wp-block
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ramonjd
left a comment
There was a problem hiding this comment.
Tested in a few classic themes with all Group block manifestations. Justification works as expected in the editor (it didn't before)
| Before | After |
|---|---|
![]() |
![]() |
If we do not want to apply this margin style itself even when using the grid layout, how about updating the selector as shown below?
I also tested @t-hamano's suggestions, e.g., :where(.editor-styles-wrapper) .wp-block and they appear also to work.
|
Thanks for the reviews, folks! Good point about the grid layout @t-hamano. I'll update the selector to include it, as that will allow us to reduce layout selector specificity later. |
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
|
This PR introduces the issue, Automattic/themes#7749 🥲 |




What?
Fixes #60078.
The selector adding auto margins to all blocks in the classic stylesheet (only enqueued for classic themes) is overly specific and targets blocks too broadly. This PR reduces the selector specificity and changes it to not apply to direct children of flex blocks.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast