Skip to content

Commit 74a5ac3

Browse files
authored
This commit includes:
- new HTML includes specific for images with captions so they fit 100% of their container - images on pages use new includes - inset text has override style class to reduce margin-top - side nav now disappears when below 768px breakpoint (need to talk to design team about mobile solution)
1 parent be0285f commit 74a5ac3

File tree

8 files changed

+112
-18
lines changed

8 files changed

+112
-18
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<figure class="nhsuk-image-with-caption {{ include.class | xml_escape }}">
2+
{% assign src = '/assets/images/' | prepend: site.baseurl | append: include.src %}
3+
{% if include.src contains 'https://' %}
4+
<img class="nhsuk-image__img" src='{{ include.src | uri_escape }}' alt='{{ include.alt | xml_escape }}' />
5+
{% else %}
6+
<img class="nhsuk-image__img" src='{{ src }}' alt='{{ include.alt | xml_escape }}' />
7+
{% endif %}
8+
{% if include.caption %}
9+
<figcaption class="nhsuk-image__caption">
10+
{{ include.caption }}
11+
</figcaption>
12+
{% endif %}
13+
</figure>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="nhsuk-inset-text">
1+
<div class="nhsuk-inset-text-override">
22
<span class="nhsuk-u-visually-hidden">Information:</span>
33
{{ include.text | markdownify }}
44
</div>

docs/_sass/_nhsnotify-side-nav.scss

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,62 @@
11
.nhsnotify-pane {
2-
display: flex;
2+
display: -webkit-box;
3+
display: -ms-flexbox; // sass-lint:disable-line no-duplicate-properties
4+
display: flex; // sass-lint:disable-line no-duplicate-properties
35
min-height: 0;
46
overflow: inherit;
57
position: relative;
68
}
79

810
.nhsnotify-pane__side-bar {
11+
-ms-flex: 0 0 auto;
12+
-webkit-box-flex: 0;
913
flex: 0 0 auto;
10-
width: 280px;
11-
padding: 0;
14+
width: 220px;
15+
16+
@include mq($until: desktop) {
17+
display: none;
18+
}
1219
}
1320

1421
.nhsnotify-pane__main-content {
15-
display: flex;
22+
-ms-flex: 1 1 100%; // sass-lint:disable-line no-duplicate-properties
23+
-ms-flex-direction: column;
24+
-webkit-box-direction: normal;
25+
-webkit-box-flex: 1;
26+
-webkit-box-orient: vertical;
27+
display: -webkit-box;
28+
display: -ms-flexbox; // sass-lint:disable-line no-duplicate-properties
29+
display: flex; // sass-lint:disable-line no-duplicate-properties
1630
flex: 1 1 100%;
1731
flex-direction: column;
1832
min-width: 0;
33+
34+
@include mq($from: desktop) {
35+
padding-left: nhsuk-spacing(9);
36+
}
37+
1938
}
2039

2140
.nhsnotify-side-nav__list {
22-
font-size: 1em;
23-
line-height: 1.3;
41+
@include nhsuk-font(16, $line-height: 1.3);
2442
margin-bottom: 0;
43+
44+
@include mq($until: desktop) {
45+
@include nhsuk-font(19, $line-height: 1.3);
46+
margin-bottom: nhsuk-spacing(2);
47+
}
2548
}
2649

2750
.nhsnotify-side-nav__list-section {
28-
@extend .nhsuk-u-font-weight-bold;
29-
color: #4c6272;
30-
margin-bottom: 8px;
31-
padding-bottom: 4px;
32-
font-size: 1em;
51+
@include nhsuk-font(19, $line-height: 1.25, $weight: bold);
52+
color: $nhsuk-secondary-text-color;
53+
margin-bottom: 12px;
54+
padding-top: 4px;
55+
56+
@include mq($until: desktop) {
57+
@include nhsuk-font(24, $line-height: 1.25, $weight: bold);
58+
color: $nhsuk-text-color;
59+
}
3360
}
3461

3562
.nhsnotify-side-nav__item {
@@ -55,6 +82,10 @@
5582
.nhsnotify-side-nav__link {
5683
text-decoration: none;
5784

85+
@include mq($until: desktop) {
86+
text-decoration: underline;
87+
}
88+
5889
&:visited {
5990
color: $blue-000;
6091
}
@@ -68,3 +99,15 @@
6899
color: #212b32;
69100
}
70101
}
102+
103+
// Hide content on desktop
104+
.nhsnotify-u-hide-desktop {
105+
@include mq($from: desktop) {
106+
display: none;
107+
}
108+
}
109+
110+
// Mobile navigation
111+
.nhsnotify-index-navigation {
112+
@include nhsuk-responsive-padding(4, 'top');
113+
}

docs/_sass/_nhsnotify.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,41 @@
107107
line-height: 1.25;
108108
padding-left: 0.5em;
109109
}
110+
111+
.nhsuk-inset-text-override {
112+
@include top-and-bottom(); /* [1] */
113+
@include reading-width(); /* [2] */
114+
115+
@include nhsuk-responsive-margin(7, "bottom");
116+
@include nhsuk-responsive-margin(4, "top");
117+
@include nhsuk-responsive-padding(4);
118+
119+
border-left: $nhsuk-border-width-inset-text solid $color_nhsuk-blue;
120+
121+
@include mq($media-type: print) {
122+
border-color: $nhsuk-print-text-color;
123+
}
124+
}
125+
126+
.nhsuk-image-with-caption {
127+
background-color: $color_nhsuk-white;
128+
border-bottom: 1px solid $color_nhsuk-grey-4;
129+
130+
margin-left: 0; /* [1] */
131+
margin-right: 0; /* [1] */
132+
133+
@include nhsuk-responsive-margin(6, "bottom");
134+
@include nhsuk-responsive-margin(3, "top");
135+
136+
@include mq($from: desktop) {
137+
width: 100%; /* [2] */
138+
}
139+
140+
@include mq($media-type: print) {
141+
width: 50%; /* [3] */
142+
}
143+
144+
& + .nhsuk-image {
145+
@include nhsuk-responsive-margin(0, "top"); /* [4] */
146+
}
147+
}

docs/pages/features/emails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ section: Message channels
1212

1313
Use NHS Notify to send free unlimited emails to patients and members of the public, in bulk and individually.
1414

15-
{% include components/image.html
15+
{% include components/image-with-caption.html
1616
src="nhs-notify-email-example.svg"
1717
alt="A screenshot of an email sent by NHS Notify."
1818
caption="An example of an email sent by NHS Notify."

docs/pages/features/letters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ section: Message channels
1212

1313
You can use NHS Notify to print and send letters to patients and members of the public with addresses in the UK. You can do this in bulk and individually.
1414

15-
{% include components/image.html
15+
{% include components/image-with-caption.html
1616
src="nhs-notify-letter-two-sides-example.svg"
1717
alt="An image showing both sides of a letter sent by NHS Notify"
1818
caption="An example of a black and white double-sided letter sent by NHS Notify."

docs/pages/features/nhs-app-messages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ section: Message channels
1212

1313
Send free messages of up to 1,000 characters to patients and members of the public who have the NHS App.
1414

15-
{% include components/image.html
15+
{% include components/image-with-caption.html
1616
src="nhs-notify-nhs-app-example-2.svg"
1717
alt="A screenshot of an opened message in the NHS App inbox."
1818
caption="An example of a message sent with the NHS App."
@@ -43,7 +43,7 @@ When a user selects the banner notification, this opens their message in the NHS
4343

4444
To protect recipients, banner notifications pushed by the NHS App do not include any of your message content.
4545

46-
{% include components/image.html
46+
{% include components/image-with-caption.html
4747
src="nhs-notify-nhs-app-banner-notification.svg"
4848
alt="An image of 2 mobile devices side by side showing an example banner notification for both iPhone and Android devices pushed by the NHS App."
4949
caption="An example of a banner notification pushed to an iPhone and an Android device by the NHS App."
@@ -53,7 +53,7 @@ To protect recipients, banner notifications pushed by the NHS App do not include
5353

5454
When a recipient receives a NHS App message, a badge notification will appear on the NHS App icon. Badges let NHS App users know that there’s an unopened message or notification for them in the app.
5555

56-
{% include components/image.html
56+
{% include components/image-with-caption.html
5757
src="nhs-notify-nhs-app-badge-notification.svg"
5858
alt="A screenshot of the NHS App icon with a red badge showing 1 notification."
5959
caption="An example of a badge notification pushed by the NHS App when a message is sent to a recipient’s NHS App inbox."

docs/pages/features/text-messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ section: Message channels
1212

1313
Use NHS Notify to send text messages such as invitations, alerts, notifications or reminders to your audiences. You can do this in bulk and individually.
1414

15-
{% include components/image.html
15+
{% include components/image-with-caption.html
1616
src="nhs-notify-iphone-android-sms-example.svg"
1717
alt="An image of 2 mobile devices side by side showing a received text message, one displayed on iPhone and the other displayed on an Android device."
1818
caption="An example of a text message (SMS) sent by NHS Notify to an iPhone or Android mobile device."

0 commit comments

Comments
 (0)