‘Not acceptable’: Gay Switchboard’s attempts to become a charity
-
-
Switchboard LGBT+ Helpline is one of the oldest telephone help services for lesbian, gay, bisexual, transgender and queer people in the UK. Despite high demand for its support, prejudice and laws meant Switchboard’s journey to register as a charity was not easy.
`,
+ supertitle: "Focus on",
+ title: "‘Not acceptable’: Gay Switchboard’s attempts to become a charity",
+ body: `
Switchboard LGBT+ Helpline is one of the oldest telephone help services for lesbian, gay, bisexual, transgender and queer people in the UK. Despite high demand for its support, prejudice and laws meant Switchboard’s journey to register as a charity was not easy.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
`,
+ title: "Title",
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
imageSrc:
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
imageAlt: "The National Archives office",
@@ -235,7 +261,9 @@ Mobile.parameters = {
},
};
Mobile.args = {
- content: `
Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
`,
+ supertitle: "Supertitle",
+ title: "Title",
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
imageSrc:
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
imageAlt: "The National Archives office",
diff --git a/src/nationalarchives/components/hero/macro-options.json b/src/nationalarchives/components/hero/macro-options.json
index df9c3238..4fe717dc 100644
--- a/src/nationalarchives/components/hero/macro-options.json
+++ b/src/nationalarchives/components/hero/macro-options.json
@@ -1,6 +1,37 @@
[
{
- "name": "content",
+ "name": "supertitle",
+ "type": "string",
+ "required": false,
+ "description": "The smaller title to display above the main hero title."
+ },
+ {
+ "name": "title",
+ "type": "string",
+ "required": false,
+ "description": "The main title of the hero. If set, then `headingLevel` also needs to be set."
+ },
+ {
+ "name": "headingLevel",
+ "type": "number",
+ "required": false,
+ "description": "The heading level which represents an element from `
` through to `
`. Default is `1`."
+ },
+ {
+ "name": "headingSize",
+ "type": "string",
+ "required": false,
+ "default": "m",
+ "description": "The physical size of the hero title (`xl`, `l`, `m` or `s`). Default is `xl`."
+ },
+ {
+ "name": "body",
+ "type": "string",
+ "required": false,
+ "description": ""
+ },
+ {
+ "name": "text",
"type": "string",
"required": false,
"description": ""
@@ -86,8 +117,8 @@
"description": "The style of hero to use. This can be `contrast`, `tint` or `accent`."
},
{
- "name": "shifted",
- "type": "boolean",
+ "name": "style",
+ "type": "string",
"required": false,
"description": ""
},
diff --git a/src/nationalarchives/components/hero/template.njk b/src/nationalarchives/components/hero/template.njk
index db6e3edf..023edac5 100644
--- a/src/nationalarchives/components/hero/template.njk
+++ b/src/nationalarchives/components/hero/template.njk
@@ -6,10 +6,13 @@
{%- elseif params.style == "accent" -%}
{%- set containerClasses = containerClasses.concat('tna-hero--accent') -%}
{%- endif -%}
-{%- if params.shifted -%}
- {%- set containerClasses = containerClasses.concat('tna-hero--shifted') -%}
+{%- if params.layout == "shift" -%}
+ {%- set containerClasses = containerClasses.concat('tna-hero--shift') -%}
+{%- elseif params.layout == "split" -%}
+ {%- set containerClasses = containerClasses.concat('tna-hero--split') -%}
{%- endif -%}
-<{{ 'header' if params.content else 'div' }} class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
+{% set hasContent = params.title or params.body or params.text %}
+<{{ 'header' if hasContent else 'div' }} class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
-{{ 'header' if params.content else 'div' }}>
+{{ 'header' if hasContent else 'div' }}>
diff --git a/src/nationalarchives/components/index-grid/macro-options.json b/src/nationalarchives/components/index-grid/macro-options.json
index 86a37f0a..6a5b3438 100644
--- a/src/nationalarchives/components/index-grid/macro-options.json
+++ b/src/nationalarchives/components/index-grid/macro-options.json
@@ -16,7 +16,7 @@
"type": "string",
"required": false,
"default": "m",
- "description": "The physical size of the index grid title."
+ "description": "The physical size of the index grid title (`xl`, `l`, `m` or `s`)."
},
{
"name": "headingHref",
diff --git a/src/nationalarchives/lib/functions.scss b/src/nationalarchives/lib/functions.scss
new file mode 100644
index 00000000..4423578a
--- /dev/null
+++ b/src/nationalarchives/lib/functions.scss
@@ -0,0 +1,16 @@
+@use "sass:string";
+
+@function str-replace($string, $search, $replace: "") {
+ $index: string.index($string, $search);
+
+ @if $index {
+ @return string.slice($string, 1, $index - 1) + $replace +
+ str-replace(
+ string.slice($string, $index + string.length($search)),
+ $search,
+ $replace
+ );
+ }
+
+ @return $string;
+}
diff --git a/src/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js b/src/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js
index f5b4dda4..1346ec34 100644
--- a/src/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js
+++ b/src/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js
@@ -191,7 +191,8 @@ const Template = ({ theme, accent }) => {
${Hero({
params: {
- content: `
Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
`,
+ title: "Title",
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
imageSrc:
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
imageAlt: "The National Archives office",
diff --git a/src/nationalarchives/utilities/_global.scss b/src/nationalarchives/utilities/_global.scss
index 1c20535b..205cfbb1 100644
--- a/src/nationalarchives/utilities/_global.scss
+++ b/src/nationalarchives/utilities/_global.scss
@@ -1,4 +1,12 @@
.tna-template {
+ /*
+ * ------------------------------------------
+ * A minimum page width of 320px is needed in
+ * order to meet the WCAG AA success criteria
+ * for 1.4.10 (Reflow)
+ * https://www.w3.org/WAI/WCAG21/Understanding/reflow.html
+ * ------------------------------------------
+ */
min-width: 320px;
width: 100%;
height: 100%;
diff --git a/src/nationalarchives/utilities/_imports.scss b/src/nationalarchives/utilities/_imports.scss
new file mode 100644
index 00000000..8d591c01
--- /dev/null
+++ b/src/nationalarchives/utilities/_imports.scss
@@ -0,0 +1,57 @@
+@use "../variables/assets";
+@use "../variables/typography";
+@use "../lib/functions";
+
+@if typography.$use-local-fonts {
+ @font-face {
+ font-family: typography.$main-font-family-name;
+ src: url("#{assets.$tna-font-path}/#{typography.$main-font-file}");
+ font-weight: typography.$main-font-weight;
+ font-style: normal;
+ font-display: swap;
+ }
+
+ @font-face {
+ font-family: typography.$main-font-family-name;
+ src: url("#{assets.$tna-font-path}/#{typography.$main-font-file-medium}");
+ font-weight: typography.$main-font-weight-medium;
+ font-style: normal;
+ font-display: swap;
+ }
+
+ @font-face {
+ font-family: typography.$main-font-family-name;
+ src: url("#{assets.$tna-font-path}/#{typography.$main-font-file-bold}");
+ font-weight: typography.$main-font-weight-bold;
+ font-style: normal;
+ font-display: swap;
+ }
+
+ @font-face {
+ font-family: typography.$detail-font-family-name;
+ src: url("#{assets.$tna-font-path}/#{typography.$detail-font-file}");
+ font-weight: typography.$detail-font-weight;
+ font-style: normal;
+ font-display: swap;
+ }
+
+ @font-face {
+ font-family: typography.$detail-font-family-name;
+ src: url("#{assets.$tna-font-path}/#{typography.$detail-font-file-bold}");
+ font-weight: typography.$detail-font-weight-bold;
+ font-style: normal;
+ font-display: swap;
+ }
+} @else {
+ $main-font-family-name: functions.str-replace(
+ typography.$main-font-family-name,
+ " ",
+ "+"
+ );
+ $detail-font-family-name: functions.str-replace(
+ typography.$detail-font-family-name,
+ " ",
+ "+"
+ );
+ @import url("https://fonts.googleapis.com/css2?family=#{$main-font-family-name}:wght@#{typography.$main-font-weight}..#{typography.$main-font-weight-bold}&family=#{$detail-font-family-name}:wght@#{typography.$detail-font-weight}..#{typography.$detail-font-weight-bold}&display=swap"); /* stylelint-disable-line */
+}
diff --git a/src/nationalarchives/utilities/_index.scss b/src/nationalarchives/utilities/_index.scss
index aeea52b4..20c52be2 100644
--- a/src/nationalarchives/utilities/_index.scss
+++ b/src/nationalarchives/utilities/_index.scss
@@ -5,6 +5,7 @@
@use "debug";
@use "forms";
@use "global";
+@use "imports";
@use "lists";
@use "overrides";
@use "reset";
diff --git a/src/nationalarchives/utilities/_lists.scss b/src/nationalarchives/utilities/_lists.scss
index 6f5b067e..3049d07e 100644
--- a/src/nationalarchives/utilities/_lists.scss
+++ b/src/nationalarchives/utilities/_lists.scss
@@ -4,32 +4,45 @@
@use "../tools/typography";
.tna-ul,
-.tna-ol {
- margin: spacing.space(1) 0 0;
- padding: 0 0 0 spacing.space(2);
+.tna-ul ul {
+ list-style-type: disc;
+}
- &:first-child {
+.tna-ul,
+.tna-ol {
+ ul,
+ ol {
margin-top: 0;
}
- li::marker {
- @include colour.colour-font("accent-background");
- font-weight: 700;
+ &,
+ & ul,
+ & ol {
+ margin: spacing.space(1) 0 0;
+ padding: 0 0 0 spacing.space(2);
+
+ &--plain {
+ padding-left: 0;
- .tna-background-accent & {
- @include colour.colour-font("font-dark");
+ &,
+ & ul,
+ & ol {
+ list-style: none;
+ }
}
- }
- &--plain {
- padding-left: 0;
+ &:first-child {
+ margin-top: 0;
+ }
- list-style: none;
- }
+ li::marker {
+ @include colour.colour-font("accent-background");
+ font-weight: 700;
- .tna-ul,
- .tna-ol {
- margin-top: 0;
+ .tna-background-accent & {
+ @include colour.colour-font("font-dark");
+ }
+ }
}
}
diff --git a/src/nationalarchives/utilities/_typography.scss b/src/nationalarchives/utilities/_typography.scss
index bec535bd..b81e5129 100644
--- a/src/nationalarchives/utilities/_typography.scss
+++ b/src/nationalarchives/utilities/_typography.scss
@@ -1,48 +1,11 @@
@use "sass:math";
@use "sass:selector";
-@use "../variables/assets";
@use "../variables/typography" as typographyVars;
@use "../tools/colour";
@use "../tools/media";
@use "../tools/spacing";
@use "../tools/typography";
-@if typographyVars.$use-local-fonts {
- @font-face {
- font-family: "Open Sans";
- src: url("#{assets.$tna-font-path}/OpenSans-Regular.ttf");
- font-weight: typographyVars.$main-font-weight;
- font-style: normal;
- font-display: swap;
- }
-
- @font-face {
- font-family: "Open Sans";
- src: url("#{assets.$tna-font-path}/OpenSans-Bold.ttf");
- font-weight: typographyVars.$main-font-weight-bold;
- font-style: normal;
- font-display: swap;
- }
-
- @font-face {
- font-family: "Roboto Mono";
- src: url("#{assets.$tna-font-path}/RobotoMono-Regular.ttf");
- font-weight: typographyVars.$detail-font-weight;
- font-style: normal;
- font-display: swap;
- }
-
- @font-face {
- font-family: "Roboto Mono";
- src: url("#{assets.$tna-font-path}/RobotoMono-Medium.ttf");
- font-weight: typographyVars.$detail-font-weight-bold;
- font-style: normal;
- font-display: swap;
- }
-} @else {
- @import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300..800&family=Roboto+Mono:wght@100..700&display=swap"); /* stylelint-disable-line */
-}
-
.tna-template {
@include colour.colour-font("font-base");
@include typography.main-font;
@@ -121,6 +84,7 @@ small {
@include colour.colour-font("font-base");
@include typography.detail-font-small;
line-height: 1;
+ text-align: center;
}
%chip-plain {
diff --git a/src/nationalarchives/variables/_typography.scss b/src/nationalarchives/variables/_typography.scss
index bd5c25e3..f261ec8f 100644
--- a/src/nationalarchives/variables/_typography.scss
+++ b/src/nationalarchives/variables/_typography.scss
@@ -1,5 +1,24 @@
+/*
+ * ------------------------------------------
+ * The typefaces, sizes and spacings that are
+ * defined in this file have been selected to
+ * ensure 100% match with the latest National
+ * Archives brand guidelines - avoid changing
+ * or overwriting any of these values without
+ * signing off with the Digital Services team
+ * first
+ * ------------------------------------------
+ */
+
$relative-1rem-px: 16; // 16px = 1rem
+/*
+ * ------------------------------------------
+ * When true, use the included font files for
+ * Open Sans and Roboto Mono, rather than the
+ * versions hosted by Google Fonts
+ * ------------------------------------------
+ */
$use-local-fonts: false !default;
$body-font-size-px: 18 !default;
@@ -8,18 +27,50 @@ $body-line-height: 1.75 !default;
$interactive-text-decoration-thickness: 3.5px !default;
-$main-font: "Open Sans" !default;
-$main-font-family: $main-font, sans-serif !default;
+$main-font-family-name: "Open Sans" !default;
+$main-font-family:
+ #{$main-font-family-name},
+ sans-serif;
$main-font-weight: 400 !default;
$main-font-weight-medium: 600 !default;
$main-font-weight-bold: 700 !default;
+$main-font-file: "OpenSans-Regular.ttf" !default;
+$main-font-file-medium: "OpenSans-SemiBold.ttf" !default;
+$main-font-file-bold: "OpenSans-Bold.ttf" !default;
-$heading-font-family: supria-sans-condensed, "Arial Narrow", sans-serif !default;
+/*
+ * ------------------------------------------
+ * To use Supria Sans Condensed (which is the
+ * approved heading typeface for The National
+ * Archives), you need to obtain a licence to
+ * properly embed the CSS files with the font
+ * definitions in your service - check with a
+ * member of the Digital Services team on how
+ * to get a licence
+ * ------------------------------------------
+ */
+$heading-font-family-name: "supria-sans-condensed" !default;
+$heading-font-family:
+ #{$heading-font-family-name},
+ "Arial Narrow",
+ sans-serif;
$heading-font-weight: 500 !default;
-$detail-font-family: "Roboto Mono", monospace !default;
+/*
+ * ------------------------------------------
+ * The detail font should be a monospace font
+ * and is used for chips, supertitles as well
+ * as the date search component
+ * ------------------------------------------
+ */
+$detail-font-family-name: "Roboto Mono" !default;
+$detail-font-family:
+ #{$detail-font-family-name},
+ monospace;
$detail-font-weight: 400 !default;
$detail-font-weight-bold: 500 !default;
+$detail-font-file: "RobotoMono-Regular.ttf" !default;
+$detail-font-file-bold: "RobotoMono-Medium.ttf" !default;
$heading-xl-font-size-default: 64 !default;
$heading-xl-font-size-medium: 48 !default;