-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix padding and margin visualizer positioning #47483
Conversation
Size Change: +8 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
It feels like "block-toolbar" is not the right name for that slot anymore :). Could be "block-ui" or something. Anyway, that's a problem for another day. |
Flaky tests detected in 1f4bbf8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4022452209
|
What?
Fixes #47471, an issue where the margin and padding visualizers became misaligned whenever block spacing is applied to the layout.
Why?
The visualizer popovers were rendering within the editor canvas
iframe
, inline within the block list. This made them susceptible to CSS that's meant to be applied to blocks.In this case, the block spacing's
margin-block-start
style was being applied to the popover, making it appear misaligned with the block itself.How?
This PR makes the visualizer popovers use the
block-toolbar
slot, so that they render outside of the editor canvas iframe.I did try this originally when trying to fix #47139, and noticed some other problems with the visualizers, but I'm not seeing any issues in this PR 🤔
Testing Instructions
Expected: the visualizer should appear correctly overlayed on top of the block.
In trunk: the visualizer is misaligned
Screenshots or screencast
Before
After