Skip to content

Commit 4805b99

Browse files
Upgrade to NHS frontend v10 (#443)
Visible changes: * added new account section to the header for account page and sign out links * small design tweaks to the logo in the header (size and hover/active states) Other changes: * remove custom Button group css (this has been added upstream) * remove custom CSS for showing which section in the navigation is active (this has been added upstream) * update paths to NHS Frontend * change how the JavaScript is initialised --------- Co-authored-by: Colin Rotherham <[email protected]>
1 parent 8bc205f commit 4805b99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+329
-541
lines changed

app.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ const appViews = [
5252
path.join(__dirname, 'app/views/'),
5353
path.join(__dirname, 'lib/example-templates/'),
5454
path.join(__dirname, 'lib/prototype-admin/'),
55-
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/components'),
56-
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/macros'),
55+
path.join(__dirname, 'lib/templates/'),
56+
path.join(__dirname, 'node_modules/nhsuk-frontend/dist/nhsuk/components'),
57+
path.join(__dirname, 'node_modules/nhsuk-frontend/dist/nhsuk/macros'),
58+
path.join(__dirname, 'node_modules/nhsuk-frontend/dist/nhsuk'),
59+
path.join(__dirname, 'node_modules/nhsuk-frontend/dist'),
5760
path.join(__dirname, 'app/components/'),
5861
];
5962

@@ -161,7 +164,7 @@ app.set('trust proxy', 1);
161164
// Middleware to serve static assets
162165
app.use(express.static(path.join(__dirname, 'public')));
163166
app.use('/nhsuk-frontend', express.static(path.join(__dirname, 'node_modules/nhsuk-frontend/packages')));
164-
app.use('/nhsuk-frontend', express.static(path.join(__dirname, 'node_modules/nhsuk-frontend/dist')));
167+
app.use('/nhsuk-frontend', express.static(path.join(__dirname, 'node_modules/nhsuk-frontend/dist/nhsuk')));
165168

166169
// Use custom application routes
167170
app.use('/', routes);

app/assets/sass/components/_button-group.scss

Lines changed: 0 additions & 86 deletions
This file was deleted.

app/assets/sass/components/_button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@
7474

7575
.app-body--error {
7676
font-weight: bold;
77-
color: $nhsuk-error-color;
77+
color: $nhsuk-error-colour;
7878
}

app/assets/sass/components/_feedback-panel.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.app-feedback-panel {
2-
background-color: $color_nhsuk-white;
3-
border-color: $color_nhsuk-blue;
2+
background-color: nhsuk-colour("white");
3+
border-color: nhsuk-colour("blue");
44
border-width: nhsuk-spacing(1);
55
border-style: solid;
66
padding: nhsuk-spacing(4);

app/assets/sass/components/_header.scss

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
1-
2-
// Makes all navigation items from this one on right-aligned
3-
//
4-
// A bit of a hack - possibly they should be in 2 separate lists?
5-
.app-header__navigation-item--right-aligned {
6-
margin-left: auto;
7-
}
8-
9-
// Bump the border-bottom size up from 4px to 6px
10-
// - this gives the 'current' item more visual weight
11-
.nhsuk-header__navigation-link,
12-
.nhsuk-header__navigation-link:active,
13-
.nhsuk-header__navigation-link:focus {
14-
border-bottom-width: 6px;
15-
}
16-
17-
// A style to highlight the current section the user is in
18-
.app-header__navigation-link--current,
19-
.app-header__navigation-item--current a {
1+
// Remove default underline from link
2+
.app-header__navigation--no-underline .nhsuk-header__navigation-link {
203
text-decoration: none;
21-
border-bottom-color: $nhsuk-border-color;
224
}
235

24-
// Temporary mockup until this has been released
25-
.app-header__account-item {
26-
background-color: #004b93;
27-
padding: 3px 15px;
28-
border-radius: 5px;
6+
// Add underline back to just the label in the link
7+
.app-header__navigation--no-underline .nhsuk-header__navigation-link .app-header__navigation-link-label {
8+
text-decoration: underline;
299
}
3010

31-
.app-header__account-item .nhsuk-header__navigation-link {
32-
padding-top: 0px;
33-
padding-bottom: 0px;
11+
// Remove underline from the label in the link on hover
12+
.app-header__navigation--no-underline .nhsuk-header__navigation-link:hover .app-header__navigation-link-label {
13+
text-decoration: none;
3414
}
3515

3616

@@ -48,7 +28,7 @@
4828
.app-count {
4929
background-color: rgba(0, 47, 92, 0.4);
5030
border-radius: nhsuk-spacing(3);
51-
color: $color_nhsuk-white;
31+
color: nhsuk-colour("white");
5232
display: inline-block;
5333
min-width: nhsuk-spacing(5);
5434
padding-left: nhsuk-spacing(2);

app/assets/sass/components/_list-border.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// ==========================================================================
44

55
.nhsuk-list--border li {
6-
border-bottom: 1px solid $color_nhsuk-grey-4;
6+
border-bottom: 1px solid nhsuk-colour("grey-4");
77
padding: 8px 0 16px;
88
}

app/assets/sass/components/_related-nav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// ==========================================================================
44

55
.nhsuk-related-nav {
6-
border-top: 1px solid $nhsuk-border-color;
6+
border-top: 1px solid $nhsuk-border-colour;
77

88
@include nhsuk-media-query($until: desktop) {
99
margin-top: nhsuk-spacing(7);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.app-summary__explanation {
22
margin-top: nhsuk-spacing(2);
3-
color: $nhsuk-secondary-text-color;
3+
color: $nhsuk-secondary-text-colour;
44
}

app/assets/sass/components/_table.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ table {
2020

2121
.app-table__cell--border-right,
2222
.app-table__header--border-right {
23-
border-right: 2px solid $color_nhsuk-grey-4;
23+
border-right: 2px solid nhsuk-colour("grey-4");
2424
}
2525

2626
.app-table__header--border-top {
27-
border-top: 2px solid $color_nhsuk-grey-4;
27+
border-top: 2px solid nhsuk-colour("grey-4");
2828
}
2929

3030
.app-table__cell--padding-left,

app/assets/sass/components/_tag.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// This is like the nhsuk-tag--blue variant,
33
// but without the darker border.
44
.app-tag--header {
5-
background-color: nhsuk-tint($color_nhsuk-blue, 80%);
6-
border-color: nhsuk-tint($color_nhsuk-blue, 80%);
7-
color: nhsuk-shade($color_nhsuk-blue, 30%);
5+
background-color: nhsuk-tint(nhsuk-colour("blue"), 80%);
6+
border-color: nhsuk-tint(nhsuk-colour("blue"), 80%);
7+
color: nhsuk-shade(nhsuk-colour("blue"), 30%);
8+
9+
// Reduce padding slightly from 4px to 3px so it fits in the navigation item
10+
padding-top: 3px;
11+
padding-bottom: 3px;
812
}

0 commit comments

Comments
 (0)