|
| 1 | +@use 'nhsuk-frontend/packages/core/settings' as *; |
| 2 | +@use 'nhsuk-frontend/packages/core/tools' as *; |
| 3 | + |
1 | 4 | // Adapted from https://github.com/alphagov/govuk-frontend/blob/5786234c2fc2e89e2b6a925211ca1cfd38fda146/packages/govuk-frontend/src/govuk/objects/_button-group.scss#L3 |
2 | 5 |
|
3 | 6 | // Button groups can be used to group buttons and links together as a group. |
|
18 | 21 |
|
19 | 22 | $link-spacing: nhsuk-spacing(1); |
20 | 23 |
|
21 | | - @include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1); |
22 | | - |
23 | 24 | // Flexbox is used to center-align links on mobile, align everything along |
24 | 25 | // the baseline on tablet and above, and to removes extra whitespace that |
25 | 26 | // we'd get between the buttons and links because they're inline-blocks. |
|
32 | 33 | flex-direction: column; |
33 | 34 | align-items: center; |
34 | 35 |
|
| 36 | + @include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1); |
| 37 | + |
35 | 38 | // Give links within the button group the same font-size and line-height |
36 | 39 | // as buttons. |
37 | 40 | // |
38 | 41 | // Because we want the focus state to be tight around the link text, we use |
39 | 42 | // margins where the buttons would use padding. |
40 | 43 | .nhsuk-link { |
41 | | - @include nhsuk-font($size: 19, $line-height: 19px); |
42 | 44 | display: inline-block; |
43 | 45 | // Prevent links overflowing their container in IE10/11 because of bug |
44 | 46 | // with align-items: center |
45 | 47 | max-width: 100%; |
46 | 48 | margin-top: $link-spacing; |
47 | 49 | margin-bottom: $link-spacing + $vertical-gap; |
48 | 50 | text-align: center; |
| 51 | + @include nhsuk-font($size: 19, $line-height: 19px); |
49 | 52 | } |
50 | 53 |
|
51 | 54 | // Reduce the bottom margin to the size of the vertical gap (accommodating |
|
56 | 59 |
|
57 | 60 | // On tablet and above, we also introduce a 'column gap' between the |
58 | 61 | // buttons and links in each row and left align links |
59 | | - @include govuk-media-query($from: tablet) { |
| 62 | + @include nhsuk-media-query($from: tablet) { |
60 | 63 | // Cancel out the column gap for the last item in each row |
61 | 64 | margin-right: ($horizontal-gap * -1); |
62 | 65 |
|
|
0 commit comments