Skip to content

Commit 7ec7f4d

Browse files
Merge pull request #77 from NHSDigital/sass-updates
Update NHS.UK frontend, migrate to Sass modules, update Node.js
2 parents d7f1a8c + 17f8554 commit 7ec7f4d

20 files changed

Lines changed: 871 additions & 627 deletions

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
lts/jod

app/assets/sass/_button-group.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
3+
14
// Adapted from https://github.com/alphagov/govuk-frontend/blob/5786234c2fc2e89e2b6a925211ca1cfd38fda146/packages/govuk-frontend/src/govuk/objects/_button-group.scss#L3
25

36
// Button groups can be used to group buttons and links together as a group.
@@ -18,8 +21,6 @@
1821

1922
$link-spacing: nhsuk-spacing(1);
2023

21-
@include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
22-
2324
// Flexbox is used to center-align links on mobile, align everything along
2425
// the baseline on tablet and above, and to removes extra whitespace that
2526
// we'd get between the buttons and links because they're inline-blocks.
@@ -32,20 +33,22 @@
3233
flex-direction: column;
3334
align-items: center;
3435

36+
@include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
37+
3538
// Give links within the button group the same font-size and line-height
3639
// as buttons.
3740
//
3841
// Because we want the focus state to be tight around the link text, we use
3942
// margins where the buttons would use padding.
4043
.nhsuk-link {
41-
@include nhsuk-font($size: 19, $line-height: 19px);
4244
display: inline-block;
4345
// Prevent links overflowing their container in IE10/11 because of bug
4446
// with align-items: center
4547
max-width: 100%;
4648
margin-top: $link-spacing;
4749
margin-bottom: $link-spacing + $vertical-gap;
4850
text-align: center;
51+
@include nhsuk-font($size: 19, $line-height: 19px);
4952
}
5053

5154
// Reduce the bottom margin to the size of the vertical gap (accommodating
@@ -56,7 +59,7 @@
5659

5760
// On tablet and above, we also introduce a 'column gap' between the
5861
// buttons and links in each row and left align links
59-
@include govuk-media-query($from: tablet) {
62+
@include nhsuk-media-query($from: tablet) {
6063
// Cancel out the column gap for the last item in each row
6164
margin-right: ($horizontal-gap * -1);
6265

app/assets/sass/_misc.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
3+
14
.app-mammogram-image--placeholder {
25
background-color: black;
36
width: 75px;

app/assets/sass/_typography.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/styles/typography' as *;
3+
@use 'nhsuk-frontend/packages/core/tools' as *;
4+
15
h1 {
26
@extend %nhsuk-heading-l;
37
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
.app-count {
2-
@include nhsuk-font(16);
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
33

4+
.app-count {
45
background-color: rgba($color_nhsuk-grey-4, 0.5);
56
border-radius: nhsuk-spacing(3);
67
display: inline-block;
78
min-width: nhsuk-spacing(5);
89
padding-left: nhsuk-spacing(2);
910
padding-right: nhsuk-spacing(2);
1011
text-align: center;
12+
@include nhsuk-font(16);
1113
}

app/assets/sass/components/_dark-mode.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
3+
14
$app-dark-mode-blue: #348de0;
25
$app-dark-mode-background: #1C1C1C;
3-
$app-dark-mode-background-secondary: tint($app-dark-mode-background, 10%);
6+
$app-dark-mode-background-secondary: nhsuk-tint($app-dark-mode-background, 10%);
47
$app-dark-mode-white: #E8E8E8;
58
$app-dark-mode-text-colour: $app-dark-mode-white;
6-
$app-dark-mode-text-colour-secondary: shade($app-dark-mode-text-colour, 30%);
9+
$app-dark-mode-text-colour-secondary: nhsuk-shade($app-dark-mode-text-colour, 30%);
710

811
// Links
912
$app-dark-mode-link-color: $app-dark-mode-blue;
10-
$app-dark-mode-link-hover-color: tint($color_nhsuk-dark-pink, 50%);
11-
$app-dark-mode-link-active-color: shade($app-dark-mode-link-color, 20%);
12-
$app-dark-mode-link-visited-color: tint($color_nhsuk-purple, 50%);
13+
$app-dark-mode-link-hover-color: nhsuk-tint($color_nhsuk-dark-pink, 50%);
14+
$app-dark-mode-link-active-color: nhsuk-shade($app-dark-mode-link-color, 20%);
15+
$app-dark-mode-link-visited-color: nhsuk-tint($color_nhsuk-purple, 50%);
1316

1417
// Paul's colours
1518
$app-dark-mode-link-color: #348de0;

app/assets/sass/components/_forward-link.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
3+
14
////
25
/// Back link component
36
///
@@ -13,22 +16,21 @@
1316
margin-top: nhsuk-spacing(3);
1417
line-height: 1; // [5]
1518

16-
@include mq($from: tablet) {
19+
@include nhsuk-media-query($from: tablet) {
1720
margin-top: nhsuk-spacing(4);
1821
}
1922
}
2023

2124
.app-forward-link__link {
22-
@include nhsuk-typography-responsive(16);
23-
@include nhsuk-link-style-default;
24-
2525
background: none;
2626
border: 0;
2727
cursor: pointer;
2828
display: inline-block;
2929
padding: 0 16px 0 0; // [1]
3030
position: relative;
3131
text-decoration: none;
32+
@include nhsuk-link-style-default;
33+
@include nhsuk-font-size(16);
3234

3335
.nhsuk-icon__chevron-right {
3436
height: 24px;
@@ -37,7 +39,7 @@
3739
top: -1px; // [3]
3840
width: 24px;
3941

40-
@include mq($from: tablet) {
42+
@include nhsuk-media-query($from: tablet) {
4143
top: 0; // [3]
4244
}
4345
}

app/assets/sass/components/_header-organisation.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
@use 'nhsuk-frontend/packages/core/settings' as *;
2+
@use 'nhsuk-frontend/packages/core/tools' as *;
3+
@use 'header' as *;
4+
15
/**
26
* Organisation header variant
37
*/
48

59
.nhsuk-header--organisation {
610
.nhsuk-header__link {
7-
@include nhsuk-link-style-header;
811
display: block;
12+
@include nhsuk-link-style-header;
913

1014
&:focus {
1115
.nhsuk-organisation-name,
@@ -19,20 +23,19 @@
1923
height: 24px;
2024
width: 60px;
2125

22-
@include mq($from: tablet) {
26+
@include nhsuk-media-query($from: tablet) {
2327
height: 32px;
2428
width: 80px;
2529
}
2630
}
2731
}
2832

2933
.nhsuk-organisation-name {
30-
@include nhsuk-font(22, $line-height: 1.1);
3134
color: $color_nhsuk-white;
3235
display: block;
33-
font-weight: bold;
36+
@include nhsuk-font(22, $line-height: 1.1, $weight: bold);
3437

35-
@include mq($media-type: print) {
38+
@include nhsuk-media-query($media-type: print) {
3639
color: $nhsuk-print-text-color;
3740
}
3841
}
@@ -42,12 +45,11 @@
4245
}
4346

4447
.nhsuk-organisation-descriptor {
45-
@include nhsuk-font(14);
4648
color: $color_nhsuk-white;
4749
display: block;
48-
font-weight: bold;
50+
@include nhsuk-font(14, $weight: bold);
4951

50-
@include mq($media-type: print) {
52+
@include nhsuk-media-query($media-type: print) {
5153
color: $color_nhsuk-blue;
5254
}
5355
}

0 commit comments

Comments
 (0)