-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Table Block: Fix margin to include caption in spacing #68281
base: trunk
Are you sure you want to change the base?
Table Block: Fix margin to include caption in spacing #68281
Conversation
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. |
Hi @Infinite-Null, thanks for the PR ✨ I've tested out the PR and it seems to work as expected. The bug has been resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
One thing to be aware of is that the __experimentalSelector
field affects all global styles. Other styles, except padding/margin, etc. are expected to apply to the table
element, but in this PR they are applied to the figure
element, which is not the intention.
Below is a screenshot of the border, color, and font styles applied to the Table block via the global styles:
trunk
This PR
Therefore, we cannot modify the __experimentalSelector
field directly.
Instead, there is now a new Block Selectors API. Can we use this to target spacing support to figure elements and other elements to table elements as before?
Hi @t-hamano, Thank you for the suggestion. I’ve reverted the __experimentalSelector and applied the following to address the issue:
Please review it at your convenience. |
Fixes: #68217
What?
The PR modifies the margin application in table blocks to ensure theme.json margin settings are applied to the figure wrapper instead of the inner table element.
Why?
When margins are set via theme.json, they are applied to the inner table element, causing undesirable spacing between the table and its caption. This PR fixes these spacing inconsistencies by applying margins to the correct element.
Testing Instructions
Screenshots or screencast