Skip to content

Commit 1e6da9a

Browse files
Improve display of screenshots
Also ensure figcaption uses similar design to that in the NHS design system
1 parent 3e6b33e commit 1e6da9a

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

app/_components/screenshots/_screenshots.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.app-screenshots__contents,
22
.app-screenshots__screenshot {
3-
margin-bottom: govuk-spacing(9);
3+
margin-bottom: govuk-spacing(9) !important;
44
}
55

66
@include govuk-media-query($media-type: print) {

app/_components/screenshots/template.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
{%- set itemId = item.id or (itemTitle | slugify) -%}
2020
{%- set file = item.src or (itemId + ".png") -%}
2121
{%- set alt = item.alt or ("Screenshot of " + itemTitle) -%}
22+
<h{{ headingLevel + 1 }} class="govuk-heading-m" tabindex="-1">
23+
<a class="app-link--heading govuk-link" href="#{{ itemId }}">{{ itemTitle }}</a>
24+
</h{{ headingLevel + 1 }}>
2225
<figure class="app-screenshots__screenshot" id="{{ itemId }}">
23-
<h{{ headingLevel + 1 }} class="govuk-heading-m" tabindex="-1">
24-
<a class="app-link--heading govuk-link" href="#{{ itemId }}">{{ itemTitle }}</a>
25-
</h{{ headingLevel + 1 }}>
2626
<a class="govuk-link" href="{{ file }}"><img src="{{ file }}" alt="{{ alt }}"></a>
2727
{%- if item.caption %}<figcaption>{{ item.caption | markdown | safe }}</figcaption>{% endif %}
2828
</figure>

app/styles/application.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ $govuk-font-family: Frutiger W01, arial, sans-serif;
3333
}
3434

3535
.app-prose-scope {
36+
// Simulate design used in NHS design system
37+
figure {
38+
@include govuk-responsive-margin(6, "bottom");
39+
@include govuk-responsive-margin(6, "top");
40+
41+
background-color: govuk-colour("white");
42+
border-bottom: 1px solid #d8dde0;
43+
}
44+
45+
figcaption {
46+
@include govuk-typography-responsive(16);
47+
color: $govuk-text-colour;
48+
margin-top: 0;
49+
padding: govuk-spacing(3);
50+
51+
* {
52+
@include govuk-typography-responsive(16);
53+
}
54+
55+
:last-child {
56+
margin-bottom: 0;
57+
}
58+
}
59+
3660
video {
3761
max-width: 100%;
3862
}

0 commit comments

Comments
 (0)