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

Add dropdown menu to header navigation #754

Merged
merged 9 commits into from
Jun 28, 2022

Conversation

choldgraf
Copy link
Collaborator

@choldgraf choldgraf commented Jun 24, 2022

This adds the ability to place some of the header navigation links in a Dropdown menu rather than being displayed immediately. By default the first 5 header links are displayed, and the remaining ones are placed in a dropdown menu. The number that are displayed can also be controlled with a new configuration variable. This should help save space for sites that have many header links or long titles (I believe @mwaskom had a use-case like this).

I've also added a few extra external links so we can demo this on our docs, and set our number of displayed links to 4 instead of 5 (matching the links we already have)

Here's a quick example:

chrome_Fok126ABgz

To do

  • Folks agree this is a good idea, if no objections then:
  • Get the tests passing

closes #571 closes closes #763

Copy link
Collaborator

@12rambau 12rambau left a comment

Choose a reason for hiding this comment

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

I think it's a good idea and I like the implementation.

See my comment about the gallery change

docs/scripts/generate_gallery_text.py Outdated Show resolved Hide resolved
@choldgraf
Copy link
Collaborator Author

Since this one is already improving the spacing of the header, I added flex-flow: wrap to this one so that we don't have overlapping header items.

closes #763

docs/scripts/generate_gallery_text.py Outdated Show resolved Hide resolved
choldgraf and others added 2 commits June 28, 2022 00:44
Co-authored-by: Rambaud Pierrick <12rambau@users.noreply.github.com>
@choldgraf choldgraf requested a review from 12rambau June 28, 2022 08:12
@choldgraf choldgraf merged commit e1d4009 into pydata:main Jun 28, 2022
@choldgraf
Copy link
Collaborator Author

thanks for the reviews all!

@chrisjsewell
Copy link

@choldgraf there are a few issues with the styling:

  1. It remains visible above the search bar:

image

  1. The UI/UX on mobile is a little non-ideal (e.g. More is not left-aligned, and now you have to click multiple times to navigate)

image

Another thought, perhaps these "dropdowns" would use the select/option HTML tags.
For mobile, these are nice because they actually integrate properly with the OS, see e.g. https://www.aiida.net

image

Although, the only pain is that it is not as easy to "connect" them to a URL anchor: https://lazacode.org/2029/html-select-and-go-to-url-with-onchange-event-attribute

@choldgraf
Copy link
Collaborator Author

Thanks for that feedback - I opened up a new issue to track it here: #769

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

Successfully merging this pull request may close these issues.

Navbar start items overlap with one another on medium screens Put some of the navbar links in a dropdown
4 participants