-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Layout blockGap / spacing: Add support for gap set at the block level in theme.json and global styles #39789
Comments
I've been testing and it looks like it's because Specifically, this line: 'spacing' => array(
....
'blockGap' => 'top', // <- this will be skipped when adding to `$schema['styles']['blocks']`
), There's a comment in
Previously, Gutenberg rendered a global style targeting the block class: .wp-block-group {
--wp--style--block-gap: 341px;
} Just so I understand, would we try to reinstate that rule, or something like that rule? Or look up the global value and only set for the specific block if that block itself hasn't got one (I think the latter?) |
Something like this? |
Just a quick drive-by comment while I'm AFK, thank you so much for picking up this issue @ramonjd! The idea in #39870 is exactly the kind of thing I had in mind — looks like a good direction to investigate to me 😀 In principle:
|
@andrewserong is this still something we are trying to get resolved in 6.0. If not, I will remove from the project board. Thanks! |
I've removed this issue and the PR. Thanks! |
Implemented in #40875. |
Following on from #39601 where we removed the blockGap / block spacing controls in global styles (since the gap value is not currently supported at the block level in global styles), this issue proposes a way to add it back in!
As of #37360 where the CSS variable approach for
blockGap
was removed, we haven't had support forblockGap
at the individual block level in global styles ortheme.json
. One possible path forward to re-instating it could be:layout.php
and in the JS rendering for the layout support so that if the block's attributes do contain ablockGap
setting we then look-uptheme.json
to grab theblockGap
value if one is set at the corresponding block name level?The text was updated successfully, but these errors were encountered: