-
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
Navigation: Small fixes #36298
Navigation: Small fixes #36298
Conversation
Size Change: +102 B (0%) Total Size: 1.09 MB
ℹ️ View Unchanged
|
ff2dc0a
to
5a3d46c
Compare
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.
Thanks for these improvements! The overflow fix is working well with the keyboard in both click and hover modes. The box-shadow is acting a bit funny for me though - see comment below.
(I also rebased this PR to make sure it worked with #36292 which I just merged)
@@ -290,18 +290,25 @@ | |||
} | |||
|
|||
// Default background and font color. | |||
.wp-block-navigation:not(.has-background) { |
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.
I can't reproduce the issue with has-background
not being applied on the front end. I'm seeing whether the background color is custom, theme defined or a default core one. Which theme are you using?
Regardless, the change is working well on the front end. But in the editor, I'm seeing this weird border at the bottom of each dropdown when nested 2 or more deep:
I think it's happening because the block appender doesn't get background-color
set inline, like the navigation items do, so the box-shadow becomes visible.
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.
Thank you for testing. It does look like those borders need a little more work, I'll dive in when I get my dev environment working again.
In the mean time, to clarify: has-background
is applied correctly when the Background
color is set. But it is not applied when only the Submenu & overlay background
color is set. I don't even think it should be, at least not on the main navigation block, possibly on submenus.
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.
LGTM!
* Navigation: Extract small fixes, and refine border rules. * Revert the box shadow change.
Cherry picked into the Gutenberg 11.9 release in: 1b0b445 |
* Navigation: Extract small fixes, and refine border rules. * Revert the box shadow change.
Uh, sorry about the readding the backport label, I thought i had forgotten to add it in the first place. |
Description
This PR extracts a few fixes from #36292 (the text alignment rule) and from #36215 (the overflow fixes), to make for a small mostly visual bugfix oriented PR that should be easily to rebase the other two on top of.
When submenus have customized background colors, the border around them should not show. This didn't work as intended, because on the frontend, the
has-background
class is not present for submenu items:The bug with the Submenu block not having its color set is separate.
This PR fixes it so that the
has-background
isn't needed at all, which simplifies things and also reduces specificity a bit:It does so by moving to an inset box-shadow which just gets covered by the explicitly set color.
It also ports over this small line-height fix. Click button sizes before:
After:
Finally it ports over the fix where submenus could create a horizontal scrollbar even when closed, because their contents would take up space.
How has this been tested?
Test the navigation block with nested submenus, test with click and hover options, test with enough submenus that when opened, they cause a horizontal scrollbar, and then verify that they don't when the menus are closed.
Checklist:
*.native.js
files for terms that need renaming or removal).