-
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
Spacing/Dimensions Supports: Separate spacing from dimensions for compatibility purposes #34059
Spacing/Dimensions Supports: Separate spacing from dimensions for compatibility purposes #34059
Conversation
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 following up on this @aaronrobertshaw!
✅ Confirmed that the diff between the old spacing.php
and the re-introduced spacing.php
is just the doc comment added at the top of the file
✅ Minimalist dimensions.php
file looks good and ready for us to add in height and width supports 👍
✅ Smoke tested that the existing spacing supports still work as expected (padding and margin in Group block, and the Button block's padding which skips serialization)
Also, IMO it feels like it'll be useful having the width and height controls separately in the dimensions support as that way it'll be possible to have slightly more granular control over skipping serialization between height/width and padding/margin 👍
That's a good point. Which I think might tip the decision in favour of this approach rather than unifying the support keys. |
This ignore will be removed once height block support is added as the parameter will be used then.
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.
Bit late, but also tested.
✔️ Controls appear as expected.
✔️ Changes reflected in the frontend
✔️ Tests pass
Thank you!
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.
Haven't tested but the code changes look good.
Related: #32392
Description
This PR addresses an issue of compatibility with core created by the renaming of spacing to dimensions support in #32392.
spacing.php
has been restoreddimensions.php
server-side hook remains in place ready to accept height and width supportspacing
containspadding
andmargin
supportspacing
key.dimensions
will containheight
,width
, and possibly min/max versions of those.__experimentalDimensions
keydimensions
keyHow has this been tested?
npm run test-unit:watch packages/block-editor/src/hooks/test/style.js
npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/gutenberg/phpunit.xml.dist --verbose --filter stylesheet /var/www/html/wp-content/plugins/gutenberg/phpunit/class-wp-theme-json-test.php'
Types of changes
Bug fix.
Checklist:
*.native.js
files for terms that need renaming or removal).