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

WCAG 2.2: Increase header menu button min-height to 24px #4357

Closed
Tracked by #4347
dav-idc opened this issue Oct 20, 2023 · 1 comment · Fixed by #4150
Closed
Tracked by #4347

WCAG 2.2: Increase header menu button min-height to 24px #4357

dav-idc opened this issue Oct 20, 2023 · 1 comment · Fixed by #4150
Assignees
Labels
accessibility concern Any bug, feature request or question about the accessibility of a portion of a product accessibility 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) header WCAG 2.2 All items related to WCAG 2.2 update activities
Milestone

Comments

@dav-idc
Copy link

dav-idc commented Oct 20, 2023

Description of the issue

As part of my testing and calculations for the WCAG 2.2 'Target size (minimum)' criterion (restricted document), I tested the GOV.UK Design System header element.

I found that the 'Menu' button doesn't have a set height. Since the font is set to 16px, the menu button's height is 16px. That's pretty short, especially compared to the 40px height of our other buttons.

Steps to reproduce the issue

The header menu button can be viewed on this design system website code example, at a screen width between 320px and 768px: https://design-system.service.gov.uk/components/header/with-service-name-and-navigation/index.html

This screenshot shows the header component from that example link, at a screen width of 320px. I've moved focus to the 'Menu' element to visually highlight how little height there is for the menu's target area.
Header component at 320 pixel screen width, with the 'Menu' button focussed in a yellow focus highlight.

Actual vs expected behaviour

Actual behaviour: the menu button has a clickable target height of 16px.

Expected behaviour: WCAG 2.2 AA target size (minimum) recommends hit targets to be minimum 24px by 24px.

There's an exception for elements which are spaced out enough though:

Spacing: Undersized targets (those less than 24 by 24 CSS pixels) are positioned so that if a 24 CSS pixel diameter circle is centered on the bounding box of each, the circles do not intersect another target or the circle for another undersized target;

So this is not a WCAG failure, but nonetheless, the menu button could do with an increase to its hit-target height.

Recommendation

Add a minimum height of 24px to the 'Menu' button.

.govuk-header__menu-button{
    min-height: 24px;
    top: 16px;
}

Here's how it would look:
Header menu at 320px where the menu button has a minimum height of 24px.

Benefits of this change

  • Larger visual focus area
  • Easier to select (especially with large thumbs on mobile devices)
  • Menu button feels less vertically crowded

Environment (where applicable)

This is the environment in which I tested and found this issue:

  • Operating system: MacOS Ventura
  • Browser: Chrome
  • Browser version: 118
  • GOV.UK Frontend Version: V4.7
@dav-idc dav-idc added 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) accessibility header accessibility concern Any bug, feature request or question about the accessibility of a portion of a product WCAG 2.2 All items related to WCAG 2.2 update activities labels Oct 20, 2023
@alphagov alphagov deleted a comment from github-actions bot Oct 20, 2023
@alphagov alphagov deleted a comment from github-actions bot Oct 20, 2023
@alphagov alphagov deleted a comment from github-actions bot Oct 20, 2023
@owenatgov
Copy link
Contributor

I wondered if work being done for #3896 fixes this but it doesn't, it just makes it less bad. See the preview deployment for #4150. The menu button is now 20px instead of 16px. I think there's still value in David's recommendation.

owenatgov added a commit that referenced this issue Nov 20, 2023
Allows us to resolve #4357 at the same time
@owenatgov owenatgov added this to the v5.1 milestone Nov 21, 2023
@owenatgov owenatgov self-assigned this Nov 21, 2023
owenatgov added a commit that referenced this issue Dec 18, 2023
Allows us to resolve #4357 at the same time
owenatgov added a commit that referenced this issue Jan 2, 2024
Allows us to resolve #4357 at the same time
owenatgov added a commit that referenced this issue Jan 5, 2024
Allows us to resolve #4357 at the same time
owenatgov added a commit that referenced this issue Jan 8, 2024
Allows us to resolve #4357 at the same time
owenatgov added a commit that referenced this issue Jan 11, 2024
Allows us to resolve #4357 at the same time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility concern Any bug, feature request or question about the accessibility of a portion of a product accessibility 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) header WCAG 2.2 All items related to WCAG 2.2 update activities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants