-
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
Latest Comments: Add border block support #66020
base: trunk
Are you sure you want to change the base?
Changes from 6 commits
8cf68af
8c2b7e1
62bebfb
0b1dd41
bfe764a
b447807
37cb235
28e29c6
72b3168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.wp-block-latest-comments { | ||
// This block has customizable border, border-box makes that more predictable. | ||
box-sizing: border-box; | ||
} | ||
|
||
// Lower specificity - target list element. | ||
ol.wp-block-latest-comments { | ||
// Removes left spacing in Customizer Widgets screen. | ||
|
@@ -31,6 +36,9 @@ ol.wp-block-latest-comments { | |
// Remove left spacing. Higher specificity required to | ||
// override default wp-block layout styles in the Post/Site editor. | ||
padding-left: 0; | ||
// The following styles are to prevent duplicate border for the latest comments. | ||
border: none; | ||
border-radius: inherit; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming the intent of these is to prevent duplicate border due to the server side rendering in the editor?
The On that padding note, I'm not sure if the For this PR, I'd definitely sort out fixing the server-side rendering duplicate styles for padding and border. It's not much extra in terms of scope but if you really want to push the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you very much for the review, @aaronrobertshaw. I’ve implemented all your feedback and pushed the changes. The padding-left has been moved to the editor.scss file as it’s not needed on the frontend. Since this resolves the issue, I believe a separate PR for padding-left adjustments won’t be necessary. Let me know if you have any further suggestions! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the iteration @karthick-murugan but my feedback included fixing the duplicate padding caused by the server-side rendering. This isn't addressed by only moving the When fixing this, could you also update the PR test instructions to cover this? Also, how does the relocation of the In making changes to existing code or styles it's really helpful to keep Chesterton's Fence in mind. The TL;DR on that principle is we need to understand why something is in place before we change or move it to avoid unintended side effects. On top of that, each time I update a PR, I personally re-run through the test instructions and ask myself questions about what has changed. This helps make sure the PR is easy for others to review and helps reduce the feedback cycle duration, increasing velocity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, @aaronrobertshaw, for your detailed feedback and for emphasizing the importance of addressing the root cause and avoiding unintended regressions.
REC-20241126132321.1.mp4
REC-20241126131024.mp4
Please let me know if there’s anything else you’d like me to revisit or clarify. I appreciate your guidance and the opportunity to iterate on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This still hasn't been addressed. Steps to replicate:
Screen.Recording.2024-11-27.at.11.06.59.am.mp4In addition to the padding, the margin on the inner server-side rendered block also needs resetting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your feedback, @aaronrobertshaw. I believe I have addressed the padding and margin issues as part of the recent iteration. To ensure clarity, I’ve recorded a video demonstrating the changes and verifying the behaviour. REC-20241127124310.mp4If I’ve misunderstood or overlooked anything, please feel free to correct me. I appreciate your guidance and am happy to make further adjustments as needed. 😊 |
||
} | ||
|
||
.wp-block-latest-comments__comment { | ||
|
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.
Should this style still be in the frontend styles?
Its specificity is also higher than the style produced by global styles. (0-1-0). The only reason the global styles margins in the editor work is because the block is server-side rendered and the block's outer wrapper receiving the margins is then a
div
.In other words, when you moved the
margin-left: 0
style to the editor styles. Did you consider removing this? Better yet, did you test removing it at all, especially in the Customizer?