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

Increase menu button touch area on small screens #4503

Merged
merged 4 commits into from
Jun 3, 2021
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented May 6, 2021

Objectives

  • Make it easier to touch the menu button on small screens
  • Make the "Menu" text show/hide the menu, as some users might expect so
  • Let screen readers users with a small screen hear the word "menu" associated to the button
  • Simplify styles for the menu button
  • Add tests making sure the menu button works properly

Visual changes

Before these changes

Note the "menu" text is not clickable.

The "menu" text lies next to the menu icon and it isn't clear which parts can be clicked

After these changes

Note the "menu" text and everything between the text and the border is clickable.

The "menu" text and the menu icon are surrounded by a border in the shape of other buttons the application uses

@javierm javierm self-assigned this May 6, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation May 6, 2021
@javierm javierm added the UX label May 18, 2021
@javierm javierm force-pushed the menu_button branch 3 times, most recently from c6eb39b to dab2e80 Compare May 29, 2021 13:21
Using `currentcolor` and `color: inherit` is IMHO more expressive (we're
saying we want to use the same color as the text) and makes it easier to
customize these colors in other CONSUL installations. We also remove
duplication as we can use the same styles for both the admin and the
public layouts.
Some users might not be able to touch the icon due to a motor
disability. Other users might think the "Menu" text is part of the
button and try to touch it instead.

Making the "Menu" text part of the button makes it easier to show/hide
this menu. Besides, it lets screen reader users with a small screen hear
the word "Menu" associated to the button.

We could simplify the HTML a bit more but Foundation's `hamburger` mixin
uses the `::after` element with `position: absolute`, so we can't apply
it directly to the button without making the CSS more complex.
This way we make it more obvious that it's clickable and, since adding a
border requires adding padding, we increase the touch area, making it
easier to use and more accessible for users with motor disabilities.

Since now the button looks like a button, we don't need the pointer
cursor Foundation adds to hamburger icons and can use the default cursor
browsers provide for buttons.
Consul Democracy automation moved this from Reviewing to Testing Jun 2, 2021
@javierm javierm merged commit 3e921ec into master Jun 3, 2021
Consul Democracy automation moved this from Testing to Release 1.3.1 Jun 3, 2021
@javierm javierm deleted the menu_button branch June 3, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants