Media Text Block: Added blockGap support#67247
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Mayank-Tripathi32! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
|
||
| const blockGap = attributes?.style?.spacing.blockGap; | ||
|
|
||
| const fallbackValue = 'var(--wp--style--block-gap)'; |
There was a problem hiding this comment.
We can also default to 0 but I felt that using this global made sense here.
|
@t-hamano Could you take a look? If everything seems fine, I'll proceed with fixing the unit tests as well. |
|
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. |
resolves #67208
What?
This update introduces block gap support to the Media & Text block, along with new UI controls and a default gap value.
Why?
It addresses issue #67208 by allowing users to control the spacing between the image and text elements within the block.
How?
The update adds block gap support to the blocks.json file and uses __experimentalGetGapCSSValue (renamed as getGapCSSValue) to parse style attributes in the required format. It incorporates inline styles in both edit.js and save.js, with a default fallback gap value of 'var(--wp--style--block-gap)'.
Testing Instructions
Screenshots