Improve hamburger mobile touch target and add aria-controls #3255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
For the mobile navigation menu, the hamburger icon's click area appears much smaller than what WCAG guidelines recommends for accessibility, which is a minimum of 44px height and width. I personally had difficulty attempting to toggle the menu on my mobile device; I couldn't consistently get it to open or close on each press.
For this fix:
top
andright
values to ensure the area is centered with the hamburger icon SVGaria-controls
to explicitly associate it with the navigation menuThe hamburger icon itself is rather small, so the clickable area is now a greater size and expands around it. This is acceptable from a UX-standpoint since there are no other buttons nearby that could accidently be pressed, and it is expected that this kind of input will be especially sensitive to trigger for ease of access.