Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row block: Layout does not work when classic theme and editor is iframed #60078

Closed
t-hamano opened this issue Mar 21, 2024 · 1 comment · Fixed by #60154
Closed

Row block: Layout does not work when classic theme and editor is iframed #60078

t-hamano opened this issue Mar 21, 2024 · 1 comment · Fixed by #60154
Assignees
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

Description

Row block justification does not work when the following two conditions are met.

  • Classic theme is enabled
  • Editor is iframed (custom fields panel is not enabled)

Iframed (custom fields panel is not enabled)

The left and right auto margins (from .editor-styles-wrapper .wp-block) override the zero margin of child blocks (from body .is-layout-flex > *) in the layout. As a result, the child block will be centered left and right, regardless of the justification setting.

iframed

Non-iframed (custom fields panel is enabled)

This is the correct layout. Zero margin overrides the block's left and right auto margins.

non-iframed

Step-by-step reproduction instructions

  • Enable one of the classic themes.
  • Make sure that the custom fields panel is disabled via the Preferences panel.
  • Insert a paragraph block inside a row block.
  • Change the justification setting.

Screenshots, screen recording, code snippet

No response

Environment info

I have confirmed that this issue occurs with WP6.4 or later. In other words, you should be able to reproduce this issue with the following versions:

  • WP6.4
  • WP6.5 RC3
  • Gutenberg trunk

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Layout Layout block support, its UI controls, and style output. labels Mar 21, 2024
@tellthemachines
Copy link
Contributor

Ooh I wonder what might have changed recently to cause this; pretty sure those styles were working last time I looked!

In any case, my quick testing shows it should be viable to reduce the specificity of the selector in the classic stylesheet to something like :where(.editor-styles-wrapper) .wp-block, which will still override theme styles attached to the figure element.

Another possible solution would be to exclude flex children from these styles be adding a :where(:not(.is-layout-flex)) in there somewhere. That might end up being a more viable solution if the reduction of layout style specificity started in #57841 goes forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants