-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Template: Add Border and Spacing Support #64425
Post Template: Add Border and Spacing Support #64425
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -189 B (-0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
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 the continued efforts on adopting border supports 👍
To be honest I'm not sure about whether borders are desirable on the Post Template block. It might be wise to get some design feedback on this one.
Additionally, is the Post Template block another case where it would be better to have these controls deemphasized making the padding, margin, and border controls optional?
04a740e
to
4b8718e
Compare
@aaronrobertshaw I have set the border and spacing controls to be optional by default. |
Thanks for tweaking that. I'm still really not convinced about further block support adoptions on the Post Template block. Any potential use case for this would have to be extremely niche. Let's leave this open for a while longer though and see if it gets any traction or design feedback. |
I agree with you Aki. |
I agree with you Aki too. |
Imo the Post Template block should either be treated:
Because it supports color, typography, and dimensions already, it feels like we're on the first path, so I don't really see any reason not to add border and spacing support. |
f9beb74
to
852a15b
Compare
Flaky tests detected in a4aac83. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12490587441
|
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.
Overall, this PR seems to be viewed positively, so let's move forward with it.
However, I think there are some issues that need to be addressed.
Left padding/margin not applied
Here is a style present to reset the left padding/margin, so we can't apply the left padding/margin via the global styles or theme.json:
We may need to reduce the specificity of the selector for the padding/margin reset styles by using :where
.
The grid frame is misaligned
When the layout is grid view and this block is selected, a grey frame appears. When a border is applied, it seems to be out of sync with the actual size of the post:
This issue can also be reproduced with the Grid block, so it's probably an issue with the GridVisualizer
component itself:
It may not necessarily need to be addressed in this PR, but the Post Template block will likely be used more than the Grid block, so the misalignment may be more noticeable there.
@t-hamano Thank you for the feedback. I have incorporated the suggested changes. Regarding Left padding/margin not applied Issue: I will work on this issue. |
I believe this problem should be resolved in #68230. |
This issue has been resolved and merged as #68230. @shail-mehta Could you rebase this PR so we can retest it? |
8c4dcf1
to
7b7ffac
Compare
@t-hamano I have rebased this PR. |
Thanks for the update! Finally, I think this problem needs to be solved.
From what I've tested, I think we might be able to remove the editor style itself, since there's already a zero-padding style in I've tried removing the editor styles as a trial, and it seems we can apply the left and right padding correctly via the global styles: |
@t-hamano I have incorporated the suggested changes. |
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 the update! From what I've tested, everything seems to work as expected. I was worried that deleting padding-left
and margin-left
from editor.scss
would cause a visual change in the classic theme, but it doesn't seem to be a problem.
@aaronrobertshaw @paaljoachim @jameskoster @jasmussen If there are no other concerns, I would like to ship this PR.
I have removed post-template/editor.scss file. |
From a quick glance, this seems to be a slew of upsides and few downsides. 👍 👍 from me. |
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.
@shail-mehta Thanks for addressing this issue 👍
What?
Add Border and Spacing support to the
Post Template
block.Part of #43247
Why?
Post Template
block is missing border support and spacing support.How?
Adds the border and spacing support in block.json.
Testing Instructions
Post Template
(Inside in Query Loop) block's border and spacing is Configurable via Global Styles.Post Template
(In Query Loop) and Apply the border Styles & Spacing.Post Template
block styles take precedence over global Styles.Post Template
block borders & spacing display correctly in both the Editor and Frontend.Screenshots or Screencast
add-border-and-spacing-support-in-post-template.mp4