-
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
Site Logo: add padding and margin support #43520
Site Logo: add padding and margin support #43520
Conversation
docs/reference-guides/core-blocks.md
Outdated
@@ -725,7 +725,7 @@ Display a graphic to represent this site. Update the block, and the changes appl | |||
|
|||
- **Name:** core/site-logo | |||
- **Category:** theme | |||
- **Supports:** align, color (~~background~~, ~~text~~), ~~alignWide~~, ~~html~~ | |||
- **Supports:** align, color (~~background~~, ~~text~~), ~~alignWide~~, ~~html~~, spacing (margin, padding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is minor, but can you alphabetize the active supports followed by the alphabetized excluded supports? So spacing would come after color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing too minor. 👍 I addressed this and alpha sorted. Thanks!
For this block, I was not able to get top and bottom margin to work. |
@carolinan I pulled in the latest from trunk and tested again and all Here is a video: site-logo-padding-margin-support.mp4My local testing environment:
|
Thanks for the additional testing @carolinan It took me a bit to decipher whether your testing was offering successful or failure in moving this issue along, but I see that there needs to be additional CSS cascade resolution for this to work. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These margin issues has to be bigger than these two blocks, and not caused by the PR.
My concern is that these changes will go into 6.1 without the margin begin fixed, and it may appear broken to many users...
👍
I share these concerns as well and I'm glad you are keeping them on the radar. Do you happen to know if there is an existing issue related to the over-specificity for margin @carolinan ? |
There are a few issues already around the topic of layout and margin styles conflicting:
This has also been raised on some recent PRs adding margin support to blocks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening a PR for this one @colorful-tones, this is testing nicely for me, too. It looks like the margin styling conflicts issue is the one that @aaronrobertshaw linked to in #43404.
From my perspective, we shouldn't let that issue block merging in these opt-in PRs, as we will still have time to investigate bugs in style output after the 6.1 feature freeze. Dealing with specificity in the layout support and top margins is quite tricky to untangle as sometimes folks will want the Layout support to take precedence, and other times the block-level setting in theme.json
. Since the margin support does support block-level in post content overriding Layout styles, in most cases, folks should be able to still come up with manual workarounds, so I don't think it's a blocker for these opt-ins.
LGTM!
@colorful-tones one other thing that would be good to add before landing this, is the |
@andrewserong good call! I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating @colorful-tones, this is working nicely for me now! I'll merge this in and update the tracking issue 👍
Related:
What?
Add padding and margin support to the Site Logo block.
Why?
To create consistency across blocks.
How?
Added the relevant block support in
block.json
and updated Core Block Reference docs.Testing Instructions