Skip to content

Commit

Permalink
Merge pull request #5728 from alphagov/bk-fix-header-menu
Browse files Browse the repository at this point in the history
Prevent menu button being overlaid
  • Loading branch information
Ciandelle authored Feb 17, 2025
2 parents bb27829 + 8b5a966 commit 4faad64
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/govuk-frontend/src/govuk/components/header/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,9 @@

.govuk-header__menu-button {
@include govuk-font($size: 16);
position: absolute;
// calculate top offset by:
// - getting the vertical spacing for the top and the bottom of the header
// - adding that to the crown height
// - dividing it by 2 so you have the vertical centre of the header
// - subtracting half the height of the menu button
top: (((govuk-spacing($govuk-header-vertical-spacing-value) * 2) + $govuk-header-crown-height) / 2) -
($govuk-header-menu-button-height / 2);
right: 0;
max-width: $govuk-header-menu-button-width;
min-height: $govuk-header-menu-button-height;
margin: 0;
margin-bottom: govuk-spacing(1);
padding: 0;
border: 0;
color: govuk-colour("white");
Expand Down Expand Up @@ -245,6 +236,19 @@
@include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
}

@include govuk-media-query($from: mobile) {
position: absolute;
// calculate top offset by:
// - getting the vertical spacing for the top and the bottom of the header
// - adding that to the crown height
// - dividing it by 2 so you have the vertical centre of the header
// - subtracting half the height of the menu button
top: (((govuk-spacing($govuk-header-vertical-spacing-value) * 2) + $govuk-header-crown-height) / 2) -
($govuk-header-menu-button-height / 2);
right: 0;
margin: 0;
}

@include govuk-media-query($from: tablet) {
top: govuk-spacing(3);
}
Expand Down

0 comments on commit 4faad64

Please sign in to comment.