Skip to content

Commit

Permalink
fix(button menu): fix button spacings on very small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispymm committed Oct 28, 2024
1 parent 3b12870 commit 475ee1c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions src/moj/components/button-menu/_button-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ $moj-datepicker-mid-grey: #949494;
.moj-button-menu {
display: inline-block;
position: relative;

> .govuk-button {
margin-bottom: 0;
}
}

.moj-button-menu__toggle-button {
Expand Down
1 change: 1 addition & 0 deletions src/moj/components/button-menu/button-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MOJFrontend.ButtonMenu.prototype.init = function () {
if (className.startsWith("govuk-button-")) {
button.classList.remove(className);
}
button.classList.remove("moj-button-menu__item")
});
if (this.config.buttonClasses) {
button.classList.add(...this.config.buttonClasses.split(" "));
Expand Down
10 changes: 1 addition & 9 deletions src/moj/components/identity-bar/_identity-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
padding-top: govuk-spacing(2);
}


.moj-identity-bar__container {
@include moj-width-container;
font-size: 0; /* Hide whitespace between elements */
text-align: justify; /* Trick to remove the need for floats */

&:after {
content: '';
content: "";
display: inline-block;
width: 100%;
}

}

.moj-identity-bar__title {
Expand All @@ -42,18 +40,13 @@
padding-top: govuk-spacing(2) + 1px; /* Alignment tweaks */
padding-bottom: govuk-spacing(2) - 1px; /* Alignment tweaks */
}

}


.moj-identity-bar__actions {
margin-bottom: - govuk-spacing(2);

@include govuk-media-query($from: tablet) {
display: inline-block;
vertical-align: middle;
}

}

.moj-identity-bar__menu {
Expand All @@ -67,5 +60,4 @@
.moj-button-menu__toggle-button {
margin-bottom: 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

.moj-page-header-actions__actions {
.moj-button-group {
margin-bottom: 0
margin-bottom: 0;
}
.govuk-button {
margin-bottom: 0;
Expand Down
13 changes: 10 additions & 3 deletions src/moj/objects/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
flex-direction: row;
flex-wrap: wrap;
align-items: baseline;
margin-right: ($horizontal-gap * -1);
gap: $horizontal-gap;
margin-right: 0;

.moj-button-menu {
margin-bottom: $vertical-gap + $button-shadow-size;
Expand All @@ -20,11 +21,17 @@
.moj-button-menu .moj-button-menu__toggle-button {
vertical-align: baseline;
}

.moj-button-menu,
.govuk-button,
.govuk-link {
width: auto;
margin-right: $horizontal-gap;
}
margin-right: 0;
margin-bottom: 0;
}

/* :is(.govuk, .moj-button-menu, .govuk-link) + :is(.govuk, .moj-button-menu, .govuk-link) { */
/* margin-top: $horizontal-gap; */
/* } */
}
}

0 comments on commit 475ee1c

Please sign in to comment.