@nationalarchives/frontend 0.1.21-prerelease → 0.1.22-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 (106) hide show
  1. package/govuk-prototype-kit.config.json +2 -2
  2. package/nationalarchives/_prototype-kit.scss +2 -2
  3. package/nationalarchives/all.css +2 -2
  4. package/nationalarchives/all.css.map +1 -1
  5. package/nationalarchives/all.js +1 -1
  6. package/nationalarchives/all.js.map +1 -1
  7. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  8. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  9. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  10. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  11. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +5 -15
  12. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +2 -4
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +64 -0
  14. package/nationalarchives/components/breadcrumbs/fixtures.json +2 -2
  15. package/nationalarchives/components/breadcrumbs/template.njk +11 -15
  16. package/nationalarchives/components/button/_button-group.scss +1 -1
  17. package/nationalarchives/components/button/button.css +1 -1
  18. package/nationalarchives/components/button/button.css.map +1 -1
  19. package/nationalarchives/components/button/button.scss +2 -1
  20. package/nationalarchives/components/card/card.css +1 -1
  21. package/nationalarchives/components/card/card.css.map +1 -1
  22. package/nationalarchives/components/card/card.scss +1 -1
  23. package/nationalarchives/components/card/card.stories.js +4 -1
  24. package/nationalarchives/components/card/fixtures.json +17 -17
  25. package/nationalarchives/components/card/macro-options.json +6 -0
  26. package/nationalarchives/components/card/template.njk +5 -5
  27. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -1
  28. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  29. package/nationalarchives/components/cookie-banner/template.njk +1 -1
  30. package/nationalarchives/components/filters/filters.css +1 -1
  31. package/nationalarchives/components/filters/filters.css.map +1 -1
  32. package/nationalarchives/components/filters/filters.scss +1 -1
  33. package/nationalarchives/components/footer/fixtures.json +1 -1
  34. package/nationalarchives/components/footer/footer.css +1 -1
  35. package/nationalarchives/components/footer/footer.css.map +1 -1
  36. package/nationalarchives/components/footer/footer.scss +7 -48
  37. package/nationalarchives/components/footer/footer.stories.js +1 -1
  38. package/nationalarchives/components/footer/template.njk +11 -10
  39. package/nationalarchives/components/gallery/gallery.css +1 -1
  40. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  41. package/nationalarchives/components/gallery/template.njk +2 -2
  42. package/nationalarchives/components/grid/grid.css +1 -1
  43. package/nationalarchives/components/grid/grid.css.map +1 -1
  44. package/nationalarchives/components/grid/grid.stories.js +21 -0
  45. package/nationalarchives/components/grid/macro-options.json +48 -0
  46. package/nationalarchives/components/grid/template.njk +29 -3
  47. package/nationalarchives/components/header/header.css +1 -1
  48. package/nationalarchives/components/header/header.css.map +1 -1
  49. package/nationalarchives/components/header/header.scss +52 -123
  50. package/nationalarchives/components/header/header.stories.js +2 -0
  51. package/nationalarchives/components/header/macro-options.json +12 -0
  52. package/nationalarchives/components/header/template.njk +6 -1
  53. package/nationalarchives/components/hero/fixtures.json +88 -7
  54. package/nationalarchives/components/hero/hero.css +1 -1
  55. package/nationalarchives/components/hero/hero.css.map +1 -1
  56. package/nationalarchives/components/hero/hero.scss +12 -3
  57. package/nationalarchives/components/hero/hero.stories.js +27 -3
  58. package/nationalarchives/components/hero/macro-options.json +44 -0
  59. package/nationalarchives/components/hero/template.njk +10 -2
  60. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  61. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  62. package/nationalarchives/components/index-grid/template.njk +1 -1
  63. package/nationalarchives/components/message/message.css +1 -1
  64. package/nationalarchives/components/message/message.css.map +1 -1
  65. package/nationalarchives/components/message/message.scss +4 -0
  66. package/nationalarchives/components/pagination/pagination.css +1 -1
  67. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  68. package/nationalarchives/components/pagination/pagination.scss +22 -3
  69. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  70. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  71. package/nationalarchives/components/phase-banner/phase-banner.scss +5 -1
  72. package/nationalarchives/components/picture/picture.css +1 -1
  73. package/nationalarchives/components/picture/picture.css.map +1 -1
  74. package/nationalarchives/components/picture/picture.scss +1 -1
  75. package/nationalarchives/components/profile/profile.css +1 -1
  76. package/nationalarchives/components/profile/profile.css.map +1 -1
  77. package/nationalarchives/components/profile/template.njk +2 -2
  78. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  79. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  80. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  81. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  82. package/nationalarchives/components/tabs/tabs.css +1 -1
  83. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  84. package/nationalarchives/components/tabs/tabs.scss +1 -1
  85. package/nationalarchives/components/tabs/tabs.stories.js +6 -6
  86. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +55 -49
  87. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +10 -21
  88. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +2 -2
  89. package/nationalarchives/stories/utilities/typography/headings.stories.js +2 -2
  90. package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
  91. package/nationalarchives/templates/homepage.njk +1 -1
  92. package/nationalarchives/templates/layouts/_generic.njk +7 -9
  93. package/nationalarchives/templates/layouts/_prototype-kit.njk +6 -5
  94. package/nationalarchives/templates/search-results.njk +1 -1
  95. package/nationalarchives/tools/_colour.scss +35 -5
  96. package/nationalarchives/tools/_grid.scss +12 -12
  97. package/nationalarchives/tools/_spacing.scss +6 -6
  98. package/nationalarchives/utilities/_columns.scss +42 -0
  99. package/nationalarchives/utilities/_global.scss +9 -7
  100. package/nationalarchives/utilities/_index.scss +2 -0
  101. package/nationalarchives/utilities/_lists.scss +181 -0
  102. package/nationalarchives/utilities/_typography.scss +86 -272
  103. package/nationalarchives/variables/_colour.scss +1 -2
  104. package/nationalarchives/variables/_typography.scss +3 -3
  105. package/package.json +15 -14
  106. package/nationalarchives/stories/design/about.mdx +0 -25
@@ -104,6 +104,7 @@ const Template = ({ theme, accent }) => {
104
104
  phase: "beta",
105
105
  message:
106
106
  'This is a new service - <a href="#">give us your feedback</a> to help improve it.',
107
+ classes: "tna-phase-banner--accent",
107
108
  },
108
109
  })}
109
110
  ${Header({
@@ -129,32 +130,36 @@ const Template = ({ theme, accent }) => {
129
130
  ],
130
131
  },
131
132
  })}
132
- ${Breadcrumbs({
133
- params: {
134
- items: [
135
- {
136
- text: "Alpha",
137
- href: "#/alpha",
138
- },
139
- {
140
- text: "Beta",
141
- href: "#/beta",
142
- },
143
- {
144
- text: "Gamma",
145
- href: "#/gamma",
146
- },
147
- {
148
- text: "Delta",
149
- href: "#/delta",
150
- },
151
- {
152
- text: "Epsilon",
153
- href: "#/epsilon",
133
+ <div class="tna-container">
134
+ <div class="tna-column tna-column--full">
135
+ ${Breadcrumbs({
136
+ params: {
137
+ items: [
138
+ {
139
+ text: "Alpha",
140
+ href: "#/alpha",
141
+ },
142
+ {
143
+ text: "Beta",
144
+ href: "#/beta",
145
+ },
146
+ {
147
+ text: "Gamma",
148
+ href: "#/gamma",
149
+ },
150
+ {
151
+ text: "Delta",
152
+ href: "#/delta",
153
+ },
154
+ {
155
+ text: "Epsilon",
156
+ href: "#/epsilon",
157
+ },
158
+ ],
154
159
  },
155
- ],
156
- },
157
- })}
160
+ })}
161
+ </div>
162
+ </div>
158
163
  <main id="main-content" role="main">
159
164
  ${Hero({
160
165
  params: {
@@ -171,7 +176,7 @@ const Template = ({ theme, accent }) => {
171
176
  })}
172
177
  <div class="tna-container tna-section">
173
178
  <div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny">
174
- <hgroup class="tna-hgroup tna-hgroup--l">
179
+ <hgroup class="tna-hgroup-l">
175
180
  <p class="tna-hgroup__supertitle">TNA colour theme</p>
176
181
  <h2 class="tna-hgroup__title">Heading</h2>
177
182
  </hgroup>
@@ -264,38 +269,38 @@ const Template = ({ theme, accent }) => {
264
269
  <hr>
265
270
  <div class="tna-container tna-section">
266
271
  <div class="tna-column tna-column--full">
267
- <h1 class="tna-heading tna-heading--xl">
272
+ <h1 class="tna-heading-xl">
268
273
  This is a heading (XL)
269
274
  </h1>
270
275
  <p>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.</p>
271
- <h2 class="tna-heading tna-heading--l">
276
+ <h2 class="tna-heading-l">
272
277
  This is a heading (L)
273
278
  </h2>
274
279
  <p>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.</p>
275
- <h3 class="tna-heading tna-heading--m">
280
+ <h3 class="tna-heading-m">
276
281
  This is a heading (M)
277
282
  </h3>
278
283
  <p>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.</p>
279
- <h4 class="tna-heading tna-heading--s">
284
+ <h4 class="tna-heading-s">
280
285
  This is a heading (S)
281
286
  </h4>
282
287
  <p>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.</p>
283
- <hgroup class="tna-hgroup tna-hgroup--xl">
288
+ <hgroup class="tna-hgroup-xl">
284
289
  <p class="tna-hgroup__supertitle">Supertitle</p>
285
290
  <h2 class="tna-hgroup__title">This is a heading (XL)</h2>
286
291
  </hgroup>
287
292
  <p>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.</p>
288
- <hgroup class="tna-hgroup tna-hgroup--l">
293
+ <hgroup class="tna-hgroup-l">
289
294
  <p class="tna-hgroup__supertitle">Supertitle</p>
290
295
  <h2 class="tna-hgroup__title">This is a heading (L)</h2>
291
296
  </hgroup>
292
297
  <p>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.</p>
293
- <hgroup class="tna-hgroup tna-hgroup--m">
298
+ <hgroup class="tna-hgroup-m">
294
299
  <p class="tna-hgroup__supertitle">Supertitle</p>
295
300
  <h2 class="tna-hgroup__title">This is a heading (M)</h2>
296
301
  </hgroup>
297
302
  <p>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.</p>
298
- <hgroup class="tna-hgroup tna-hgroup--s">
303
+ <hgroup class="tna-hgroup-s">
299
304
  <p class="tna-hgroup__supertitle">Supertitle</p>
300
305
  <h2 class="tna-hgroup__title">This is a heading (S)</h2>
301
306
  </hgroup>
@@ -309,11 +314,11 @@ const Template = ({ theme, accent }) => {
309
314
  </div>
310
315
  <p class="tna-blockquote__author">Douglas Adams, Mostly Harmless</p>
311
316
  </blockquote>
312
- <h2 class="tna-heading tna-heading--m">
317
+ <h2 class="tna-heading-m">
313
318
  <a href="#">Reaerching with The National Archives</a>
314
319
  </h2>
315
320
  <p>Lorem ipsum <a href="#">link</a></p>
316
- <hgroup class="tna-hgroup tna-hgroup--m">
321
+ <hgroup class="tna-hgroup-m">
317
322
  <p class="tna-hgroup__supertitle">Supertitle</p>
318
323
  <h2 class="tna-hgroup__title">
319
324
  <a href="#">Reaerching with The National Archives</a>
@@ -322,7 +327,7 @@ const Template = ({ theme, accent }) => {
322
327
  <p>Lorem ipsum <a href="#">link</a></p>
323
328
  </div>
324
329
  <div class="tna-column tna-column--width-1-2 tna-column--full-small tna-column--full-tiny tna-!--margin-top-m">
325
- <h3 class="tna-heading tna-heading--m">
330
+ <h3 class="tna-heading-m">
326
331
  Descriptions
327
332
  </h3>
328
333
  <dl class="tna-dl">
@@ -335,7 +340,7 @@ const Template = ({ theme, accent }) => {
335
340
  </dl>
336
341
  </div>
337
342
  <div class="tna-column tna-column--width-1-2 tna-column--full-small tna-column--full-tiny tna-!--margin-top-m">
338
- <h3 class="tna-heading tna-heading--m">
343
+ <h3 class="tna-heading-m">
339
344
  Descriptions
340
345
  </h3>
341
346
  <dl class="tna-dl tna-dl--plain">
@@ -348,7 +353,7 @@ const Template = ({ theme, accent }) => {
348
353
  </dl>
349
354
  </div>
350
355
  <div class="tna-column tna-column--full tna-!--margin-top-m">
351
- <h3 class="tna-heading tna-heading--m">
356
+ <h3 class="tna-heading-m">
352
357
  Descriptions
353
358
  </h3>
354
359
  <dl class="tna-dl tna-dl--icon-padding ">
@@ -368,7 +373,7 @@ const Template = ({ theme, accent }) => {
368
373
  </dt>
369
374
  <dd>LC 4</dd>
370
375
  </dl>
371
- <h2 class="tna-heading tna-heading--l">
376
+ <h2 class="tna-heading-l">
372
377
  Categories
373
378
  </h2>
374
379
  <ul class="tna-chip-list">
@@ -393,12 +398,13 @@ const Template = ({ theme, accent }) => {
393
398
  <hr>
394
399
  <div class="tna-container tna-section">
395
400
  <div class="tna-column tna-column--full">
396
- <p class="tna-!--no-margin-bottom">Lorem ipsum</p>
397
- <p class="tna-!--no-margin-bottom tna-!--padding-top-xs">Lorem ipsum</p>
398
- <p class="tna-!--no-margin-bottom tna-!--padding-top-s">Lorem ipsum</p>
399
- <p class="tna-!--no-margin-bottom tna-!--padding-top-m">Lorem ipsum</p>
400
- <p class="tna-!--no-margin-bottom tna-!--padding-top-l">Lorem ipsum</p>
401
- <p class="tna-!--no-margin-bottom tna-!--padding-top-xl">Lorem ipsum</p>
401
+ <p>Lorem ipsum</p>
402
+ <p class="tna-!--no-margin-top">Lorem ipsum (tna-!--no-margin-top)</p>
403
+ <p class="tna-!--margin-top-xs">Lorem ipsum (tna-!--margin-top-xs)</p>
404
+ <p class="tna-!--margin-top-s">Lorem ipsum (tna-!--margin-top-s)</p>
405
+ <p class="tna-!--margin-top-m">Lorem ipsum (tna-!--margin-top-m)</p>
406
+ <p class="tna-!--margin-top-l">Lorem ipsum (tna-!--margin-top-l)</p>
407
+ <p class="tna-!--margin-top-xl">Lorem ipsum (tna-!--margin-top-xl)</p>
402
408
  </div>
403
409
  </div>
404
410
  ${Hero({
@@ -481,17 +487,17 @@ const Template = ({ theme, accent }) => {
481
487
  {
482
488
  id: "unique-id-a",
483
489
  title: "Alpha section",
484
- body: '<h2 class="tna-heading">Alpha title</h2><p>Lorem ipsum</p>',
490
+ body: '<h2 class="tna-heading-l">Alpha title</h2><p>Lorem ipsum</p>',
485
491
  },
486
492
  {
487
493
  id: "unique-id-b",
488
494
  title: "Beta section",
489
- body: '<h2 class="tna-heading">Beta title</h2><p>Lorem ipsum</p>',
495
+ body: '<h2 class="tna-heading-l">Beta title</h2><p>Lorem ipsum</p>',
490
496
  },
491
497
  {
492
498
  id: "unique-id-c",
493
499
  title: "Gamma section",
494
- body: '<h2 class="tna-heading">Gamma title</h2><p>Lorem ipsum</p>',
500
+ body: '<h2 class="tna-heading-l">Gamma title</h2><p>Lorem ipsum</p>',
495
501
  },
496
502
  ],
497
503
  classes: "tna-tabs--demo",
@@ -1,30 +1,19 @@
1
- const argTypes = {
2
- marginTop: {
3
- control: "radio",
4
- options: ["none", "xs", "s", "m", "l", "xl"],
5
- },
6
- };
1
+ const argTypes = {};
7
2
 
8
3
  export default {
9
4
  title: "Utilities/Overrides",
10
5
  argTypes,
11
6
  };
12
7
 
13
- const Template = ({ marginTop }) => {
14
- const marginClass =
15
- marginTop === "none"
16
- ? `tna-!--no-margin-top`
17
- : `tna-!--margin-top-${marginTop}`;
18
- return `<p class="tna-!--margin-bottom-xl">Lorem ipsum (tna-!--margin-bottom-xl)</p>
19
- <p class="tna-!--margin-bottom-l">Lorem ipsum (tna-!--margin-bottom-l)</p>
20
- <p class="tna-!--margin-bottom-m">Lorem ipsum (tna-!--margin-bottom-m)</p>
21
- <p class="tna-!--margin-bottom-s">Lorem ipsum (tna-!--margin-bottom-s)</p>
22
- <p class="tna-!--margin-bottom-xs">Lorem ipsum (tna-!--margin-bottom-xs)</p>
23
- <p class="tna-!--no-margin-bottom">Lorem ipsum (tna-!--no-margin-bottom)</p>
24
- <p class="${marginClass}">Lorem ipsum (${marginClass})</p>`;
8
+ const Template = () => {
9
+ return `<p>Lorem ipsum</p>
10
+ <p class="tna-!--no-margin-top">Lorem ipsum (tna-!--no-margin-top)</p>
11
+ <p class="tna-!--margin-top-xs">Lorem ipsum (tna-!--margin-top-xs)</p>
12
+ <p class="tna-!--margin-top-s">Lorem ipsum (tna-!--margin-top-s)</p>
13
+ <p class="tna-!--margin-top-m">Lorem ipsum (tna-!--margin-top-m)</p>
14
+ <p class="tna-!--margin-top-l">Lorem ipsum (tna-!--margin-top-l)</p>
15
+ <p class="tna-!--margin-top-xl">Lorem ipsum (tna-!--margin-top-xl)</p>`;
25
16
  };
26
17
 
27
18
  export const Margin = Template.bind({});
28
- Margin.args = {
29
- marginTop: "none",
30
- };
19
+ Margin.args = {};
@@ -19,13 +19,13 @@ const Template = ({
19
19
  singleSentence,
20
20
  }) =>
21
21
  singleSentence
22
- ? `<hgroup class="tna-hgroup tna-hgroup--${size}">
22
+ ? `<hgroup class="tna-hgroup-${size}">
23
23
  <h${level} class="tna-hgroup__title">
24
24
  <span class="tna-hgroup__supertitle">${supertitle}</span>
25
25
  <span class="tna-hgroup__title">${title}</span>
26
26
  </h${level}>
27
27
  </hgroup>`
28
- : `<hgroup class="tna-hgroup tna-hgroup--${size}">
28
+ : `<hgroup class="tna-hgroup-${size}">
29
29
  <p class="tna-hgroup__supertitle">${supertitle}</p>
30
30
  <h${level} class="tna-hgroup__title">${title}</h${level}>
31
31
  </hgroup>`;
@@ -8,8 +8,8 @@ export default {
8
8
  argTypes,
9
9
  };
10
10
 
11
- const HeadingTemplate = ({ params }, level) => `<h${level} class="tna-heading${
12
- params.size ? ` tna-heading--${params.size}` : ""
11
+ const HeadingTemplate = ({ params }, level) => `<h${level} class="tna-heading-${
12
+ params.size
13
13
  }">
14
14
  ${params.text} (${params.size.toUpperCase()})
15
15
  </h${level}>
@@ -19,7 +19,7 @@ Paragraph.args = {
19
19
  };
20
20
 
21
21
  const HeadingLinkTemplate = ({ text, href }) =>
22
- `<h2 class="tna-heading tna-heading--s">
22
+ `<h2 class="tna-heading-s">
23
23
  <a href="${href}">${text}</a>
24
24
  </h2>`;
25
25
  export const HeadingLink = HeadingLinkTemplate.bind({});
@@ -8,7 +8,7 @@
8
8
  <div class="tna-section">
9
9
  <div class="tna-container">
10
10
  <div class="tna-column tna-column--full">
11
- <h1 class="tna-heading tna-heading--xl">
11
+ <h1 class="tna-heading-xl">
12
12
  Welcome
13
13
  </h1>
14
14
  </div>
@@ -24,7 +24,7 @@
24
24
  {% block head %}{% endblock %}
25
25
 
26
26
  {% block stylesheets %}
27
- <link rel="stylesheet" type="text/css" href="{{ tnaFrontendCssPath | default('/static/tna-frontend/all.css') }}">
27
+ <link rel="stylesheet" type="text/css" href="{{ tnaFrontendCssPath | default('/static/tna-frontend') }}/all.css">
28
28
  {% endblock %}
29
29
  </head>
30
30
  <body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
@@ -60,15 +60,13 @@
60
60
  {% endblock %}
61
61
 
62
62
  {% block bodyEnd %}
63
- {#
64
- <script src="{{ tnaFrontendJsPath | default('/static/tna-frontend/all.js') }}"></script>
63
+ <script src="{{ tnaFrontendJsPath | default('/static/tna-frontend') }}/all.js"></script>
65
64
  <script>
66
- window.TNAFrontend.initAll();
67
- </script>
68
- #}
69
- <script type="module">
70
- import { initAll } from "{{ tnaFrontendJsPath | default('/static/tna-frontend/all.js') }}";
71
- initAll();
65
+ if (window.TNAFrontend && window.TNAFrontend.initAll) {
66
+ document.addEventListener("DOMContentLoaded", function() {
67
+ window.TNAFrontend.initAll();
68
+ });
69
+ }
72
70
  </script>
73
71
  {% endblock %}
74
72
  </body>
@@ -1,15 +1,16 @@
1
1
  {% extends "./_generic.njk" %}
2
2
 
3
3
  {% block stylesheets %}
4
- <link href="/public/stylesheets/unbranded.css" media="all" rel="stylesheet" type="text/css" />
5
- <link href="/plugin-assets/@nationalarchives/frontend/nationalarchives/all.css" media="all" rel="stylesheet" type="text/css" />
6
-
7
- {% include "govuk-prototype-kit/includes/stylesheets-plugins.njk" %}
4
+ {% include "govuk-prototype-kit/includes/stylesheets-plugins.njk" %}
8
5
  {% endblock %}
9
6
 
10
7
  {% block bodyEnd %}
11
8
  {% include "govuk-prototype-kit/includes/scripts.njk" %}
12
9
  <script>
13
- window.TNAFrontend.initAll()
10
+ if (window.TNAFrontend && window.TNAFrontend.initAll) {
11
+ document.addEventListener("DOMContentLoaded", function() {
12
+ window.TNAFrontend.initAll();
13
+ });
14
+ }
14
15
  </script>
15
16
  {% endblock %}
@@ -12,7 +12,7 @@
12
12
  <main class="tna-main-wrapper tna-column tna-column--container tna-column--3-4 tna-column--width-2-3-medium tna-column--full-small tna-column--full-tiny {{ mainClasses }}" id="main-content" role="main"{% if mainLang %} lang="{{ mainLang }}"{% endif %}>
13
13
  {% block beforeContent %}{% endblock %}
14
14
  <div class="tna-column tna-column--full">
15
- <h1 class="tna-heading tna-heading--xl">
15
+ <h1 class="tna-heading-xl">
16
16
  Search results for "foobar"
17
17
  </h1>
18
18
  </div>
@@ -164,14 +164,44 @@
164
164
  fill: var(--#{$colour}) if($important, !important, null);
165
165
  }
166
166
 
167
- %fixed {
168
- @include colour-css-vars;
167
+ %plain {
168
+ .tna-template--system-theme & {
169
+ @include colour-css-vars;
170
+
171
+ @media (prefers-color-scheme: dark) {
172
+ @include colour-css-vars-dark;
173
+ }
174
+
175
+ @media (prefers-contrast: more) {
176
+ @include colour-css-vars-high-contrast;
177
+ }
178
+
179
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
180
+ @include colour-css-vars-high-contrast-dark;
181
+ }
182
+ }
183
+
184
+ .tna-template--light-theme & {
185
+ @include colour-css-vars;
186
+ }
187
+
188
+ .tna-template--dark-theme & {
189
+ @include colour-css-vars-dark;
190
+ }
191
+
192
+ .tna-template--high-contrast-theme & {
193
+ @include colour-css-vars-high-contrast;
194
+ }
195
+
196
+ .tna-template--high-contrast-theme.tna-template--dark-theme & {
197
+ @include colour-css-vars-high-contrast-dark;
198
+ }
169
199
 
170
- @include colour-font("font-base");
200
+ --background: var(--page-background);
171
201
  }
172
202
 
173
- @mixin fixed {
174
- @extend %fixed;
203
+ @mixin plain {
204
+ @extend %plain;
175
205
  }
176
206
 
177
207
  %invert {
@@ -24,13 +24,13 @@
24
24
  flex: none;
25
25
  }
26
26
 
27
- // .column--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
28
- // margin-right: math.div(100%, $count) * $i;
29
- // }
27
+ &--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
28
+ margin-right: math.div(100%, $count) * $i;
29
+ }
30
30
 
31
- // .column--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
32
- // margin-left: math.div(100%, $count) * $i;
33
- // }
31
+ &--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
32
+ margin-left: math.div(100%, $count) * $i;
33
+ }
34
34
 
35
35
  $simplest-fraction-found: true;
36
36
  }
@@ -42,13 +42,13 @@
42
42
  flex: none;
43
43
  }
44
44
 
45
- // .column--margin-right-#{$i}-#{$count}#{$suffix} {
46
- // margin-right: math.div(100%, $count) * $i;
47
- // }
45
+ &--margin-right-#{$i}-#{$count}#{$suffix} {
46
+ margin-right: math.div(100%, $count) * $i;
47
+ }
48
48
 
49
- // .column--margin-left-#{$i}-#{$count}#{$suffix} {
50
- // margin-left: math.div(100%, $count) * $i;
51
- // }
49
+ &--margin-left-#{$i}-#{$count}#{$suffix} {
50
+ margin-left: math.div(100%, $count) * $i;
51
+ }
52
52
  }
53
53
  }
54
54
 
@@ -1,16 +1,16 @@
1
1
  @use "sass:map";
2
2
  @use "../variables/spacing";
3
3
 
4
- %space-below {
5
- margin-bottom: 2rem;
4
+ %space-above {
5
+ margin-top: 2rem;
6
6
 
7
- &:last-child {
8
- margin-bottom: 0;
7
+ &:first-child {
8
+ margin-top: 0;
9
9
  }
10
10
  }
11
11
 
12
- @mixin space-below {
13
- @extend %space-below;
12
+ @mixin space-above {
13
+ @extend %space-above;
14
14
  }
15
15
 
16
16
  @function spacing($size) {
@@ -0,0 +1,42 @@
1
+ @use "../tools/media";
2
+ @use "../variables/grid";
3
+
4
+ .tna-columns {
5
+ column-gap: grid.$gutter-width;
6
+
7
+ &--2 {
8
+ column-count: 2;
9
+ }
10
+
11
+ &--3 {
12
+ column-count: 3;
13
+ }
14
+
15
+ @include media.on-tiny {
16
+ column-gap: grid.$gutter-width-tiny;
17
+ }
18
+
19
+ @include media.on-small {
20
+ @for $i from 1 through 4 {
21
+ &--#{$i}-small {
22
+ column-count: $i;
23
+ }
24
+ }
25
+ }
26
+
27
+ @include media.on-tiny {
28
+ @for $i from 1 through 4 {
29
+ &--#{$i}-tiny {
30
+ column-count: $i;
31
+ }
32
+ }
33
+ }
34
+
35
+ &__block {
36
+ break-inside: avoid;
37
+ }
38
+
39
+ &:has(&__block:only-of-type) {
40
+ column-count: 1;
41
+ }
42
+ }
@@ -68,11 +68,9 @@
68
68
  }
69
69
  }
70
70
 
71
- @include colour.accent-css-vars("black"); // TODO: Temp
72
-
73
- // &--black-accent {
74
- // @include colour.accent-css-vars("black");
75
- // }
71
+ &--black-accent {
72
+ @include colour.accent-css-vars("black");
73
+ }
76
74
 
77
75
  &--yellow-accent {
78
76
  @include colour.accent-css-vars("yellow");
@@ -137,7 +135,7 @@ canvas {
137
135
  }
138
136
 
139
137
  hr {
140
- margin: 2rem 0;
138
+ margin: 0;
141
139
 
142
140
  border-width: 1px 0 0;
143
141
  @include colour.colour-border("keyline");
@@ -157,7 +155,7 @@ hr {
157
155
  .tna-aside {
158
156
  padding: 2rem;
159
157
 
160
- @include spacing.space-below;
158
+ @include spacing.space-above;
161
159
 
162
160
  @include media.on-mobile {
163
161
  padding: 1rem;
@@ -166,6 +164,10 @@ hr {
166
164
  @include colour.on-high-contrast {
167
165
  @include colour.colour-border("keyline-dark", 1px);
168
166
  }
167
+
168
+ &--tight {
169
+ padding: 1rem;
170
+ }
169
171
  }
170
172
 
171
173
  .tna-background {
@@ -1,5 +1,7 @@
1
1
  @use "a11y";
2
+ @use "columns";
2
3
  @use "debug";
3
4
  @use "global";
5
+ @use "lists";
4
6
  @use "overrides";
5
7
  @use "typography";