Skip to content

Conversation

@yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Feb 3, 2025

What, Why and How?

Closes #69007

This PR removes redundant styles applied for the ul element within Archives block.
Ref:

ul.wp-block-archives {
padding-left: 2.5em;
}

This style should be considered redundant because, by default, ul adds a 40px padding using padding-inline-start which matches the 2.5em padding in the above rule thereby making it redundant.

Screenshot 2025-02-03 at 5 40 45 PM

Testing Instructions

  1. Set Empty Theme as the Active Theme.
  2. Navigate to the post-edit page.
  3. Add Archive, List, and Categories List blocks in order.
  4. Confirm that they are identically aligned.

Screenshots

Screenshot 2025-02-03 at 5 37 58 PM

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review February 3, 2025 12:23
@github-actions
Copy link

github-actions bot commented Feb 3, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: iamtakashi <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@yogeshbhutkar
Copy link
Contributor Author

It looks like the removed styles were intentionally applied here: #9347, but I wonder if these are required as 2.5em is the default padding for ul as mentioned above. The associated issue also seems similar.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Archives Affects the Archives Block labels Feb 20, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I agree removing these styles as well.

The default 40px left padding provided by browsers is a fixed value, and the 2.5em applied to the Archive block is a relative value, so the margins may not match visually. TT5 example:

image

It looks like the removed styles were intentionally applied here: #9347

Perhaps this style was needed back then (about 6 years ago!).

@t-hamano t-hamano linked an issue Jul 14, 2025 that may be closed by this pull request
6 tasks
@t-hamano t-hamano added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jul 14, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jul 14, 2025
@t-hamano t-hamano merged commit 0fa0a2c into WordPress:trunk Jul 14, 2025
74 of 77 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 14, 2025
cbravobernal pushed a commit that referenced this pull request Jul 15, 2025
… `list` (#69008)

* Archives: Update padding for archives block to remain consistent with `list`

* Archives: Move padding from `editor.scss` to `style.scss`

* refactor: remove `padding-left` rule and use `ul` fallback

Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: iamtakashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Archives Affects the Archives Block [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Archives Block: Padding setting in JSON isn't respected in the editor The archives block has different padding compared to other lists

2 participants