-
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
Post Comments block: Whitespace on top of warning message #40826
Comments
Hi, I would love to take this issue up. As per my investigation, this issue is theme specific. In twentytwnetytwo theme we have added a custom spacing. https://github.com/WordPress/twentytwentytwo/blob/trunk/theme.json#L141 I'm not sure how to fix this. Shall I directly add property I changed the theme to tt1 block. I don't any space there. I'm sharing screenshots for reference. |
Thanks @amustaque97, that's helpful information!
We shouldn't add
It's a tricky question 😅 -- when I filed this issue, I wasn't really sure how we'd tackle it. I tried to think a bit more about it now and had an idea: Both this issue and #40536 stem from the fact that the Warning is displayed "inside" of the block. But there’s precedent for Warnings that are displayed outside (such as the "Invalid Block markup" warning), and they don’t suffer from those issues. So I'd like to try that; I think there's hook for that. I'll have to dig a bit though to find the right one. |
Hi thank you for reply. I'm also going through all the related issues and PRs. I would like to add here is though we're trying to encapsulate warning block styling... In this issue, I thing we need some different fix. What I mean to say is I moved the Let me know what you guys think? |
Yeah, that's a good point @amustaque97. In this case, I think we should file a bug against the Twenty Twenty-Two theme. Since TT2 is now part of Core, that probably means filing a Trac ticket. I'm still not entirely sure what the correct fix (at theme level) will be. This is one of the first actual block themes, and I assume there's a reason for the top padding. In traditional themes, the layout is kinda fixed, so when applying some styling to change the space between layout elements, we always know which other elements are adjacent to any given element. This allows us to use CSS selectors to define spacing between elements in a pretty fine-grained way that will not leak to other occurrences of the same layout element. This is different with block themes, were the user can re-arrange blocks, or insert the block in a totally different place, and the block should still look "correct". The challenge for theme authors is twofold: First of all, make sure that the theme looks good "out-of-the-box", i.e. without any user modifications. Secondly, the blocks should still look good when moved around or inserted elsewhere. Thinking about this, I can't see too many possible solutions.
Curious to hear your thoughts 🙂 |
This is the particular commit when team added the
I agree, as you said it has its own limitation.
This solution makes the best sense to me since user is free to decide the padding. He can assign his own value without any hiccups. Furthermore, it would save them from going to |
Thanks, great find!
Looks like the PR you found was basically doing the opposite of that -- removing Spacer blocks in favor of that hard-wired padding 😅
👍 I've now filed https://core.trac.wordpress.org/ticket/55704 to suggest this change 🙂
Not sure what you mean by "add[ing] |
NO I didn't get chance to try it out. I got confused here! I mixed my previous findings in the last comment 😅 . Please ignore. |
@amustaque97 Would you like to give it a try? I think we basically need a PR filed against the |
Hey @ockham, can we close this issue? Since you already opened an issue on the core side. |
Yeah, should be okay to close I guess 👍 |
Description
Users that still have the now-deprecated Post Comments block in one of their templates (or elsewhere) will encounter a warning, suggesting them to use the Comments Query Loop block instead.
That warning has some ugly extra whitespace on top of it.
Step-by-step reproduction instructions
gutenberg/packages/block-library/src/post-comments/block.json
Line 37 in 54fd3bf
Screenshots, screen recording, code snippet
Environment info
No response
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: