@nationalarchives/frontend 0.1.13-prerelease → 0.1.15-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 (65) hide show
  1. package/nationalarchives/_features.scss +0 -3
  2. package/nationalarchives/all.css +1 -1
  3. package/nationalarchives/all.css.map +1 -1
  4. package/nationalarchives/all.js +1 -1
  5. package/nationalarchives/all.js.map +1 -1
  6. package/nationalarchives/all.mjs +7 -7
  7. package/nationalarchives/all.scss +2 -5
  8. package/nationalarchives/components/breadcrumbs/_index.scss +62 -19
  9. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +2 -0
  10. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -0
  11. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +63 -0
  12. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +28 -0
  13. package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
  14. package/nationalarchives/components/breadcrumbs/template.njk +3 -3
  15. package/nationalarchives/components/button/fixtures.json +5 -5
  16. package/nationalarchives/components/button/template.njk +1 -1
  17. package/nationalarchives/components/card/_index.scss +72 -29
  18. package/nationalarchives/components/card/card.stories.js +6 -1
  19. package/nationalarchives/components/card/fixtures.json +2 -2
  20. package/nationalarchives/components/card/macro-options.json +6 -6
  21. package/nationalarchives/components/card/template.njk +5 -5
  22. package/nationalarchives/components/filters/filters.stories.js +1 -1
  23. package/nationalarchives/components/footer/_index.scss +7 -4
  24. package/nationalarchives/components/footer/template.njk +1 -1
  25. package/nationalarchives/components/header/_index.scss +17 -11
  26. package/nationalarchives/components/header/header.stories.js +73 -28
  27. package/nationalarchives/components/header/template.njk +1 -1
  28. package/nationalarchives/components/hero/_index.scss +4 -15
  29. package/nationalarchives/components/hero/hero.stories.js +2 -0
  30. package/nationalarchives/components/index-grid/_index.scss +20 -5
  31. package/nationalarchives/components/index-grid/index-grid.stories.js +6 -2
  32. package/nationalarchives/components/index-grid/macro-options.json +22 -2
  33. package/nationalarchives/components/index-grid/template.njk +12 -6
  34. package/nationalarchives/components/message/_index.scss +3 -1
  35. package/nationalarchives/components/picture/_index.scss +13 -32
  36. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -1
  37. package/nationalarchives/components/tabs/_index.scss +6 -12
  38. package/nationalarchives/components/tabs/tabs.stories.js +3 -1
  39. package/nationalarchives/patterns/featured-collection/_index.scss +1 -1
  40. package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +1 -1
  41. package/nationalarchives/patterns/featured-collection/template.njk +2 -2
  42. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +85 -0
  43. package/nationalarchives/stories/utilities/{colour.stories.js → colour-schemes/colour-schemes.stories.js} +129 -18
  44. package/nationalarchives/stories/utilities/overrides/overrides.mdx +66 -0
  45. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +36 -0
  46. package/nationalarchives/stories/utilities/{headings.stories.js → typography/headings.stories.js} +2 -1
  47. package/nationalarchives/stories/utilities/typography/typography.stories.js +34 -0
  48. package/nationalarchives/tools/_colour.scss +51 -53
  49. package/nationalarchives/tools/_typography.scss +13 -1
  50. package/nationalarchives/utilities/_global.scss +10 -22
  51. package/nationalarchives/utilities/_index.scss +1 -0
  52. package/nationalarchives/utilities/_overrides.scss +17 -0
  53. package/nationalarchives/utilities/_typography.scss +36 -27
  54. package/nationalarchives/variables/_colour.scss +50 -27
  55. package/nationalarchives/variables/_index.scss +1 -0
  56. package/nationalarchives/variables/_spacing.scss +7 -0
  57. package/nationalarchives/variables/_typography.scss +2 -1
  58. package/package.json +1 -1
  59. package/nationalarchives/components/card/card.js +0 -2
  60. package/nationalarchives/components/card/card.js.map +0 -1
  61. package/nationalarchives/components/card/card.mjs +0 -45
  62. package/nationalarchives/stories/utilities/typography.stories.js +0 -29
  63. /package/nationalarchives/stories/utilities/{heading-groups.stories.js → typography/heading-groups.stories.js} +0 -0
  64. /package/nationalarchives/stories/utilities/{lists.stories.js → typography/lists.stories.js} +0 -0
  65. /package/nationalarchives/stories/utilities/{typography.mdx → typography/typography.mdx} +0 -0
@@ -0,0 +1,85 @@
1
+ import { Meta, Canvas } from "@storybook/blocks";
2
+ import * as ColourStories from './colour-schemes.stories';
3
+
4
+ <Meta of={ColourStories} />
5
+
6
+ # Colour schemes
7
+
8
+ ## System theme
9
+
10
+ The system theme follows the operating system preference for `prefers-color-scheme` which can either be `light` or `dark`.
11
+
12
+ The system theme also follows the preference for `prefers-contrast` which can be `no-preference`, `more`, `less` or `custom`.
13
+
14
+ At this time, only `prefers-contrast: no-preference` and `prefers-contrast: more` are supported.
15
+
16
+ - [MDN Web Docs - prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
17
+ - [MDN Web Docs - prefers-contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast)
18
+
19
+ ```html
20
+ <html class="tna-template tna-template--system-theme">
21
+ <head>
22
+ <title>System theme</title>
23
+ </head>
24
+ <body class="tna-template__body">
25
+ </body>
26
+ </html>
27
+ ```
28
+
29
+ ## Light theme
30
+
31
+ ```html
32
+ <html class="tna-template tna-template--light-theme">
33
+ <head>
34
+ <title>Light theme</title>
35
+ </head>
36
+ <body class="tna-template__body">
37
+ </body>
38
+ </html>
39
+ ```
40
+
41
+ ## Dark theme
42
+
43
+ ```html
44
+ <html class="tna-template tna-template--dark-theme">
45
+ <head>
46
+ <title>Dark theme</title>
47
+ </head>
48
+ <body class="tna-template__body">
49
+ </body>
50
+ </html>
51
+ ```
52
+
53
+ ## High contrast themes
54
+
55
+ The high contrast themes are applied on top of the existing light and dark themes with an extra `tna-template--high-contrast-theme` class on the `tna-template` element.
56
+
57
+ ### Light, high contrast theme
58
+
59
+ ```html
60
+ <html class="tna-template tna-template--light-theme tna-template--high-contrast-theme">
61
+ <head>
62
+ <title>Light, high contrast theme</title>
63
+ </head>
64
+ <body class="tna-template__body">
65
+ </body>
66
+ </html>
67
+ ```
68
+
69
+ ### Dark, high contrast theme
70
+
71
+ ```html
72
+ <html class="tna-template tna-template--dark-theme tna-template--high-contrast-theme">
73
+ <head>
74
+ <title>Dark, high contrast theme</title>
75
+ </head>
76
+ <body class="tna-template__body">
77
+ </body>
78
+ </html>
79
+ ```
80
+
81
+ ## Colour definitions
82
+
83
+ The colours are defined in `src/nationalarchives/variables/_colour.scss` as a separate map for each theme.
84
+
85
+ This allows you to reference a colour, such as `font-base` without having to worry about which theme is currently in use.
@@ -1,11 +1,12 @@
1
- import Header from "../../components/header/template.njk";
2
- import Breadcrumbs from "../../components/breadcrumbs/template.njk";
3
- import Card from "../../components/card/template.njk";
4
- import Hero from "../../components/hero/template.njk";
5
- import Picture from "../../components/picture/template.njk";
6
- import Tabs from "../../components/tabs/template.njk";
7
- import Footer from "../../components/footer/template.njk";
8
- import { supportDynamicColourSchemes } from "../../../../.storybook/preview";
1
+ import Header from "../../../components/header/template.njk";
2
+ import Breadcrumbs from "../../../components/breadcrumbs/template.njk";
3
+ import Card from "../../../components/card/template.njk";
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";
7
+ import Picture from "../../../components/picture/template.njk";
8
+ import Tabs from "../../../components/tabs/template.njk";
9
+ import Footer from "../../../components/footer/template.njk";
9
10
 
10
11
  const argTypes = {
11
12
  theme: {
@@ -21,15 +22,11 @@ const argTypes = {
21
22
  };
22
23
 
23
24
  export default {
24
- title: "Experimental/Utilities/Colour themes",
25
+ title: "Utilities/Colour schemes",
25
26
  argTypes,
26
27
  };
27
28
 
28
29
  const Template = ({ theme }) => {
29
- if (supportDynamicColourSchemes) {
30
- // document.documentElement.classList.remove("tna-template--light-theme");
31
- // document.documentElement.classList.add("tna-template--system-theme");
32
- }
33
30
  return `<div class="tna-template ${
34
31
  theme === "system"
35
32
  ? "tna-template--system-theme"
@@ -109,7 +106,6 @@ const Template = ({ theme }) => {
109
106
  <p class="tna-hgroup__supertitle">TNA colour theme</p>
110
107
  <h2 class="tna-hgroup__title">Heading</h2>
111
108
  </hgroup>
112
- <hr>
113
109
  <p class="tna-p">Lorem ipsum <a href="#">link</a></p>
114
110
  <ul class="tna-ul">
115
111
  <li>Alpha</li>
@@ -118,7 +114,33 @@ const Template = ({ theme }) => {
118
114
  </ul>
119
115
  <a href="#" class="tna-button">Primary button</a>
120
116
  <a href="#" class="tna-button tna-button--secondary">Secondary button</a>
121
- <hr>
117
+ </div>
118
+ </div>
119
+ <hr>
120
+ <div class="tna-container">
121
+ <div class="tna-column tna-column--full">
122
+ <p class="tna-!--no-margin-bottom">Lorem ipsum</p>
123
+ <p class="tna-!--no-margin-bottom tna-!__padding-top--xs">Lorem ipsum</p>
124
+ <p class="tna-!--no-margin-bottom tna-!__padding-top--s">Lorem ipsum</p>
125
+ <p class="tna-!--no-margin-bottom tna-!__padding-top--m">Lorem ipsum</p>
126
+ <p class="tna-!--no-margin-bottom tna-!__padding-top--l">Lorem ipsum</p>
127
+ <p class="tna-!--no-margin-bottom tna-!__padding-top--xl">Lorem ipsum</p>
128
+ </div>
129
+ </div>
130
+ <hr>
131
+ <div class="tna-container">
132
+ <div class="tna-column tna-column--full">
133
+ ${Message({
134
+ params: {
135
+ message:
136
+ "Please note this page references hunger strikes and force feeding, which some people may find upsetting.",
137
+ },
138
+ })}
139
+ </div>
140
+ </div>
141
+ <hr>
142
+ <div class="tna-container">
143
+ <div class="tna-column tna-column--full">
122
144
  ${Card({
123
145
  params: {
124
146
  heading: {
@@ -135,10 +157,43 @@ const Template = ({ theme }) => {
135
157
  width: 1996,
136
158
  height: 1331,
137
159
  },
160
+ label: "New",
161
+ body: "<p>Card body</p>",
162
+ classes: "tna-card--demo",
163
+ },
164
+ })}
165
+ </div>
166
+ </div>
167
+ <hr>
168
+ <div class="tna-container">
169
+ <div class="tna-column tna-column--full">
170
+ ${Card({
171
+ params: {
172
+ heading: {
173
+ supertitle: "Card supertitle",
174
+ title: "Card title",
175
+ level: 3,
176
+ size: "l",
177
+ singleSentence: false,
178
+ },
179
+ href: "#",
180
+ image: {
181
+ src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
182
+ alt: "The National Archives office",
183
+ width: 1996,
184
+ height: 1331,
185
+ },
186
+ label: "New",
138
187
  body: "<p>Card body</p>",
188
+ featured: true,
139
189
  classes: "tna-card--demo",
140
190
  },
141
191
  })}
192
+ </div>
193
+ </div>
194
+ <hr>
195
+ <div class="tna-container">
196
+ <div class="tna-column tna-column--full">
142
197
  ${Tabs({
143
198
  params: {
144
199
  title: "Example tabs",
@@ -162,6 +217,11 @@ const Template = ({ theme }) => {
162
217
  classes: "tna-tabs--demo",
163
218
  },
164
219
  })}
220
+ </div>
221
+ </div>
222
+ <hr>
223
+ <div class="tna-container">
224
+ <div class="tna-column tna-column--full">
165
225
  ${Picture({
166
226
  params: {
167
227
  src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
@@ -176,14 +236,65 @@ const Template = ({ theme }) => {
176
236
  })}
177
237
  </div>
178
238
  </div>
239
+ <hr>
240
+ ${IndexGrid({
241
+ params: {
242
+ heading: "My dogs",
243
+ items: Array(12)
244
+ .fill({
245
+ ...{
246
+ href: "#",
247
+ src: "https://picsum.photos/id/237/800/600",
248
+ alt: "Photo of a puppy",
249
+ width: "800",
250
+ height: "600",
251
+ title: "Cat",
252
+ subtitle: "4 photos",
253
+ },
254
+ })
255
+ .map((item, index) => {
256
+ const pseudoRandom = ((index * 29) % 8) + 1;
257
+ return {
258
+ ...item,
259
+ href: `#/category-${index}`,
260
+ title: `Category #${index + 101}`,
261
+ subtitle: `${pseudoRandom} photos`,
262
+ };
263
+ }),
264
+ columns: 4,
265
+ columnsMedium: 3,
266
+ columnsSmall: 2,
267
+ columnsTiny: 1,
268
+ },
269
+ })}
179
270
  <article>
180
271
  ${Footer({})}
181
272
  </div>
182
273
  </div>`;
183
274
  };
184
275
 
185
- export const Examples = Template.bind({});
186
- // Examples.parameters = { options: { showPanel: false } };
187
- Examples.args = {
276
+ export const System = Template.bind({});
277
+ // System.parameters = { options: { showPanel: false } };
278
+ System.args = {
188
279
  theme: "system",
189
280
  };
281
+
282
+ export const Light = Template.bind({});
283
+ Light.args = {
284
+ theme: "light",
285
+ };
286
+
287
+ export const Dark = Template.bind({});
288
+ Dark.args = {
289
+ theme: "dark",
290
+ };
291
+
292
+ export const LightHighContrast = Template.bind({});
293
+ LightHighContrast.args = {
294
+ theme: "light high-contrast",
295
+ };
296
+
297
+ export const DarkHighContrast = Template.bind({});
298
+ DarkHighContrast.args = {
299
+ theme: "dark high-contrast",
300
+ };
@@ -0,0 +1,66 @@
1
+ import { Meta, Canvas } from "@storybook/blocks";
2
+ import * as OverrideStories from './overrides.stories';
3
+
4
+ <Meta of={OverrideStories} />
5
+
6
+ # Overrides
7
+
8
+ ## Margin
9
+
10
+ ### Top
11
+
12
+ - `tna-!--no-margin-top`
13
+ - `tna-!--margin-top-xs`
14
+ - `tna-!--margin-top-s`
15
+ - `tna-!--margin-top-m`
16
+ - `tna-!--margin-top-l`
17
+ - `tna-!--margin-top-xl`
18
+
19
+ ### Bottom
20
+
21
+ - `tna-!--no-margin-bottom`
22
+ - `tna-!--margin-bottom-xs`
23
+ - `tna-!--margin-bottom-s`
24
+ - `tna-!--margin-bottom-m`
25
+ - `tna-!--margin-bottom-l`
26
+ - `tna-!--margin-bottom-xl`
27
+
28
+ ### Vertical (top and bottom)
29
+
30
+ - `tna-!--no-margin-vertical`
31
+ - `tna-!--margin-vertical-xs`
32
+ - `tna-!--margin-vertical-s`
33
+ - `tna-!--margin-vertical-m`
34
+ - `tna-!--margin-vertical-l`
35
+ - `tna-!--margin-vertical-xl`
36
+
37
+ ## Padding
38
+
39
+ ### Top
40
+
41
+ - `tna-!--no-padding-top`
42
+ - `tna-!--padding-top-xs`
43
+ - `tna-!--padding-top-s`
44
+ - `tna-!--padding-top-m`
45
+ - `tna-!--padding-top-l`
46
+ - `tna-!--padding-top-xl`
47
+
48
+ ### Bottom
49
+
50
+ - `tna-!--no-padding-bottom`
51
+ - `tna-!--padding-bottom-xs`
52
+ - `tna-!--padding-bottom-s`
53
+ - `tna-!--padding-bottom-m`
54
+ - `tna-!--padding-bottom-l`
55
+ - `tna-!--padding-bottom-xl`
56
+
57
+ ### Vertical (top and bottom)
58
+
59
+ - `tna-!--no-padding-vertical`
60
+ - `tna-!--padding-vertical-xs`
61
+ - `tna-!--padding-vertical-s`
62
+ - `tna-!--padding-vertical-m`
63
+ - `tna-!--padding-vertical-l`
64
+ - `tna-!--padding-vertical-xl`
65
+
66
+
@@ -0,0 +1,36 @@
1
+ const argTypes = {
2
+ marginTop: {
3
+ control: "radio",
4
+ options: [
5
+ "none",
6
+ // "xs",
7
+ "s",
8
+ "m",
9
+ "l",
10
+ "xl",
11
+ ],
12
+ },
13
+ };
14
+
15
+ export default {
16
+ title: "Utilities/Overrides",
17
+ argTypes,
18
+ };
19
+
20
+ const Template = ({ marginTop }) => {
21
+ const marginClass =
22
+ marginTop === "none"
23
+ ? `tna-!--no-margin-top`
24
+ : `tna-!--margin-top-${marginTop}`;
25
+ return `<p class="tna-!--no-margin-bottom">Lorem ipsum</p>
26
+ <p class="tna-!--no-margin-bottom tna-!--margin-top-s">Lorem ipsum (tna-!--margin-top-s)</p>
27
+ <p class="tna-!--no-margin-bottom tna-!--margin-top-m">Lorem ipsum (tna-!--margin-top-m)</p>
28
+ <p class="tna-!--no-margin-bottom tna-!--margin-top-l">Lorem ipsum (tna-!--margin-top-l)</p>
29
+ <p class="tna-!--no-margin-bottom tna-!--margin-top-xl">Lorem ipsum (tna-!--margin-top-xl)</p>
30
+ <p class="tna-!--no-margin-bottom ${marginClass}">Lorem ipsum (${marginClass})</p>`;
31
+ };
32
+
33
+ export const Margin = Template.bind({});
34
+ Margin.args = {
35
+ marginTop: "none",
36
+ };
@@ -12,7 +12,8 @@ const HeadingTemplate = ({ params }, level) => `<h${level} class="tna-heading${
12
12
  params.size ? ` tna-heading--${params.size}` : ""
13
13
  }">
14
14
  ${params.text} (${params.size.toUpperCase()})
15
- </h${level}>`;
15
+ </h${level}>
16
+ `;
16
17
 
17
18
  const HeadingsTemplate = ({ text }) =>
18
19
  `${HeadingTemplate({ params: { text, size: "xl" } }, 1)}${HeadingTemplate(
@@ -0,0 +1,34 @@
1
+ const argTypes = {
2
+ text: { control: "text" },
3
+ };
4
+
5
+ export default {
6
+ title: "Utilities/Typography",
7
+ argTypes,
8
+ };
9
+
10
+ const ParagraphTemplate = ({ paragraphs }) =>
11
+ paragraphs.map((paragraph) => `<p class="tna-p">${paragraph}</p>`).join("");
12
+ export const Paragraph = ParagraphTemplate.bind({});
13
+ Paragraph.args = {
14
+ paragraphs: [
15
+ "This is some body text.",
16
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh. Donec ac tellus in dui rutrum maximus. Aliquam vel euismod eros. Integer ut magna velit. Fusce sed dui sit amet metus eleifend dictum quis vitae mi. Aenean sagittis euismod purus, in accumsan metus venenatis nec. Nullam nec velit felis. Sed nec felis eu nisl varius dictum eu quis nisl. Donec dapibus est arcu, vel pellentesque risus pellentesque eget.",
17
+ "Nam a posuere lectus. Vivamus facilisis est pretium augue aliquet iaculis. Phasellus ligula orci, commodo eget lectus et, tincidunt scelerisque erat. Aliquam in est vel purus ultricies vulputate non sed ligula. Pellentesque ut felis ullamcorper, eleifend erat dapibus, feugiat metus. Phasellus vitae dolor commodo, posuere nisl sed, luctus mauris. Etiam malesuada tincidunt enim, ac fermentum est pulvinar id. Maecenas id accumsan libero. Curabitur at velit nisi. Nullam gravida mauris quam, tempor pharetra risus venenatis vel. Proin quis malesuada lacus. Nulla condimentum facilisis turpis, et elementum leo. Nulla gravida quam mauris, id scelerisque est rhoncus ac.",
18
+ ],
19
+ };
20
+
21
+ const BlockquoteTemplate = ({
22
+ html,
23
+ author,
24
+ }) => `<blockquote class="tna-blockquote">
25
+ <div class="tna-blockquote__quote">
26
+ ${html}
27
+ </div>
28
+ <p class="tna-blockquote__author">${author}</p>
29
+ </p>`;
30
+ export const Blockquote = BlockquoteTemplate.bind({});
31
+ Blockquote.args = {
32
+ html: "<p>A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.</p>",
33
+ author: "Douglas Adams, Mostly Harmless",
34
+ };
@@ -26,59 +26,37 @@
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);
29
+ @mixin colour-font($colour) {
30
+ color: map.get(colour.$colour-palette-default, $colour);
31
+ @if $colour == "accent" {
32
+ color: var(--#{$colour}, var(--accent-default));
32
33
  } @else {
33
- color: map.get(colour.$colour-palette-default, $colour);
34
- }
35
- @if features.$support-colour-schemes {
36
34
  color: var(--#{$colour});
37
35
  }
38
36
  }
39
37
 
40
- @mixin colour-background($colour, $inverted: false) {
41
- @if $inverted {
42
- background-color: map.get(colour.$colour-palette-dark, $colour);
38
+ @mixin colour-background($colour) {
39
+ background-color: map.get(colour.$colour-palette-default, $colour);
40
+ @if $colour == "accent" {
41
+ background-color: var(--#{$colour}, var(--accent-default));
43
42
  } @else {
44
- background-color: map.get(colour.$colour-palette-default, $colour);
45
- }
46
- @if features.$support-colour-schemes {
47
43
  background-color: var(--#{$colour});
48
44
  }
49
45
  }
50
46
 
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
- }
47
+ @mixin colour-border($colour) {
48
+ border-color: map.get(colour.$colour-palette-default, $colour);
49
+ border-color: var(--#{$colour});
60
50
  }
61
51
 
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
- }
52
+ @mixin colour-outline($colour) {
53
+ outline-color: map.get(colour.$colour-palette-default, $colour);
54
+ outline-color: var(--#{$colour});
71
55
  }
72
56
 
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
- }
57
+ @mixin colour-fill($colour) {
58
+ fill: map.get(colour.$colour-palette-default, $colour);
59
+ fill: var(--#{$colour});
82
60
  }
83
61
 
84
62
  @mixin fixed {
@@ -88,42 +66,62 @@
88
66
  }
89
67
 
90
68
  @mixin invert {
69
+ --font-base: var(--contrast-font-base);
70
+ --font-dark: var(--contrast-font-dark);
71
+ --font-light: var(--contrast-font-light);
72
+ --link: var(--contrast-link);
73
+ --link-visited: var(--contrast-link-visited);
74
+ --keyline: var(--contrast-keyline);
75
+ --keyline-dark: var(--contrast-keyline-dark);
76
+
77
+ @include colour-font("contrast-font-base");
78
+ @include colour-background("contrast-background");
79
+ }
80
+
81
+ @mixin uninvert {
82
+ @include colour-css-vars;
83
+
91
84
  .tna-template--system-theme & {
92
- @include colour-css-vars-dark;
85
+ @include colour-css-vars;
93
86
 
94
87
  @media (prefers-color-scheme: dark) {
95
- @include colour-css-vars;
88
+ @include colour-css-vars-dark;
96
89
  }
97
90
 
98
91
  @media (prefers-contrast: more) {
99
- @include colour-css-vars-high-contrast-dark;
92
+ @include colour-css-vars-high-contrast;
100
93
  }
101
94
 
102
95
  @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
103
- @include colour-css-vars-high-contrast;
96
+ @include colour-css-vars-high-contrast-dark;
104
97
  }
105
98
  }
106
99
 
107
100
  .tna-template--light-theme & {
108
- @include colour-css-vars-dark;
101
+ @include colour-css-vars;
109
102
  }
110
103
 
111
104
  .tna-template--dark-theme & {
112
- @include colour-css-vars;
105
+ @include colour-css-vars-dark;
113
106
  }
114
107
 
115
108
  .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
109
  @include colour-css-vars-high-contrast;
121
110
  }
122
111
 
123
- @include colour-font("font-base", true);
124
- @include colour-background("page-background", true);
112
+ .tna-template--high-contrast-theme.tna-template--dark-theme & {
113
+ @include colour-css-vars-high-contrast-dark;
114
+ }
125
115
  }
126
116
 
127
- %tna-invert {
128
- @include invert;
117
+ @mixin on-high-contrast {
118
+ .tna-template--high-contrast-theme & {
119
+ @content;
120
+ }
121
+
122
+ @media (prefers-contrast: more) {
123
+ .tna-template--system-theme & {
124
+ @content;
125
+ }
126
+ }
129
127
  }
@@ -5,9 +5,17 @@
5
5
  font-size: #{math.div($fontSizePx, typography.$base-font-size-px)}rem;
6
6
  }
7
7
 
8
+ @mixin main-font-weight {
9
+ font-weight: typography.$font-weight-main;
10
+ }
11
+
12
+ @mixin main-font-weight-bold {
13
+ font-weight: typography.$font-weight-main-bold;
14
+ }
15
+
8
16
  @mixin main-font {
9
17
  font-family: typography.$font-family-main;
10
- font-weight: typography.$font-weight-main;
18
+ @include main-font-weight;
11
19
  }
12
20
 
13
21
  @mixin heading-font {
@@ -18,4 +26,8 @@
18
26
  @mixin detail-font {
19
27
  font-family: typography.$font-family-detail;
20
28
  font-weight: typography.$font-weight-detail;
29
+ @include relative-font-size(14);
30
+ text-transform: uppercase;
31
+ line-height: #{math.div(typography.$base-font-size-px, 14)};
32
+ // line-height: 1;
21
33
  }
@@ -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;
@@ -114,11 +98,11 @@
114
98
 
115
99
  overflow: auto;
116
100
 
117
- &:has(.tna-header):has(#main[role="main"]):has(.tna-footer) {
101
+ &:has(.tna-header):has(#main-content[role="main"]):has(.tna-footer) {
118
102
  display: flex;
119
103
  flex-direction: column;
120
104
 
121
- #main[role="main"] {
105
+ #main-content[role="main"] {
122
106
  flex: 1;
123
107
  }
124
108
  }
@@ -150,11 +134,15 @@ canvas {
150
134
  }
151
135
 
152
136
  hr {
153
- margin: 1rem;
137
+ margin: 3rem 0;
154
138
 
155
139
  border-width: 1px 0 0;
156
140
  @include colour.colour-border("keyline");
157
- border-style: solid;
141
+ border-style: dashed;
142
+
143
+ @include colour.on-high-contrast {
144
+ border-style: solid;
145
+ }
158
146
  }
159
147
 
160
148
  .tna-visually-hidden {