-
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
In 12.1, blockGap appears partially enabled when it shouldn't be #37232
Comments
I can confirm that this is happening. Updated to Gutenberg 12.1 to work on updating Frost, but found it impossible because of what @ndiego reported. Had to revert to Gutenberg 12.0.2 and unfortunately have to wait. |
Upon more investigation, this issue might have something to do with this commit: 96a0daf. Not 100% sure, but regardless, this is the line in the file that controls the gutenberg/lib/block-supports/layout.php Line 157 in 9faa63e
If you simply disable this line, themes that have
|
It appears the CSS you shared above is coming from this:
Which is also using The code in full:
|
Sorry for the ping @oandregal, but it appears that perhaps some of the changes in #36907 might have caused this issue? Happy to keep investigating, but thought you might be able to spot it quicker if it is indeed related 😉 |
@oandregal FWIW, here's what I have found. If you remove support for
While the following does not:
Which basically means that once |
Also worth noting... even without |
#37254 is now ready and fixes this issue. This is how it works:
Note that 2.2 and 2.3 is how it works in Gutenberg 12.0.2. I don't know why |
Thanks so much for working on this @oandregal! |
This is the expected behavior btw. The reason is that there's a difference between:
This difference between |
I have tested #37254 and it works as expected! 🙌 The |
Yes, thanks to all who helped resolve this issue! |
Got it, thanks for sharing the rationale. As a data point for future additions, I don't find the current system very obvious. In my view, to encode three different states I'd avoid using booleans + null. I'd use strings or something like that. Something along the lines of "disabled", "only-enqueue", "enabled" is more obvious. |
☝️ Agree with the above |
WP 6.0 seams to have this issues again? unless I have "appearanceTools": false, then the block gap styles are enqueued if I set blockGap to null or not. Can anyone verify this @oandregal |
Yes still an issue in 6.0, and very confusing, as official docs |
@spencer-j the official documentation has a detailed guide on the various settings:
|
Ahh thanks @ndiego blockgap: null and appearanceTools: true is working for me now! |
Is there some non-technical documentation for a designer that just doesn't want his layouts messed up by blockgap? Perhaps some custom css that one can add to override this. |
Description
In 12.1, something changed (still trying to locate) that enables
blockGap
related CSS even ifblockGap
is not enabled in theme.json. I can also confirm that this issue exists in 5.9 Beta 2 without the Gutenberg plugin active.In Gutenberg 12.0.2, I have a Group block with a Paragraph and Buttons block inside. It looks something like this:
Now in 12.1, the same collection of blocks looks like this.
Notice all the additional CSS applied to the paragraph block. In theme.json,
blockGap
is not enabled on this theme.Step-by-step reproduction instructions
blockGap
in theme.jsonblockGap
related CSS added to the frontend.Screenshots, screen recording, code snippet
No response
Environment info
WordPress 5.9 Beta 2, Gutenberg 12.1
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
The text was updated successfully, but these errors were encountered: