-
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
--wp--style--block-gap custom property not set by blockGap property in theme.json #40381
Comments
In (6.0-beta2-53249) without Gutenberg: In the code example for theme.json above, block gap is not enabled in @mrwweb Mark, does that help solve the issue? |
I can confirm (5.9.3 with 0 plugins) that defining
That's interesting as I originally tested this (with What is the appropriate way to clear the cache for |
@carolinan So to confirm: The |
So I need to enable the settings per block, to have a bit of proper spacing between blocks in the Gutenberg editor? That just feels weird to me. When you don't use a theme.json you automatically get a nice gap between blocks, and I just want that back while not having all kinds of size settings for the user. |
On a related note, today I learned this from @carolinan's excellent FSE lessons :
I thought that was an interested tidbit! According to developer.wordpress.org docs, If it was a boolean, it'd make sense more sense (to me) to enable it in @justinkruit Check this resource for definining spacing/margin/padding (so that your users don't have to) -> https://fullsiteediting.com/lessons/theme-json-layout-and-spacing-options/#h-the-block-editor-layout-control |
Just reconfirming that this behavior is still present in WordPress 6.0. This is a problem because without |
@mrwweb, I think to resolve the issue described here, in the
Yes, the behaviour of It seems the nuances between the |
@andrewserong Thank you so much for looking into this and clarifying. I can confirm that the following does correctly output the {
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"styles": {
"spacing": {
"blockGap": "1.5em"
}
},
"settings": {
"spacing": {
"blockGap": false
}
}
} After reading the reasoning, I can understand why it was built this way. That said, the fact that someone can set a style in |
Description
I have run into this issue in two "hybrid" themes: classic PHP themes with
theme.json
. I first noticed this recently when a new post had no space between paragraphs in the editor. I then found the same issue on a second site where some additional editor styles were covering up for the problem.On both sites, I have defined
styles.spacing.blockGap
in my theme. However, in both the editor and front end, the--wp--style--block-gap
custom property is not set.There seems to be a second bug in that the front-end columns block has a
2em
fallback value, but in the editor for block spacing, there is no fallback value for the custom property. It seems like the fallback should be its own custom property like this so it can be reused across multiple block styles:This may somehow be related to #39122, but I can't quite piece it all together, and so I think this is worth a new issue.
Step-by-step reproduction instructions
Example
theme.json
:Observe that
--wp--style--block-gap
is not defined in editor or front-end.Screenshots, screen recording, code snippet
Front-end columns style:
Backend block spacing style:
Environment info
WordPress 5.9.3
No Gutenberg Plugin
Custom themes
Different active plugins
Confirmed by two people (me and @cdils)
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: