close
Skip to content

Fix: Nested list indendation in editor for classic themes#69507

Open
karthikeya-io wants to merge 2 commits intoWordPress:trunkfrom
karthikeya-io:fix/classic-theme-indent-nested-list
Open

Fix: Nested list indendation in editor for classic themes#69507
karthikeya-io wants to merge 2 commits intoWordPress:trunkfrom
karthikeya-io:fix/classic-theme-indent-nested-list

Conversation

@karthikeya-io
Copy link
Copy Markdown
Contributor

@karthikeya-io karthikeya-io commented Mar 10, 2025

What?

Closes #69503
Related https://wordpress.org/support/topic/list-block-no-visual-nested-indent/

Why?

Fix nested list indentation in editor for classic themes.

This fixes the nested list indentation in the editor for following themes.

  • 2014, 15, 16, 17

How?

Prevents applying margin-left:auto and margin-right: auto to nested lists

Testing Instructions

  1. Activate Twenty Fifteen.
  2. Create a new post and add a list block.
  3. Add multiple list item and indent them with different depths.
  4. Confirm that the nested list items are visually indented as expected.

Testing Instructions for Keyboard

Same

Screenshots or screencast

Before After
image image

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 10, 2025
@github-actions
Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @karthikeya-io! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@karthikeya-io karthikeya-io force-pushed the fix/classic-theme-indent-nested-list branch from 30cb460 to f45e008 Compare March 10, 2025 11:42
@karthikeya-io karthikeya-io marked this pull request as ready for review March 10, 2025 12:25
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @rey.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: rey.

Co-authored-by: karthikeya-io <karthikeya01@git.wordpress.org>
Co-authored-by: sabernhardt <sabernhardt@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

@carolinan carolinan added [Block] List Affects the List Block [Type] Bug An existing feature does not function as intended labels Mar 17, 2025
Comment thread packages/edit-post/src/classic.scss Outdated
// rules like figure { margin: 0; } which would break centering.
// These rules should also not apply to direct children of flex layout blocks.
.editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block {
.editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block:not(.wp-block-list .wp-block-list) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

#60802 raised the specificity to the previous level of 0-2-0, but I do not think it should increase any more.

Suggested change
.editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block:not(.wp-block-list .wp-block-list) {
.editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block:where(:not(.wp-block-list .wp-block-list)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, Have updated the specificity.

@karthikeya-io karthikeya-io force-pushed the fix/classic-theme-indent-nested-list branch from f45e008 to 042e33c Compare June 12, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] List Affects the List Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classic themes: Default block margins are overriding the list block

3 participants