Skip to content

Commit 8e10bfc

Browse files
More product page tweaks (#348)
1 parent 5169ddd commit 8e10bfc

File tree

7 files changed

+122
-93
lines changed

7 files changed

+122
-93
lines changed

app/assets/sass/_overrides.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
.app-u-hide-on-mobile {
3+
@include nhsuk-media-query($until: tablet) {
4+
display: none;
5+
}
6+
}
Lines changed: 77 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,86 @@
1-
.app-button-group {
2-
@include nhsuk-responsive-margin(6, "bottom");
3-
4-
align-items: center;
5-
display: flex;
6-
flex-direction: column;
7-
flex-wrap: wrap;
8-
gap: nhsuk-spacing(3) nhsuk-spacing(4);
9-
10-
.nhsuk-link {
11-
@include nhsuk-font($size: 19, $line-height: 19px);
12-
display: inline-block;
13-
margin-bottom: nhsuk-spacing(2);
14-
margin-top: nhsuk-spacing(2);
15-
max-width: 100%;
16-
text-align: center;
17-
}
1+
@include nhsuk-exports("nhsuk/core/objects/button-group") {
2+
// Button groups can be used to group buttons and links together as a group.
3+
//
4+
// Within a button group:
5+
//
6+
// - links are styled to line up visually with the buttons, including being
7+
// centre-aligned on mobile
8+
// - spacing between the buttons and links is handled automatically, including
9+
// when they wrap across multiple lines
10+
.app-button-group {
11+
$horizontal-gap: nhsuk-spacing(4);
12+
$vertical-gap: nhsuk-spacing(3);
1813

19-
.nhsuk-button {
20-
margin-bottom: 0;
21-
width: 100%;
22-
}
14+
// These need to be kept in sync with the button component's styles
15+
$button-border-radius: $nhsuk-border-width-form-element * 2;
16+
$button-shadow-size: $button-border-radius;
17+
$button-padding-top-bottom-mobile: 8px;
18+
$button-padding-top-bottom-desktop: 12px;
19+
20+
$link-spacing: nhsuk-spacing(2);
21+
22+
// Flexbox is used to center-align links on mobile, align everything along
23+
// the baseline on tablet and above, and to removes extra whitespace that
24+
// we'd get between the buttons and links because they're inline-blocks.
25+
//
26+
// Ideally we'd use `gap` with flexbox rather than having to do it all with
27+
// margins, but unfortunately the support isn't there (yet) and @supports
28+
// doesn't play nicely with it
29+
// (https://github.com/w3c/csswg-drafts/issues/3559)
30+
display: flex;
31+
flex-direction: column;
32+
align-items: center;
33+
34+
@include nhsuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
2335

24-
@include nhsuk-media-query($from: tablet) {
25-
flex-direction: row;
26-
flex-wrap: wrap;
36+
// Give links within the button group the same font-size and line-height
37+
// as buttons.
38+
//
39+
// Because we want the focus state to be tight around the link text, we use
40+
// margins where the buttons would use padding.
41+
.nhsuk-link,
42+
a:not(.nhsuk-button) {
43+
display: inline-block;
44+
// Prevent links overflowing their container in IE10/11 because of bug
45+
// with align-items: center
46+
max-width: 100%;
47+
margin-top: $button-padding-top-bottom-desktop + $nhsuk-border-width-form-element;
48+
margin-bottom: $button-padding-top-bottom-desktop + $nhsuk-border-width-form-element;
49+
text-align: center;
50+
@include nhsuk-font($size: 19);
2751

52+
@include nhsuk-media-query($until: tablet) {
53+
margin-top: $link-spacing;
54+
margin-bottom: $link-spacing + $vertical-gap;
55+
}
56+
}
57+
58+
// Reduce the bottom margin to the size of the vertical gap (accommodating
59+
// the button shadow) – the 'lost' margin is moved to the button-group.
2860
.nhsuk-button {
29-
width: auto;
61+
margin-bottom: $vertical-gap + $button-shadow-size;
3062
}
3163

32-
.nhsuk-link {
33-
text-align: left;
64+
// On tablet and above, we also introduce a 'column gap' between the
65+
// buttons and links in each row and left align links
66+
@include nhsuk-media-query($from: tablet) {
67+
// Cancel out the column gap for the last item in each row
68+
margin-right: ($horizontal-gap * -1);
69+
70+
flex-direction: row;
71+
flex-wrap: wrap;
72+
align-items: flex-start;
73+
74+
.nhsuk-button,
75+
.nhsuk-link,
76+
a {
77+
margin-right: $horizontal-gap;
78+
}
79+
80+
.nhsuk-link,
81+
a:not(.nhsuk-button) {
82+
text-align: left;
83+
}
3484
}
3585
}
3686
}

app/assets/sass/components/_button.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
min-width: 80px;
1313
}
1414

15+
// Make buttons full width on mobile
16+
// This is temporary until https://github.com/nhsuk/nhsuk-frontend/pull/1309 is merged
17+
.nhsuk-button {
18+
width: 100%;
19+
20+
@include nhsuk-media-query($from: tablet) {
21+
width: auto;
22+
}
23+
}
24+
1525

1626
.app-button--loading {
1727
position: relative;

app/assets/sass/main.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Import NHS.UK frontend library
22
@import 'node_modules/nhsuk-frontend/packages/nhsuk';
33

4+
// Local override classes
5+
@import 'overrides';
6+
47
// Components that are not in the NHS.UK frontend library
58
@import 'components/list-border';
69
@import 'components/related-nav';

app/views/apply/check.html

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
5959
},
6060
{
6161
key: {
62-
text: "Your name"
62+
text: "Name"
6363
},
6464
value: {
6565
html: data.firstName + " " + data.lastName
@@ -76,7 +76,7 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
7676
},
7777
{
7878
key: {
79-
text: "Your email"
79+
text: "Email"
8080
},
8181
value: {
8282
text: data.email
@@ -90,23 +90,6 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
9090
}
9191
]
9292
}
93-
},
94-
{
95-
key: {
96-
text: "Registered clinician"
97-
},
98-
value: {
99-
text: ("Yes" if data.clinician == "yes" else "No")
100-
},
101-
actions: {
102-
items: [
103-
{
104-
href: "/apply/contact-details",
105-
text: "Change",
106-
visuallyHiddenText: "clinician status"
107-
}
108-
]
109-
}
11093
}
11194
]
11295
}) }}

app/views/apply/contact-details.html

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<h1 class="nhsuk-heading-l">{{ pageName }}</h1>
2121

22-
<p>Use your personal nhs.net email or an <a href="https://digital.nhs.uk/services/care-identity-service/applications-and-services/apply-for-care-id/care-identity-email-domain-allow-list" target="_blank">NHS-approved email (opens in new tab)</a>.</p>
22+
<p>Use your personal nhs.net email, not a pharmacy email.</p>
2323

2424
<form action="/apply/check" method="post" novalidate="true">
2525

@@ -54,7 +54,7 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
5454
"text": "Email address"
5555
},
5656
hint: {
57-
text:"For example, [email protected] or [email protected]"
57+
text:"For example, [email protected]"
5858
},
5959
"id": "email",
6060
"name": "email",
@@ -65,30 +65,6 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
6565
} if emailError
6666
}) }}
6767

68-
{{ radios({
69-
name: "clinician",
70-
fieldset: {
71-
legend: {
72-
text: "Are you a registered clinician?"
73-
}
74-
},
75-
hint: {
76-
text: "We ask this so we can set you up with the right permissions."
77-
},
78-
value: data.clinician,
79-
items: [
80-
{
81-
value: "yes",
82-
text: "Yes"
83-
},
84-
{
85-
value: "no",
86-
text: "No"
87-
}
88-
]
89-
}) }}
90-
91-
9268
{{ button({
9369
"text": "Continue"
9470
}) }}

app/views/product-page.html

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
<div class="nhsuk-grid-row">
1313
<div class="nhsuk-grid-column-one-half nhsuk-u-one-half-tablet">
1414
<div class="nhsuk-hero__wrapper">
15-
<h1 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">The simplest way to record NHS vaccinations</h1>
16-
17-
<!-- <p class="nhsuk-body">Some words here</p> -->
15+
<h1 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">The simplest way to record vaccinations</h1>
1816

1917
<p>Record COVID-19, flu, RSV and pertussis vaccinations.</p>
2018

2119
<p class="nhsuk-body">Used by community pharmacies, NHS trusts and GPs.</p>
2220

23-
{{ button({
24-
text: "Sign up for free",
25-
href: "/apply/start",
26-
classes: "nhsuk-button--reverse nhsuk-u-margin-bottom-3"
27-
}) }}
21+
<div class="app-button-group nhsuk-u-margin-bottom-0">
22+
{{ button({
23+
text: "Sign up for free",
24+
href: "/apply/start",
25+
classes: "nhsuk-button--reverse"
26+
}) }}
2827

29-
<p class="nhsuk-u-margin-bottom-0">Or <a href="/okta-sign-in" class="nhsuk-link nhsuk-link--reverse">log in</a> if you've used it before</p>
28+
<p class="nhsuk-body nhsuk-u-margin-bottom-0">or <a href="/okta-sign-in" class="nhsuk-link nhsuk-link--reverse nhsuk-u-font-weight-bold">log in</a></p>
29+
</div>
3030
</div>
3131
</div>
32-
<div class="nhsuk-grid-column-one-half nhsuk-u-one-half-tablet nhsuk-u-padding-top-6">
32+
<div class="nhsuk-grid-column-one-half nhsuk-u-one-half-tablet nhsuk-u-padding-top-6 app-u-hide-on-mobile">
3333
<img class="app-homepage-illustration" src="/images/homepage-illustration.png" alt="" role="presentation" style="width: 100%;">
3434
</div>
3535
</div>
@@ -41,7 +41,7 @@ <h1 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">The simplest way to record N
4141
<div class="nhsuk-grid-row">
4242
<div class="nhsuk-grid-column-one-third">
4343
<h2 class="nhsuk-heading-s nhsuk-u-margin-bottom-2">Free to use</h2>
44-
<p class="">Created and owned by the NHS.</p>
44+
<p class="nhsuk-body">Created and owned by the NHS.</p>
4545
</div>
4646

4747
<div class="nhsuk-grid-column-one-third">
@@ -157,21 +157,22 @@ <h3 class="nhsuk-heading-m app-numbered-heading">
157157
<div class="nhsuk-grid-column-one-third">
158158
<div class="nhsuk-u-font-size-19 nhsuk-u-margin-top-2">
159159
More than<br>
160-
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">1.5 million</span><br> vaccinations recorded
160+
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">1.4 million</span><br> vaccinations recorded
161161
</div>
162162
</div>
163163

164164
<div class="nhsuk-grid-column-one-third">
165165
<div class="nhsuk-u-font-size-19 nhsuk-u-margin-top-2">
166166
Over<br>
167-
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">13,000 users</span><br>
168-
167+
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">13,000</span><br>
168+
users
169169
</div>
170170
</div>
171171
<div class="nhsuk-grid-column-one-third">
172172
<div class="nhsuk-u-font-size-19 nhsuk-u-margin-top-2">
173173
Used by<br>
174-
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">215 NHS trusts</span><br>
174+
<span class="nhsuk-u-font-size-36 nhsuk-u-font-weight-bold">300+</span><br>
175+
pharmacies and NHS trusts
175176

176177
</div>
177178
</div>
@@ -185,10 +186,10 @@ <h3 class="nhsuk-heading-m app-numbered-heading">
185186
<div class="nhsuk-main-wrapper nhsuk-u-padding-top-4 nhsuk-u-padding-bottom-4">
186187

187188
<div class="nhsuk-grid-row">
188-
<div class="nhsuk-grid-column-two-thirds">
189+
<div class="nhsuk-grid-column-full-width">
189190
<div style="width: 100px; height: 100px; background-image: url('/images/pharmacist.jpg'); background-size: cover; border-radius: 50px; float: left;"></div>
190-
<div style="margin-left: 150px; max-width: 400px;" class="nhsuk-body nhsuk-u-font-size-26 nhsuk-u-margin-top-2">
191-
<blockquote class="nhsuk-u-padding-0 nhsuk-u-margin-0 nhsuk-u-margin-bottom-1">
191+
<div style="margin-left: 150px; max-width: 700px;" class="nhsuk-body nhsuk-u-font-size-26 nhsuk-u-margin-top-2">
192+
<blockquote class="nhsuk-u-padding-0 nhsuk-u-margin-0 nhsuk-u-margin-bottom-1 nhsuk-u-padding-top-3">
192193
“It's easy and quick to use. Our staff love it.”
193194
</blockquote>
194195

@@ -211,10 +212,10 @@ <h3 class="nhsuk-heading-m app-numbered-heading">
211212

212213
<h2 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">Switching from another pharmacy system?</h2>
213214

214-
<p>You can switch systems at any time, and use different systems for different pharmacies.</p>
215-
215+
<p>You can switch point of care systems at any time, and use different systems for different pharmacies.</p>
216+
216217
<p>You will still have access to your previous system for at least 6 months so you can download reports.</p>
217-
218+
218219
<p>Other questions? <a href="#">Get in touch</a>.</p>
219220

220221
</div>

0 commit comments

Comments
 (0)