@nationalarchives/frontend 0.1.12-prerelease → 0.1.14-prerelease

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/nationalarchives/_features.scss +0 -3
  3. package/nationalarchives/all.css +1 -1
  4. package/nationalarchives/all.css.map +1 -1
  5. package/nationalarchives/components/_index.scss +2 -0
  6. package/nationalarchives/components/breadcrumbs/_index.scss +30 -26
  7. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -1
  8. package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
  9. package/nationalarchives/components/breadcrumbs/template.njk +1 -1
  10. package/nationalarchives/components/button/button.stories.js +1 -1
  11. package/nationalarchives/components/card/_index.scss +2 -1
  12. package/nationalarchives/components/card/card.stories.js +1 -1
  13. package/nationalarchives/components/footer/_index.scss +4 -6
  14. package/nationalarchives/components/footer/fixtures.json +1 -1
  15. package/nationalarchives/components/footer/template.njk +1 -1
  16. package/nationalarchives/components/header/_index.scss +43 -11
  17. package/nationalarchives/components/header/header.stories.js +88 -43
  18. package/nationalarchives/components/hero/_index.scss +0 -2
  19. package/nationalarchives/components/hero/hero.stories.js +2 -0
  20. package/nationalarchives/components/index-grid/_index.scss +44 -0
  21. package/nationalarchives/components/index-grid/fixtures.json +4 -0
  22. package/nationalarchives/components/index-grid/index-grid.stories.js +78 -0
  23. package/nationalarchives/components/index-grid/macro-options.json +94 -0
  24. package/nationalarchives/components/index-grid/macro.njk +3 -0
  25. package/nationalarchives/components/index-grid/template.njk +56 -0
  26. package/nationalarchives/components/message/_index.scss +29 -0
  27. package/nationalarchives/components/message/fixtures.json +4 -0
  28. package/nationalarchives/components/message/macro-options.json +20 -0
  29. package/nationalarchives/components/message/macro.njk +3 -0
  30. package/nationalarchives/components/message/phase-banner.stories.js +36 -0
  31. package/nationalarchives/components/message/template.njk +9 -0
  32. package/nationalarchives/components/phase-banner/phase-banner.stories.js +1 -1
  33. package/nationalarchives/components/phase-banner/template.njk +1 -1
  34. package/nationalarchives/components/picture/_index.scss +4 -18
  35. package/nationalarchives/components/picture/picture.stories.js +1 -1
  36. package/nationalarchives/components/profile/profile.stories.js +1 -1
  37. package/nationalarchives/components/profile/template.njk +1 -1
  38. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +2 -0
  39. package/nationalarchives/components/tabs/tabs.stories.js +4 -2
  40. package/nationalarchives/stories/development/publishing.mdx +1 -12
  41. package/nationalarchives/stories/utilities/colour.stories.js +39 -1
  42. package/nationalarchives/stories/utilities/heading-groups.stories.js +1 -0
  43. package/nationalarchives/stories/utilities/headings.stories.js +8 -22
  44. package/nationalarchives/stories/utilities/typography.mdx +1 -3
  45. package/nationalarchives/templates/layouts/_generic.njk +42 -50
  46. package/nationalarchives/tools/_colour.scss +39 -61
  47. package/nationalarchives/utilities/_global.scss +11 -20
  48. package/nationalarchives/utilities/_typography.scss +2 -2
  49. package/nationalarchives/variables/_colour.scss +24 -4
  50. package/nationalarchives/variables/_typography.scss +4 -2
  51. package/package.json +3 -3
@@ -0,0 +1,36 @@
1
+ import Message from "./template.njk";
2
+ import macroOptions from "./macro-options.json";
3
+
4
+ const argTypes = {
5
+ message: { control: "text" },
6
+ classes: { control: "text" },
7
+ attributes: { control: "object" },
8
+ };
9
+
10
+ Object.keys(argTypes).forEach((argType) => {
11
+ argTypes[argType].description = macroOptions.find(
12
+ (option) => option.name === argType,
13
+ )?.description;
14
+ });
15
+
16
+ export default {
17
+ title: "Components/Message",
18
+ argTypes,
19
+ };
20
+
21
+ const Template = ({ message, classes, attributes }) => {
22
+ return Message({
23
+ params: {
24
+ message,
25
+ classes,
26
+ attributes,
27
+ },
28
+ });
29
+ };
30
+
31
+ export const Standard = Template.bind({});
32
+ Standard.args = {
33
+ message:
34
+ "Please note this page references hunger strikes and force feeding, which some people may find upsetting.",
35
+ classes: "tna-messaage--demo",
36
+ };
@@ -0,0 +1,9 @@
1
+ {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
+ <div class="tna-message {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
+ <svg class="tna-message__icon" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 34 34" width="40" height="40">
4
+ <path fill="currentColor" d="M15.33 8.67h3.34V12h-3.34V8.67Zm0 6.66h3.34v10h-3.34v-10ZM17 .33a16.67 16.67 0 1 0 .01 33.35A16.67 16.67 0 0 0 17 .33Zm0 30A13.35 13.35 0 0 1 3.67 17C3.67 9.65 9.65 3.67 17 3.67S30.33 9.65 30.33 17 24.35 30.33 17 30.33Z"></path>
5
+ </svg>
6
+ <p class="tna-message__message">
7
+ {{ params.message | safe }}
8
+ </p>
9
+ </div>
@@ -18,7 +18,7 @@ Object.keys(argTypes).forEach((argType) => {
18
18
  });
19
19
 
20
20
  export default {
21
- title: "Work in progress/Components/Phase banner",
21
+ title: "Components/Phase banner",
22
22
  argTypes,
23
23
  };
24
24
 
@@ -4,7 +4,7 @@
4
4
  <div class="tna-container">
5
5
  <div class="tna-column">
6
6
  <span class="tna-phase-banner__phase">
7
- {{ params.phase | capitalize }}
7
+ {{ params.phase | lower | capitalize }}
8
8
  </span>
9
9
  </div>
10
10
  <div class="tna-column">
@@ -1,4 +1,3 @@
1
- @use "../../utilities/global"; // To get %tna-invert
2
1
  @use "../../tools/colour";
3
2
 
4
3
  .tna-picture {
@@ -25,29 +24,16 @@
25
24
  }
26
25
 
27
26
  &__transcript {
28
- // @include colour.invert;
29
- @extend %tna-invert;
27
+ @include colour.invert;
30
28
 
31
- padding: 1rem 1.5rem 0.5rem;
29
+ padding: 1rem 1.5rem;
32
30
 
33
31
  .tna-template--clicked &:focus {
34
32
  outline: none;
35
33
  }
36
34
 
37
- .tna-tabs__list-item-link {
38
- @include colour.colour-font("font-dark", true);
39
-
40
- &::after {
41
- @include colour.colour-background("keyline-dark", true);
42
- }
43
-
44
- .tna-template--js-enabled & {
45
- @include colour.colour-font("font-light", true);
46
-
47
- &--selected {
48
- @include colour.colour-font("font-dark", true);
49
- }
50
- }
35
+ .tna-tabs {
36
+ margin-bottom: 0.5rem;
51
37
  }
52
38
  }
53
39
 
@@ -20,7 +20,7 @@ Object.keys(argTypes).forEach((argType) => {
20
20
  });
21
21
 
22
22
  export default {
23
- title: "Work in progress/Components/Picture",
23
+ title: "Components/Picture",
24
24
  argTypes,
25
25
  };
26
26
 
@@ -13,7 +13,7 @@ Object.keys(argTypes).forEach((argType) => {
13
13
  });
14
14
 
15
15
  export default {
16
- title: "Work in progress/Components/Profile",
16
+ title: "Components/Profile",
17
17
  argTypes,
18
18
  };
19
19
 
@@ -1,7 +1,7 @@
1
1
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
2
  <div class="tna-profile tna-container {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
3
  <div class="tna-column tna-column--order-2">
4
- <img src="https://avatar.iran.liara.run/public/68" width="200" height="200" />
4
+ <img src="https://avatar.iran.liara.run/public/68" width="200" height="200" alt="Photo of Max Smith" />
5
5
  </div>
6
6
  <div class="tna-column tna-column--flex-1 tna-column--full-small tna-column--full-tiny tna-column--order-1 tna-column--order-3-small tna-column--order-3-tiny">
7
7
  <hgroup class="tna-hgroup tna-hgroup--xl">
@@ -68,6 +68,8 @@ Test.args = {
68
68
  };
69
69
 
70
70
  Test.play = async ({ args, canvasElement }) => {
71
+ await new Promise((r) => setTimeout(r, 100));
72
+
71
73
  const canvas = within(canvasElement);
72
74
 
73
75
  const image = canvas.getByAltText(args.image.alt);
@@ -5,7 +5,7 @@ import { within, userEvent } from "@storybook/testing-library";
5
5
 
6
6
  const argTypes = {
7
7
  title: { control: "text" },
8
- items: { control: "array" },
8
+ items: { control: "object" },
9
9
  sticky: { control: "boolean" },
10
10
  classes: { control: "text" },
11
11
  attributes: { control: "object" },
@@ -18,7 +18,7 @@ Object.keys(argTypes).forEach((argType) => {
18
18
  });
19
19
 
20
20
  export default {
21
- title: "Work in progress/Components/Tabs",
21
+ title: "Components/Tabs",
22
22
  argTypes,
23
23
  };
24
24
 
@@ -81,6 +81,8 @@ Test.args = {
81
81
  };
82
82
 
83
83
  Test.play = async ({ args, canvasElement, step }) => {
84
+ await new Promise((r) => setTimeout(r, 100));
85
+
84
86
  const canvas = within(canvasElement);
85
87
 
86
88
  const tablist = canvas.getByRole("tablist");
@@ -10,17 +10,6 @@ import { Meta } from "@storybook/blocks";
10
10
  1. Run `npm install` to update the `package-lock.json`
11
11
  1. Merge all changes to `main` via a pull request
12
12
  1. Wait for the CI to pass
13
- 1. Tag the version with `git tag v1.0.0` (ensure leading `v` and change version number as necessary)
14
- 1. Push the new tag with `git push origin --tags`
15
- 1. Create a [new release on GitHub](https://github.com/nationalarchives/tna-frontend/releases/new) using the tag you just created
13
+ 1. Create a [new release on GitHub](https://github.com/nationalarchives/tna-frontend/releases/new) and add a new tag in the format `v1.0.0` (ensure leading `v` and change version number as necessary)
16
14
 
17
15
  Once a release is created, the [publish pipeline](https://github.com/nationalarchives/tna-frontend/blob/main/.github/workflows/npm-publish.yml) will be triggered.
18
-
19
- ## Oops!
20
-
21
- To delete a tag:
22
-
23
- ```sh
24
- git tag -d v0.1.0
25
- git push --delete origin v0.1.0
26
- ```
@@ -2,6 +2,8 @@ import Header from "../../components/header/template.njk";
2
2
  import Breadcrumbs from "../../components/breadcrumbs/template.njk";
3
3
  import Card from "../../components/card/template.njk";
4
4
  import Hero from "../../components/hero/template.njk";
5
+ import IndexGrid from "../../components/index-grid/template.njk";
6
+ import Message from "../../components/message/template.njk";
5
7
  import Picture from "../../components/picture/template.njk";
6
8
  import Tabs from "../../components/tabs/template.njk";
7
9
  import Footer from "../../components/footer/template.njk";
@@ -119,6 +121,12 @@ const Template = ({ theme }) => {
119
121
  <a href="#" class="tna-button">Primary button</a>
120
122
  <a href="#" class="tna-button tna-button--secondary">Secondary button</a>
121
123
  <hr>
124
+ ${Message({
125
+ params: {
126
+ message:
127
+ "Please note this page references hunger strikes and force feeding, which some people may find upsetting.",
128
+ },
129
+ })}
122
130
  ${Card({
123
131
  params: {
124
132
  heading: {
@@ -174,6 +182,36 @@ const Template = ({ theme }) => {
174
182
  classes: "tna-picture--demo",
175
183
  },
176
184
  })}
185
+ ${IndexGrid({
186
+ params: {
187
+ heading: "My dogs",
188
+ items: Array(12)
189
+ .fill({
190
+ ...{
191
+ href: "#",
192
+ src: "https://picsum.photos/id/237/800/600",
193
+ alt: "Photo of a puppy",
194
+ width: "800",
195
+ height: "600",
196
+ title: "Cat",
197
+ subtitle: "4 photos",
198
+ },
199
+ })
200
+ .map((item, index) => {
201
+ const pseudoRandom = ((index * 29) % 8) + 1;
202
+ return {
203
+ ...item,
204
+ href: `#/category-${index}`,
205
+ title: `Category #${index + 101}`,
206
+ subtitle: `${pseudoRandom} photos`,
207
+ };
208
+ }),
209
+ columns: 4,
210
+ columnsMedium: 3,
211
+ columnsSmall: 2,
212
+ columnsTiny: 1,
213
+ },
214
+ })}
177
215
  </div>
178
216
  </div>
179
217
  <article>
@@ -185,5 +223,5 @@ const Template = ({ theme }) => {
185
223
  export const Examples = Template.bind({});
186
224
  // Examples.parameters = { options: { showPanel: false } };
187
225
  Examples.args = {
188
- theme: "system",
226
+ theme: "light",
189
227
  };
@@ -41,4 +41,5 @@ export const HeadingGroupSeparated = Template.bind({});
41
41
  HeadingGroupSeparated.args = {
42
42
  supertitle: "Record revealed",
43
43
  title: "The Monteagle Letter",
44
+ singleSentence: false,
44
45
  };
@@ -11,30 +11,16 @@ export default {
11
11
  const HeadingTemplate = ({ params }, level) => `<h${level} class="tna-heading${
12
12
  params.size ? ` tna-heading--${params.size}` : ""
13
13
  }">
14
- ${params.text} (level ${level})
14
+ ${params.text} (${params.size.toUpperCase()})
15
15
  </h${level}>`;
16
16
 
17
- const Heading1Template = ({ text, size }) =>
18
- HeadingTemplate({ params: { text, size } }, 1);
19
- const Heading2Template = ({ text, size }) =>
20
- HeadingTemplate({ params: { text, size } }, 2);
21
- const Heading3Template = ({ text, size }) =>
22
- HeadingTemplate({ params: { text, size } }, 3);
17
+ const HeadingsTemplate = ({ text }) =>
18
+ `${HeadingTemplate({ params: { text, size: "xl" } }, 1)}${HeadingTemplate(
19
+ { params: { text, size: "l" } },
20
+ 2,
21
+ )}${HeadingTemplate({ params: { text, size: "m" } }, 3)}`;
23
22
 
24
- export const Heading1 = Heading1Template.bind({});
25
- Heading1.args = {
23
+ export const Headings = HeadingsTemplate.bind({});
24
+ Headings.args = {
26
25
  text: "This is a heading",
27
- size: "xl",
28
- };
29
-
30
- export const Heading2 = Heading2Template.bind({});
31
- Heading2.args = {
32
- text: "This is a heading",
33
- size: "l",
34
- };
35
-
36
- export const Heading3 = Heading3Template.bind({});
37
- Heading3.args = {
38
- text: "This is a heading",
39
- size: "m",
40
26
  };
@@ -12,9 +12,7 @@ We use a set of typefaces...
12
12
 
13
13
  ## Headings
14
14
 
15
- <Canvas of={HeadingStories.Heading1} />
16
- <Canvas of={HeadingStories.Heading2} />
17
- <Canvas of={HeadingStories.Heading3} />
15
+ <Canvas of={HeadingStories.Headings} />
18
16
 
19
17
  ## Heading groups
20
18
 
@@ -1,57 +1,49 @@
1
1
  {# Based on https://github.com/alphagov/govuk-frontend/blob/8b6bf304b9fc891f64459c25a08f3d623f3fea72/packages/govuk-frontend/src/govuk/template.njk #}
2
2
  {#% from "./components/skip-link/macro.njk" import tnaSkipLink -%#}
3
3
  <!DOCTYPE html>
4
- <html lang="{{ htmlLang | default('en') }}" class="tna-template {{ htmlClasses }}">
4
+ <html lang="{{ htmlLang | default('en-GB') }}" class="tna-template {{ htmlClasses }}">
5
5
  <head>
6
- <meta charset="utf-8">
7
- <title{% if pageTitleLang %} lang="{{ pageTitleLang }}"{% endif %}>{% block pageTitle %}The National Archives{% endblock %}</title>
8
- <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
9
- <meta name="theme-color" content="{{ themeColor | default('#000000') }}">
10
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
11
-
12
- {% block headIcons %}
13
- <link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ assetPath | default('/assets') }}/images/favicon.ico" type="image/x-icon">
14
- <link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/govuk-mask-icon.svg" color="{{ themeColor | default('#0b0c0c') }}"> {# Hardcoded value of $govuk-black #}
15
- <link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-180x180.png">
16
- <link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-167x167.png">
17
- <link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-152x152.png">
18
- <link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon.png">
19
- {% endblock %}
20
-
21
- {% block head %}{% endblock %}
22
-
23
- {% block stylesheets %}{% endblock %}
24
-
25
- {# OpenGraph images needs to be absolute, so we need either a URL for the image or for assetUrl to be set #}
26
- {% if opengraphImageUrl or assetUrl %}
27
- <meta property="og:image" content="{{ opengraphImageUrl | default(assetUrl + '/images/govuk-opengraph-image.png') }}">
28
- {% endif %}
6
+ <meta charset="utf-8">
7
+ <title>{% block pageTitle %}The National Archives{% endblock %}</title>
8
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
9
+ <meta name="theme-color" content="{{ themeColor | default('#000000') }}">
10
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
11
+
12
+ {% block headIcons %}
13
+ <link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ assetPath | default('/assets') }}/images/favicon.ico" type="image/x-icon">
14
+ <link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/govuk-mask-icon.svg" color="{{ themeColor | default('#0b0c0c') }}"> {# Hardcoded value of $govuk-black #}
15
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-180x180.png">
16
+ <link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-167x167.png">
17
+ <link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-152x152.png">
18
+ <link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon.png">
19
+ {% endblock %}
20
+
21
+ {% block head %}{% endblock %}
22
+
23
+ {% block stylesheets %}{% endblock %}
29
24
  </head>
30
- <body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
31
- {% block bodyStart %}{% endblock %}
32
-
33
- {% block skipLink %}
34
- {#{ govukSkipLink({
35
- href: '#main-content',
36
- text: 'Skip to main content'
37
- }) }#}
38
- {% endblock %}
39
-
40
- {% block header %}
41
- <h1>HEADER</h1>
42
- {% endblock %}
43
-
44
- {% block main %}
45
- {% block beforeContent %}{% endblock %}
46
- <main class="tna-main-wrapper {{ mainClasses }}" id="main-content" role="main"{% if mainLang %} lang="{{ mainLang }}"{% endif %}>
47
- {% block content %}{% endblock %}
48
- </main>
49
- {% endblock %}
50
-
51
- {% block footer %}
52
- <h1>FOOTER</h1>
53
- {% endblock %}
54
-
55
- {% block bodyEnd %}{% endblock %}
25
+ <body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
26
+ {% block skipLink %}
27
+ {#{ govukSkipLink({
28
+ href: '#main-content',
29
+ text: 'Skip to main content'
30
+ }) }#}
31
+ {% endblock %}
32
+
33
+ {% block bodyStart %}{% endblock %}
34
+
35
+ {% block header %}{% endblock %}
36
+
37
+ {% block main %}
38
+ {% block beforeContent %}{% endblock %}
39
+ <main class="tna-main-wrapper {{ mainClasses }}" id="main-content" role="main">
40
+ {% block content %}{% endblock %}
41
+ </main>
42
+ {% block afterContent %}{% endblock %}
43
+ {% endblock %}
44
+
45
+ {% block footer %}{% endblock %}
46
+
47
+ {% block bodyEnd %}{% endblock %}
56
48
  </body>
57
49
  </html>
@@ -26,59 +26,29 @@
26
26
  }
27
27
  }
28
28
 
29
- @mixin colour-font($colour, $inverted: false) {
30
- @if $inverted {
31
- color: map.get(colour.$colour-palette-dark, $colour);
32
- } @else {
33
- color: map.get(colour.$colour-palette-default, $colour);
34
- }
35
- @if features.$support-colour-schemes {
36
- color: var(--#{$colour});
37
- }
29
+ @mixin colour-font($colour) {
30
+ color: map.get(colour.$colour-palette-default, $colour);
31
+ color: var(--#{$colour});
38
32
  }
39
33
 
40
- @mixin colour-background($colour, $inverted: false) {
41
- @if $inverted {
42
- background-color: map.get(colour.$colour-palette-dark, $colour);
43
- } @else {
44
- background-color: map.get(colour.$colour-palette-default, $colour);
45
- }
46
- @if features.$support-colour-schemes {
47
- background-color: var(--#{$colour});
48
- }
34
+ @mixin colour-background($colour) {
35
+ background-color: map.get(colour.$colour-palette-default, $colour);
36
+ background-color: var(--#{$colour});
49
37
  }
50
38
 
51
- @mixin colour-border($colour, $inverted: false) {
52
- @if $inverted {
53
- border-color: map.get(colour.$colour-palette-dark, $colour);
54
- } @else {
55
- border-color: map.get(colour.$colour-palette-default, $colour);
56
- }
57
- @if features.$support-colour-schemes {
58
- border-color: var(--#{$colour});
59
- }
39
+ @mixin colour-border($colour) {
40
+ border-color: map.get(colour.$colour-palette-default, $colour);
41
+ border-color: var(--#{$colour});
60
42
  }
61
43
 
62
- @mixin colour-outline($colour, $inverted: false) {
63
- @if $inverted {
64
- outline-color: map.get(colour.$colour-palette-dark, $colour);
65
- } @else {
66
- outline-color: map.get(colour.$colour-palette-default, $colour);
67
- }
68
- @if features.$support-colour-schemes {
69
- outline-color: var(--#{$colour});
70
- }
44
+ @mixin colour-outline($colour) {
45
+ outline-color: map.get(colour.$colour-palette-default, $colour);
46
+ outline-color: var(--#{$colour});
71
47
  }
72
48
 
73
- @mixin colour-fill($colour, $inverted: false) {
74
- @if $inverted {
75
- fill: map.get(colour.$colour-palette-dark, $colour);
76
- } @else {
77
- fill: map.get(colour.$colour-palette-default, $colour);
78
- }
79
- @if features.$support-colour-schemes {
80
- fill: var(--#{$colour});
81
- }
49
+ @mixin colour-fill($colour) {
50
+ fill: map.get(colour.$colour-palette-default, $colour);
51
+ fill: var(--#{$colour});
82
52
  }
83
53
 
84
54
  @mixin fixed {
@@ -88,42 +58,50 @@
88
58
  }
89
59
 
90
60
  @mixin invert {
61
+ --font-base: var(--contrast-font-base);
62
+ --font-dark: var(--contrast-font-dark);
63
+ --font-light: var(--contrast-font-light);
64
+ --link: var(--contrast-link);
65
+ --link-visited: var(--contrast-link-visited);
66
+ --keyline: var(--contrast-keyline);
67
+ --keyline-dark: var(--contrast-keyline-dark);
68
+
69
+ @include colour-font("contrast-font-base");
70
+ @include colour-background("contrast-background");
71
+ }
72
+
73
+ @mixin uninvert {
74
+ @include colour-css-vars;
75
+
91
76
  .tna-template--system-theme & {
92
- @include colour-css-vars-dark;
77
+ @include colour-css-vars;
93
78
 
94
79
  @media (prefers-color-scheme: dark) {
95
- @include colour-css-vars;
80
+ @include colour-css-vars-dark;
96
81
  }
97
82
 
98
83
  @media (prefers-contrast: more) {
99
- @include colour-css-vars-high-contrast-dark;
84
+ @include colour-css-vars-high-contrast;
100
85
  }
101
86
 
102
87
  @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
103
- @include colour-css-vars-high-contrast;
88
+ @include colour-css-vars-high-contrast-dark;
104
89
  }
105
90
  }
106
91
 
107
92
  .tna-template--light-theme & {
108
- @include colour-css-vars-dark;
93
+ @include colour-css-vars;
109
94
  }
110
95
 
111
96
  .tna-template--dark-theme & {
112
- @include colour-css-vars;
97
+ @include colour-css-vars-dark;
113
98
  }
114
99
 
115
100
  .tna-template--high-contrast-theme & {
116
- @include colour-css-vars-high-contrast-dark;
117
- }
118
-
119
- .tna-template--dark-theme.tna-template--high-contrast-theme & {
120
101
  @include colour-css-vars-high-contrast;
121
102
  }
122
103
 
123
- @include colour-font("font-base", true);
124
- @include colour-background("page-background", true);
125
- }
126
-
127
- %tna-invert {
128
- @include invert;
104
+ .tna-template--high-contrast-theme.tna-template--dark-theme & {
105
+ @include colour-css-vars-high-contrast-dark;
106
+ }
129
107
  }
@@ -4,22 +4,6 @@
4
4
 
5
5
  :root {
6
6
  @include colour.colour-css-vars;
7
-
8
- @media (prefers-color-scheme: dark) {
9
- @include colour.colour-css-vars-dark;
10
- }
11
-
12
- @media (prefers-contrast: more) {
13
- @include colour.colour-css-vars-high-contrast;
14
-
15
- * {
16
- background-image: none !important;
17
- }
18
- }
19
-
20
- @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
21
- @include colour.colour-css-vars-high-contrast-dark;
22
- }
23
7
  }
24
8
 
25
9
  .tna-template {
@@ -59,7 +43,7 @@
59
43
  // accent-color: colour.$_tna-blue;
60
44
  // }
61
45
 
62
- /* &--system-theme {
46
+ &--system-theme {
63
47
  @include colour.colour-css-vars;
64
48
 
65
49
  @media (prefers-color-scheme: dark) {
@@ -77,7 +61,7 @@
77
61
  @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
78
62
  @include colour.colour-css-vars-high-contrast-dark;
79
63
  }
80
- } */
64
+ }
81
65
 
82
66
  &--light-theme {
83
67
  @include colour.colour-css-vars;
@@ -112,9 +96,16 @@
112
96
  margin: 0;
113
97
  padding: 0;
114
98
 
115
- // @include colour.colour-background("page-background");
116
-
117
99
  overflow: auto;
100
+
101
+ &:has(.tna-header):has(#main[role="main"]):has(.tna-footer) {
102
+ display: flex;
103
+ flex-direction: column;
104
+
105
+ #main[role="main"] {
106
+ flex: 1;
107
+ }
108
+ }
118
109
  }
119
110
 
120
111
  img,
@@ -3,7 +3,7 @@
3
3
  @use "../tools/typography";
4
4
 
5
5
  // Temporary - will eventually bundle font files into package
6
- @import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";
6
+ @import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap";
7
7
  @import "https://use.typekit.net/hkj3kuz.css";
8
8
 
9
9
  .tna-template {
@@ -74,7 +74,7 @@ a {
74
74
  }
75
75
 
76
76
  .tna-heading {
77
- margin-bottom: 1.5rem;
77
+ margin-bottom: 1rem;
78
78
 
79
79
  @include colour.colour-font("font-dark");
80
80
  @include typography.heading-font;