Skip to content
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

Global header: Implement design updates #657

Merged
merged 7 commits into from
Oct 14, 2024
Merged

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Oct 10, 2024

This applies the style changes suggested in #572 for the global header. The header height is decreased (and any alignment issues fixed), the active style is more subtle, and the mobile menu is more consistent.

The menu items with child menus (Extend, Learn, etc) are now a lighter grey, but they are still focusable & clickable — this is core behavior for "click to open" submenus in the overlay menu. Nothing happens if you click them. This could be an issue for Gutenberg, but there's nothing we can do here (I tried a few things).

I simplified & fixed the modal view javascript now that the navigation block uses the Interactivity API instead of the micromodal library, so opening the search overlay will close an open menu overlay and vice versa.

The new design removed the side border on active items on mobile (see the 4th row of screenshots), which means the only indicator of current page is color. We need to add some other non-color effect here. @WordPress/meta-design

Fixes #572

Screenshots

The desktop screens are all neutral, no interactions. The mobile views were opened by keyboard, so the first element is focused. For News, it's also the current page.

Before After
before news desktop after news desktop
before showcase desktop after showcase desktop
before about desktop after about desktop
before news mobile after news mobile
before about mobile after about mobile

Video for focus & dropdown styles

desktop-tabs.mp4
showcase-mobile-tab.mp4

To test

  • Check out & build this branch
  • Use this with any of the other environments
  • See the header is shorter now
  • Make sure nothing looks broken


const openButtons = document.querySelectorAll( '[data-micromodal-trigger]' );
const openButtons = document.querySelectorAll(
'.global-header__navigation [data-wp-on-async--click="actions.openMenuOnClick"],' +
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to rely on the Interactivity API attributes? Is it fair to assume a button in the menu is a dropdown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a way to differentiate open and close buttons, if we went for just "button" it would catch both.

@jasmussen
Copy link
Collaborator

Looks great! If @fcoveram has a chance to look, it would be nice, but no blocker.

@ryelle ryelle merged commit 3269f6d into trunk Oct 14, 2024
2 checks passed
@ryelle ryelle deleted the update/global-header-styles branch October 14, 2024 19:10
@fcoveram
Copy link
Collaborator

Sorry for arriving late here. I was thinking of bringing the border line back. Here is a mockup of the border idea with visual tweaks.

Mockups of menu items in large and small breakpoints

If you all think the above looks good, I can create the issue and point out the new documentation in the Design Library.

@ryelle
Copy link
Contributor Author

ryelle commented Oct 15, 2024

If you all think the above looks good, I can create the issue and point out the new documentation in the Design Library.

Works for me. When you create the issue, can you write out exactly what "with visual tweaks" means— just adding the border, or did other spacing/sizes change, that kind of thing. Thanks!

@fcoveram
Copy link
Collaborator

I created the ticket #666 (👹) asking for implementing the idea dropped in my previous comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Consistency tweaks in Global nav
4 participants