In 12.3.0, the blockGap for each block set in styles.blocks in theme.json is disabled.
Description
In 12.3.0, the blockGap for each block set in styles.blocks in theme.json is disabled.In 12.2.0, if you set the blockGap for each block in styles.blocks in theme.json, the value will be reflected, but in 12.3.0, the blockGap set in styles.blocks will be ignored and the global blockGap set in default or styles will be reflected.
Even blocks without gap, such as post-date, will affect margin-top.
Step-by-step reproduction instructions
- set the blockGap to styles.blocks.core/navigation in the theme.json of twenty twenty two
- check the gap in navigation in both Gutenberg version 12.2.0 and 12.3.0
- check other blocks as well
Screenshots, screen recording, code snippet
The following is an example of a navigation block
This problem occurs not only in the navigation block, but also in various other blocks
.
Environment info
WordPress: 5.8.2 Gutenberg: 12.3.0 <-> 12.2.0 Theme: TwentyTwentyTwo
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Hi, This change was made on purpose, as a "lesser of two evils", because no other solution was found: https://github.com/WordPress/gutenberg/pull/37360
Thank you @carolinan Am I understanding the following correctly? ・The global blockGap affects the margin-top between blocks. ・The blockGap in each block affects the gap or margin-left in the block and the margin-top between blocks. In 12.3.0, it was disabled to eliminate this margin-top effect.
If I want to change the gap in the navigation, is it correct to put it in the css file? Also, if I want to change the margin-top of post-date, etc., is it in a css file?
.wp-block-navigation__container,
.wp-block-navigation__responsive-container-content {
gap: 4em;
}
div.wp-blcok-post-date {
margin-top: 0.5em;
}
Yes, that is my understanding. But if you plan to continue to use the latest version of Gutenberg, using the CSS file will only be a temporary solution, since more changes will be made to different blocks.
Thanks so much for connecting the dots here, Carolina. Going to close this out as a result since this was an intentional decision.
@carolinan Thank you for your answer!