Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Associate menu button with nav element in header
The menu button is currently associated with the list inside the menu's navigation element through the use of `aria-controls`. However, it's really the navigation itself that is being controlled, so it makes more sense to apply the `navigation` id to the nav than the list. Because of the way the JavaScript uses aria-controls to find the toggled element, this also means that the `govuk-header__navigation--open` modifier class is being applied to the `<nav>`, so we also need to move the `govuk-header__navigation` and any `navigationClasses` passed to the component's macro to the `<nav>`. Because we're now toggling the visibility of the navigation region itself, rather than the list within it, this also avoids having an empty nav region present on the page when on a mobile viewport with the menu closed. Add a new `govuk-header__navigation-list` class to the list, and move the CSS required to reset the default user-agent list styles to this new class. The `govuk-responsive-margin(2, "bottom")` mixin call is redundant as it was previously being overridden by the `margin: 0` that followed, so that needs to be removed in order to maintain the existing design.
- Loading branch information