-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Editor - Unification MenuSwitcher in UnselectedMenuState and Header #30349
Conversation
Size Change: +12 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
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 tested this and can confirm that with this change the "unselected menu" state has the correct left/right padding of 8px
which matches that in the menu "switcher".
However...
I'm not comfortable with applying this components-dropdown-menu__menu
class purely for inheriting some styling when the target component is completely unrelated and not a dropdown. There's no telling what additional styles might be adding/remove from this [components-dropdown-menu__menu
] class in future and this exposes the "unselected" menu component to regressions and introduces a maintenance burden.
I see two options:
- Create our own class which manually copies the (actually quite limited) set of styles we need to mirror the dropdown styles and apply this class to both the dropdown and the unselected menu state versions with high specificity. That way we can better ensure we are in control of the styling.
- Accept that the "unselected menu" state is not the same as the "switch menu" dropdown and style it slightly differently.
Personally, I'd say that #2 is a better approach. As things stand my first impression of the unselected menu state was that it needs some design anyway. It felt a bit "lost" in the middle of the page and it needs some instructional text and context.
I'd be interested in seeing what @critterverse thinks.
Update - the visuals for the "unselected menu" state could look a bit like those shown in the video in this Issue |
Completely agree with that. Applying our own styles might be ok. There's another thing I noticed, which is that the dropdown menu component is applying styles to menu groups, when perhaps menu group should implement its own styles. An option might be to move those styles from dropdown menu to menu group so that they're universal. I tried to check out all the usages of menu group components, and it seems like they're all used in dropdown menus, so I think this would be ok, however it's hard to say for sure without testing everything. |
My two cents here: I agree with @getdave that we would probably need to improve the design of the "Choose a menu to edit" screen, but in the meantime, I'd try to fix the padding of the second switcher since it doesn't look right. |
Closing this issue due to the Navigation Screen project being moved to an inactive status on the feature projects page in coordination with the project leads. (The developer documentation in the initial post are no longer accessible) If this work is picked back up, issues can be revisited and reopened as needed. Thanks for pitching in on this early feature so the wider WordPress project could benefit from the lessons learned! |
Description
Edit: the issue is that the padding used on the menu switcher is different in the x2 places the menu switcher is used within the Navigation Editor:
Switch menu
button (top right).Delete menu
from the block settings in the right hand sidebar. You will then be asked to select a menu to editor.As
MenuSwitcher
is wrapped inDropdownMenu
inHeader
, thecomponents-dropdown-menu__menu
css class is added toNavigableMenu
. InUnselectedMenuState
the class was missing and it made the same component in these two places look slightly different - padding was missing.In order to make it look the same we can do one of the following:
components-dropdown-menu__menu
- this would not be a scalable solutioncomponents-dropdown-menu__menu
- it would be a preferable way from my perspective, but I remember @talldan pointed scss@extend
should be avoidedcomponents-dropdown-menu__menu
directly to theNavigableMenu
element - as it can be confusing in the code, I have added a comment to explain why this class is added thereHow has this been tested?
Switch Menu
in the headerTypes of changes
Style fix
Checklist:
*.native.js
files for terms that need renaming or removal).