Navigation Block: fix inconsistent padding in nested submenus when "Open on click" is enabled
What?
Closes #70463
The left padding for nested submenu items in the navigation block is inconsistent when "Open on click" option is enabled for the navigation block. This PR fixes padding-left for the same.
Why?
As reported in #70463, nested submenu toggle buttons inherit conflicting padding styles when “Open on click” is used. The base class .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle applies a left padding of 0, which removes the indentation for nested levels. This results in visual inconsistency compared to when “Open on click” is disabled.
This commit restores appropriate left padding to maintain appropriate indentation for submenu items.
How?
Restored padding by targeting submenu items within the .wp-block-navigation__submenu-container ensuring minimal specificity interference.
Testing Instructions
- Add navigation block to a post
- Add a submenu block to the menu
- Within that submenu, add a nested submenu
- Enable Open on click via the sidebar settings
- Save the post and check on front end
- Verify the padding issue in the nested submenu
Screenshots or screencast
Before
After
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.
- Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
- Labels found: .
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 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: shrivastavanolo <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: R1shabh-Gupta <[email protected]>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Requesting review on this if possible. Thanks!
cc: @t-hamano @Mamaduka
As far as I can tell, this doesn't introduce regression for #50943, which introduced the padding reset.
cc @jasmussen
It's a bit far back in my memory, so I can't comment on the details off the top of my head, but at a glance it looks valid enough. I wonder if @carolinan has thoughts?