Skip to content

docs: Add menu drawer toggle to header on smaller viewports #105

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

joestrouth1
Copy link

See #87

Adds a 'Menu' button the the site header which opens the navigation drawer when clicked.

>=1220px wide (unchanged):

image

Tablet:

image

It needs work on phones. The header is already too wide for small (iPhone SE) screens and adding a menu/drawer toggle worsens the problem.

image

Some options for shrinking the width of header contents:

  • Swap 'Menu' for an icon
  • hide 'Docs' link since the menu drawer lists all the docs pages
  • hide GH/discord icons in sm-md header
    • maybe override the drawer or footer to show them there

@dmarcos
Copy link
Contributor

dmarcos commented Jul 9, 2025

Oh wow. this is awesome. It looks good. Gonna give it a try tomorrow before merge. Thanks so much for the effort

@dmarcos
Copy link
Contributor

dmarcos commented Jul 9, 2025

iphone SE is as small as phones can be these days and you have space from screenshot above. reduce left margin / padding of the magnifiying lense and use a "menu icon" instead of menu word

@joestrouth1
Copy link
Author

joestrouth1 commented Jul 9, 2025

Most recent changes:

  • swaps 'Menu' for a material icon
  • reduces inline padding on the header.md-header by half from 20px to 10px on small viewports
  • reduces padding around the Search and Menu buttons by half from 8px to 4px on small viewports
    • The size of each button decreases to 32px square which is between WCAG's minimum target size of 24px and their enhanced recommendation of 44px
  • reduces the gap between items in the .md-custom-header-right section from 1rem to 0.5rem on small viewports
    • moves the GH icon into the .md-custom-header-right and removes margin-right (relying on gap instead)

iPhone SE:

image
image

iPhone 14 Pro Max:

image

iPad Mini:

image

iPad Pro / laptop class:

image

@dmarcos
Copy link
Contributor

dmarcos commented Jul 9, 2025

Thanks so much. Icons should be probably spread more evenly and centered in the header in mobile screens. Also can we put the spark logo on the mobile menu vs the default one?

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.

2 participants