-
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
A margin option is added to the Embeded preview block #39384
A margin option is added to the Embeded preview block #39384
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @HILAYTRIVEDI! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Thank you for the pull request @HILAYTRIVEDI. Gutenberg already has a Dimensions panel with a margin option. Please add block support for spacing and margin in block.json instead.
You can add the block support for spacing and margin there:
This is a much smaller change, and you do need to regenerate the documentation, but you don't need to make the changes to edit.js, save.js, the controls or the preview. |
Hi @carolinan, Thanks for this. I reverted my changes and added the margin support to the block.json file as per your instructions. |
Hi @HILAYTRIVEDI Are you able to continue working on this pull request? (to rebase it and solve the conflict). |
Hi @carolinan yes sure I will do that. |
Hi @carolinan, I can't see any conflicts here, all good to go from my end. |
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.
I have tested the pull request with Twenty Twenty-Three, which has support for spacing enabled in theme.json.
I tested a youtube embed and an embedded link to a WordPress.org support article and the margin worked well in the editor and front.
(In post content, the margin is less visible because of the layout
constraints)
Hi @carolinan, can we merge this if all looks good? |
The PR needs to be rebased so that all tests are run. |
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 iterating on this one @HILAYTRIVEDI 👍
The change looks good to me and tests as advertised.
In terms of the padding block support it makes sense to omit it. It's arguable as to whether it would provide any benefit, even if we opted into background color support. Adding the ability to set a border on the embed might be more desirable in a follow-up.
So given that, I think this should be right to go after it gets a rebase and the tests pass.
Okay I will rebase it by EOD (IST). |
Hi @carolinan and @aaronrobertshaw Can we merge this? As it passed all the checks. |
What?
This PR will add the option to set margins to the embeds.
Why?
This PR will allow the user to add the margins to the embeds preview.
How?
The option is added to the inspector control to add the margins to the block.
Testing Instructions
Here are some steps to check the implementation ;
Screenshots or screencast
https://www.loom.com/share/6dbca6117ec6416aad995319736db226