Table: Remove unnecessary margin override in editor styles#57699
Conversation
|
Size Change: -16 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
tellthemachines
left a comment
There was a problem hiding this comment.
Thanks for the PR! Change LGTM and works correctly in testing. This should also fix #55409.
|
Thanks for the quick review! 🙇
It looks like that issue has a subtle difference as it's talking about the rule in Unfortunately I think that one might be a little trickier to fix as there could be Classic themes out in the wild that expect that |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
LGTM also 👍
Unfortunately I think that one might be a little trickier to fix as there could be Classic themes out in the wild that expect that 1em bottom rule to be applied
Agreed. I don't think that should block this PR landing.
|
Thanks folks! |
What?
Remove the Table block's unnecessary
margin: 0;rule in its editor styles. Since this doesn't affect the styles on the site frontend, this shouldn't be a breaking change.Why?
The browser default
figureelement margins are already overridden via a lower specificity:where()rule here:gutenberg/packages/block-library/src/common.scss
Line 161 in 9c5ce7e
The higher specificity rule in
.wp-block-tablehad the unintended effect of overriding the low specificity layout rules (see: #47858 for when the layout rules were lowered in specificity). The result is that within the editor, the default layout block spacing is being overridden for the table block, when it shouldn't be.How?
Remove the Table block's unnecessary
margin: 0;rule in its editor styles.Testing Instructions
margin: 0rule prevents there being a space before the block within the editor, however on the site frontend that gap is present.Testing Instructions for Keyboard
Screenshots or screencast