Skip to content

Commit 9440736

Browse files
Use spacing from NHS App Frontend
1 parent 9869c4f commit 9440736

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

packages/nhsuk-frontend/src/nhsuk/core/objects/_button-group.scss

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
// - spacing between the buttons and links is handled automatically, including
1212
// when they wrap across multiple lines
1313
.nhsuk-button-group {
14-
$horizontal-gap: nhsuk-spacing(3);
14+
$horizontal-gap: nhsuk-spacing(4);
1515
$vertical-gap: nhsuk-spacing(3);
1616

1717
// These need to be kept in sync with the button component's styles
1818
$button-border-radius: $nhsuk-border-width-form-element * 2;
1919
$button-shadow-size: $button-border-radius;
20+
$button-padding-top-bottom-mobile: 8px;
21+
$button-padding-top-bottom-desktop: 12px;
2022

21-
$link-spacing: nhsuk-spacing(1);
23+
$link-spacing: nhsuk-spacing(2);
2224

2325
// Flexbox is used to center-align links on mobile, align everything along
2426
// the baseline on tablet and above, and to removes extra whitespace that
@@ -32,7 +34,7 @@
3234
flex-direction: column;
3335
align-items: center;
3436

35-
@include nhsuk-responsive-margin(5, "bottom", $adjustment: $vertical-gap * -1);
37+
@include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
3638

3739
// Give links within the button group the same font-size and line-height
3840
// as buttons.
@@ -42,9 +44,18 @@
4244
.nhsuk-link,
4345
a:not(.nhsuk-button) {
4446
display: inline-block;
45-
margin-top: $link-spacing;
46-
margin-bottom: $vertical-gap;
47+
// Prevent links overflowing their container in IE10/11 because of bug
48+
// with align-items: center
49+
max-width: 100%;
50+
margin-top: $button-padding-top-bottom-desktop + $nhsuk-border-width-form-element;
51+
margin-bottom: $button-padding-top-bottom-desktop + $nhsuk-border-width-form-element;
52+
text-align: center;
4753
@include nhsuk-font($size: 19);
54+
55+
@include nhsuk-media-query($until: tablet) {
56+
margin-top: $link-spacing;
57+
margin-bottom: $link-spacing + $vertical-gap;
58+
}
4859
}
4960

5061
// Reduce the bottom margin to the size of the vertical gap (accommodating
@@ -61,7 +72,7 @@
6172

6273
flex-direction: row;
6374
flex-wrap: wrap;
64-
align-items: baseline;
75+
align-items: flex-start;
6576

6677
.nhsuk-button,
6778
.nhsuk-link,

0 commit comments

Comments
 (0)