Latest Comments: Fix uneven padding issue causing mis-alignment#77379
Latest Comments: Fix uneven padding issue causing mis-alignment#77379t-hamano merged 3 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
There was a problem hiding this comment.
Thanks for the PR! The approach looks good, but I'd suggest two additional improvements:
- Could we use
padding-leftinstead ofpaddingto minimize the effect on themes? - We should be able to delete this style.This style was necessary when the block had nested divs, but it is no longer needed.
|
Thanks @t-hamano for review and improvements i have replaced
what about above comment , are u saying to remove those styling , should i remove those styling as it is menioned it is not required now. |
Yes, that's right 👍 |
|
@t-hamano Thanks for the quick reply ! it is showing merging is blocked for me though changes are approved, could you please help me with that how can i merge or could you please merge this PR 🙌. |
|
@dpmehta, I will merge this PR once all CI checks pass. |
|
Thank you so much ! 🙌 |
* fix : reset padding with lowest specificity to avoid mis alignment * fix : improve padding reset by using padding-left * fix : removed styles which is no longer needed now Co-authored-by: dpmehta <mehtadev@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: himanshupathak95 <abcd95@git.wordpress.org> Co-authored-by: rinkalpagdar <rinkalpagdar@git.wordpress.org> Co-authored-by: viralsampat-multidots <mdviralsampat@git.wordpress.org>
What?
Closes #66043
This PR resets the padding for Latest Comments blocks because only left padding is added via user-agent-stylesheet which looks uneven and creates visually uneven layout compared to other blocks.
Why?
Due to only one side padding for Latest Comments block added via user-agent-stylesheet, it looks visually mis-aligned. While Latest Comments block is technically list block but we don't need bullet points etc so extra left indentation seems unnecessary and creates uneven layout
How?
This PR updates the Latest Comments block to reset the padding for Latest Comments block. The key point here is reset for padding is added using
:where()which has zero specificity, so it only overrides the user agent stylesheet's padding and Any global styles, theme.json overrides, or inspector padding controls will naturally take precedence without needing !important or higher specificity selectors and can be overridden easily.Testing Instructions
Screenshots or screencast
Before Fix
After Fix
Use of AI Tools
N/A