@nationalarchives/frontend 0.1.10-prerelease → 0.1.11-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.
- package/README.md +1 -1
- package/govuk-prototype-kit.config.json +0 -3
- package/nationalarchives/_features.scss +3 -0
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +24 -8
- package/nationalarchives/all.scss +8 -4
- package/nationalarchives/assets/images/tna-square-logo.svg +5 -24
- package/nationalarchives/components/_index.scss +13 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +28 -7
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
- package/nationalarchives/components/breadcrumbs/macro.njk +1 -1
- package/nationalarchives/components/breadcrumbs/template.njk +14 -13
- package/nationalarchives/components/button/_index.scss +23 -11
- package/nationalarchives/components/button/button.stories.js +1 -1
- package/nationalarchives/components/button/fixtures.json +5 -5
- package/nationalarchives/components/button/macro.njk +1 -1
- package/nationalarchives/components/card/_index.scss +51 -7
- package/nationalarchives/components/card/card.js +2 -0
- package/nationalarchives/components/card/card.js.map +1 -0
- package/nationalarchives/components/card/card.mjs +45 -0
- package/nationalarchives/components/card/card.stories.js +18 -14
- package/nationalarchives/components/card/fixtures.json +14 -12
- package/nationalarchives/components/card/macro-options.json +18 -0
- package/nationalarchives/components/card/macro.njk +1 -1
- package/nationalarchives/components/card/template.njk +9 -4
- package/nationalarchives/components/filters/filters.stories.js +1 -1
- package/nationalarchives/components/filters/macro.njk +1 -1
- package/nationalarchives/components/filters/template.njk +2 -2
- package/nationalarchives/components/footer/_index.scss +24 -12
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +7 -7
- package/nationalarchives/components/footer/macro.njk +1 -1
- package/nationalarchives/components/footer/template.njk +4 -4
- package/nationalarchives/components/grid/_index.scss +10 -12
- package/nationalarchives/components/grid/fixtures.json +12 -12
- package/nationalarchives/components/grid/grid.stories.js +55 -1
- package/nationalarchives/components/grid/macro-options.json +30 -0
- package/nationalarchives/components/grid/macro.njk +1 -1
- package/nationalarchives/components/grid/template.njk +17 -1
- package/nationalarchives/components/header/_index.scss +103 -38
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +1 -12
- package/nationalarchives/components/header/header.stories.js +143 -2
- package/nationalarchives/components/header/macro-options.json +26 -0
- package/nationalarchives/components/header/macro.njk +1 -1
- package/nationalarchives/components/header/template.njk +27 -30
- package/nationalarchives/components/hero/_index.scss +33 -6
- package/nationalarchives/components/hero/fixtures.json +16 -1
- package/nationalarchives/components/hero/hero.stories.js +17 -3
- package/nationalarchives/components/hero/macro-options.json +13 -1
- package/nationalarchives/components/hero/macro.njk +1 -1
- package/nationalarchives/components/hero/template.njk +7 -5
- package/nationalarchives/components/phase-banner/_index.scss +17 -0
- package/nationalarchives/components/phase-banner/fixtures.json +69 -2
- package/nationalarchives/components/phase-banner/macro.njk +1 -1
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +32 -6
- package/nationalarchives/components/phase-banner/template.njk +4 -4
- package/nationalarchives/components/picture/_index.scss +77 -0
- package/nationalarchives/components/picture/fixtures.json +4 -0
- package/nationalarchives/components/picture/macro-options.json +88 -0
- package/nationalarchives/components/picture/macro.njk +3 -0
- package/nationalarchives/components/picture/picture.js +2 -0
- package/nationalarchives/components/picture/picture.js.map +1 -0
- package/nationalarchives/components/picture/picture.mjs +57 -0
- package/nationalarchives/components/picture/picture.stories.js +63 -0
- package/nationalarchives/components/picture/template.njk +42 -0
- package/nationalarchives/components/profile/_index.scss +2 -0
- package/nationalarchives/components/profile/fixtures.json +4 -0
- package/nationalarchives/components/profile/macro-options.json +14 -0
- package/nationalarchives/components/profile/macro.njk +3 -0
- package/nationalarchives/components/profile/profile.stories.js +32 -0
- package/nationalarchives/components/profile/template.njk +15 -0
- package/nationalarchives/components/sensitive-image/fixtures.json +3 -3
- package/nationalarchives/components/sensitive-image/macro.njk +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -1
- package/nationalarchives/components/tabs/_index.scss +148 -0
- package/nationalarchives/components/tabs/fixtures.json +4 -0
- package/nationalarchives/components/tabs/macro-options.json +52 -0
- package/nationalarchives/components/tabs/macro.njk +3 -0
- package/nationalarchives/components/tabs/tabs.js +2 -0
- package/nationalarchives/components/tabs/tabs.js.map +1 -0
- package/nationalarchives/components/tabs/tabs.mjs +214 -0
- package/nationalarchives/components/tabs/tabs.stories.js +302 -0
- package/nationalarchives/components/tabs/template.njk +20 -0
- package/nationalarchives/patterns/_index.scss +1 -0
- package/nationalarchives/patterns/featured-collection/_index.scss +13 -0
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +35 -0
- package/nationalarchives/patterns/featured-collection/macro-options.json +20 -0
- package/nationalarchives/patterns/featured-collection/macro.njk +3 -0
- package/nationalarchives/patterns/featured-collection/template.njk +96 -0
- package/nationalarchives/stories/development/contributing.mdx +2 -1
- package/nationalarchives/stories/utilities/colour.stories.js +189 -0
- package/nationalarchives/stories/utilities/typography.mdx +1 -0
- package/nationalarchives/stories/utilities/typography.stories.js +15 -0
- package/nationalarchives/templates/layouts/_generic.njk +1 -1
- package/nationalarchives/tools/_colour.scss +129 -0
- package/nationalarchives/tools/_grid.scss +2 -2
- package/nationalarchives/tools/_index.scss +5 -0
- package/nationalarchives/tools/_typography.scss +15 -0
- package/nationalarchives/utilities/_debug.scss +11 -0
- package/nationalarchives/utilities/_global.scss +65 -41
- package/nationalarchives/utilities/_index.scss +3 -0
- package/nationalarchives/utilities/_typography.scss +92 -60
- package/nationalarchives/variables/_colour.scss +96 -71
- package/nationalarchives/variables/_typography.scss +1 -1
- package/package.json +15 -14
- package/nationalarchives/components/_all.scss +0 -10
- package/nationalarchives/tools/_all.scss +0 -4
- package/nationalarchives/utilities/_all.scss +0 -2
- /package/nationalarchives/variables/{_all.scss → _index.scss} +0 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
{% from "nationalarchives/components/grid/macro.njk" import tnaGrid %}
|
2
|
+
{% from "nationalarchives/components/card/macro.njk" import tnaCard %}
|
3
|
+
|
4
|
+
{% set exampleCard = {
|
5
|
+
heading: {
|
6
|
+
title: "Card title",
|
7
|
+
level: 3,
|
8
|
+
size: "m",
|
9
|
+
singleSentence: true
|
10
|
+
},
|
11
|
+
href: "#",
|
12
|
+
image: {
|
13
|
+
src: "https://picsum.photos/id/29/640/360",
|
14
|
+
alt: "A placeholder image"
|
15
|
+
},
|
16
|
+
body: "<p>Card body</p>"
|
17
|
+
} %}
|
18
|
+
|
19
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
20
|
+
{%- set containerClasses = containerClasses.concat('tna-featured-collection') -%}
|
21
|
+
|
22
|
+
{{ tnaGrid({
|
23
|
+
columns: [
|
24
|
+
{
|
25
|
+
width: "full",
|
26
|
+
widthMedium: "full",
|
27
|
+
widthSmall: "full",
|
28
|
+
widthTiny: "full",
|
29
|
+
html: "<h2 class=\"tna-heading\">" + params.heading + "</h2>"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
width: "1-2",
|
33
|
+
widthMedium: "2-3",
|
34
|
+
widthSmall: "1-2",
|
35
|
+
widthTiny: "full",
|
36
|
+
html: tnaCard({
|
37
|
+
heading: {
|
38
|
+
title: "Card title",
|
39
|
+
level: 3,
|
40
|
+
size: "m",
|
41
|
+
singleSentence: true
|
42
|
+
},
|
43
|
+
href: "#",
|
44
|
+
image: {
|
45
|
+
src: "https://picsum.photos/id/29/640/360",
|
46
|
+
alt: "A placeholder image",
|
47
|
+
label: "Feature"
|
48
|
+
},
|
49
|
+
body: "<p>Card body</p>"
|
50
|
+
})
|
51
|
+
},
|
52
|
+
{
|
53
|
+
width: "1-2",
|
54
|
+
widthMedium: "1-3",
|
55
|
+
widthSmall: "1-2",
|
56
|
+
widthTiny: "full",
|
57
|
+
html: tnaGrid({
|
58
|
+
columns: [
|
59
|
+
{
|
60
|
+
width: "1-2",
|
61
|
+
widthMedium: "full",
|
62
|
+
widthSmall: "full",
|
63
|
+
widthTiny: "full",
|
64
|
+
html: tnaCard(exampleCard)
|
65
|
+
},
|
66
|
+
{
|
67
|
+
width: "1-2",
|
68
|
+
widthMedium: "full",
|
69
|
+
widthSmall: "full",
|
70
|
+
widthTiny: "full",
|
71
|
+
html: tnaCard(exampleCard)
|
72
|
+
},
|
73
|
+
{
|
74
|
+
width: "1-2",
|
75
|
+
widthMedium: "full",
|
76
|
+
widthSmall: "full",
|
77
|
+
widthTiny: "full",
|
78
|
+
html: tnaCard(exampleCard)
|
79
|
+
},
|
80
|
+
{
|
81
|
+
width: "1-2",
|
82
|
+
widthMedium: "full",
|
83
|
+
widthSmall: "full",
|
84
|
+
widthTiny: "full",
|
85
|
+
html: tnaCard(exampleCard)
|
86
|
+
}
|
87
|
+
],
|
88
|
+
noPadding: true
|
89
|
+
}),
|
90
|
+
noPadding: true
|
91
|
+
}
|
92
|
+
],
|
93
|
+
htmlElement: "section",
|
94
|
+
classes: containerClasses | join(' '),
|
95
|
+
attributes: params.attributes
|
96
|
+
}) }}
|
@@ -8,9 +8,10 @@ import { Meta } from "@storybook/blocks";
|
|
8
8
|
|
9
9
|
1. Create a new directory in `src/nationalarchives/components`
|
10
10
|
1. Create an `_index.scss`, `fixtures.json`, `macro-options.json`, `macro.njk`, `template.njk` and a `[myComponent].stories.js` in the directory using other components as a guide
|
11
|
-
1. Add the component SCSS to src/nationalarchives/components/_all.scss
|
11
|
+
1. Add the component SCSS to `src/nationalarchives/components/_all.scss`
|
12
12
|
1. Update `tasks/test-package.js` to check for the files as part of the CI (`...componentFiles("myComponent", true)` where `true` ignores the check for any JavaScript files)
|
13
13
|
1. Set the macro in `macro.njk` to be `tnaMyComponent` where "MyComponent" is the name of your component
|
14
|
+
1. Add the component import and macro to the prototype kit test in `.github/workflows/ci.yml`
|
14
15
|
|
15
16
|
### Files
|
16
17
|
|
@@ -0,0 +1,189 @@
|
|
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";
|
9
|
+
|
10
|
+
const argTypes = {
|
11
|
+
theme: {
|
12
|
+
control: "radio",
|
13
|
+
options: [
|
14
|
+
"system",
|
15
|
+
"light",
|
16
|
+
"dark",
|
17
|
+
"light high-contrast",
|
18
|
+
"dark high-contrast",
|
19
|
+
],
|
20
|
+
},
|
21
|
+
};
|
22
|
+
|
23
|
+
export default {
|
24
|
+
title: "Experimental/Utilities/Colour themes",
|
25
|
+
argTypes,
|
26
|
+
};
|
27
|
+
|
28
|
+
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
|
+
return `<div class="tna-template ${
|
34
|
+
theme === "system"
|
35
|
+
? "tna-template--system-theme"
|
36
|
+
: theme === "light"
|
37
|
+
? "tna-template--light-theme"
|
38
|
+
: theme === "dark"
|
39
|
+
? "tna-template--dark-theme"
|
40
|
+
: theme === "light high-contrast"
|
41
|
+
? "tna-template--light-theme tna-template--high-contrast-theme"
|
42
|
+
: theme === "dark high-contrast"
|
43
|
+
? "tna-template--dark-theme tna-template--high-contrast-theme"
|
44
|
+
: ""
|
45
|
+
}">
|
46
|
+
<div class="tna-template__body tna-template__body--padded">
|
47
|
+
${Header({
|
48
|
+
params: {
|
49
|
+
navigation: [
|
50
|
+
{
|
51
|
+
text: "Alpha",
|
52
|
+
href: "#/alpha",
|
53
|
+
selected: true,
|
54
|
+
},
|
55
|
+
{
|
56
|
+
text: "Beta",
|
57
|
+
href: "#/beta",
|
58
|
+
},
|
59
|
+
{
|
60
|
+
text: "Gamma",
|
61
|
+
href: "#/gamma",
|
62
|
+
},
|
63
|
+
],
|
64
|
+
colour: "yellow",
|
65
|
+
},
|
66
|
+
})}
|
67
|
+
${Breadcrumbs({
|
68
|
+
params: {
|
69
|
+
items: [
|
70
|
+
{
|
71
|
+
text: "Alpha",
|
72
|
+
href: "#/alpha",
|
73
|
+
},
|
74
|
+
{
|
75
|
+
text: "Beta",
|
76
|
+
href: "#/beta",
|
77
|
+
},
|
78
|
+
{
|
79
|
+
text: "Gamma",
|
80
|
+
href: "#/gamma",
|
81
|
+
},
|
82
|
+
{
|
83
|
+
text: "Delta",
|
84
|
+
href: "#/delta",
|
85
|
+
},
|
86
|
+
{
|
87
|
+
text: "Epsilon",
|
88
|
+
href: "#/epsilon",
|
89
|
+
},
|
90
|
+
],
|
91
|
+
},
|
92
|
+
})}
|
93
|
+
<article>
|
94
|
+
${Hero({
|
95
|
+
params: {
|
96
|
+
heading: "Title",
|
97
|
+
image: {
|
98
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
99
|
+
alt: "The National Archives office",
|
100
|
+
width: 1996,
|
101
|
+
height: 1331,
|
102
|
+
},
|
103
|
+
classes: "tna-hero--demo",
|
104
|
+
},
|
105
|
+
})}
|
106
|
+
<div class="tna-container">
|
107
|
+
<div class="tna-column tna-column--full">
|
108
|
+
<hgroup class="tna-hgroup tna-hgroup--l">
|
109
|
+
<p class="tna-hgroup__supertitle">TNA colour theme</p>
|
110
|
+
<h2 class="tna-hgroup__title">Heading</h2>
|
111
|
+
</hgroup>
|
112
|
+
<hr>
|
113
|
+
<p class="tna-p">Lorem ipsum <a href="#">link</a></p>
|
114
|
+
<ul class="tna-ul">
|
115
|
+
<li>Alpha</li>
|
116
|
+
<li>Beta</li>
|
117
|
+
<li>Gamma</li>
|
118
|
+
</ul>
|
119
|
+
<a href="#" class="tna-button">Primary button</a>
|
120
|
+
<a href="#" class="tna-button tna-button--secondary">Secondary button</a>
|
121
|
+
<hr>
|
122
|
+
${Card({
|
123
|
+
params: {
|
124
|
+
heading: {
|
125
|
+
supertitle: "Card supertitle",
|
126
|
+
title: "Card title",
|
127
|
+
level: 3,
|
128
|
+
size: "m",
|
129
|
+
singleSentence: false,
|
130
|
+
},
|
131
|
+
href: "#",
|
132
|
+
image: {
|
133
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
134
|
+
alt: "The National Archives office",
|
135
|
+
width: 1996,
|
136
|
+
height: 1331,
|
137
|
+
},
|
138
|
+
body: "<p>Card body</p>",
|
139
|
+
classes: "tna-card--demo",
|
140
|
+
},
|
141
|
+
})}
|
142
|
+
${Tabs({
|
143
|
+
params: {
|
144
|
+
title: "Example tabs",
|
145
|
+
items: [
|
146
|
+
{
|
147
|
+
id: "unique-id-a",
|
148
|
+
title: "Alpha section",
|
149
|
+
body: "<h2>Alpha title</h2><p>Lorem ipsum</p>",
|
150
|
+
},
|
151
|
+
{
|
152
|
+
id: "unique-id-b",
|
153
|
+
title: "Beta section",
|
154
|
+
body: "<h2>Beta title</h2><p>Lorem ipsum</p>",
|
155
|
+
},
|
156
|
+
{
|
157
|
+
id: "unique-id-c",
|
158
|
+
title: "Gamma section",
|
159
|
+
body: "<h2>Gamma title</h2><p>Lorem ipsum</p>",
|
160
|
+
},
|
161
|
+
],
|
162
|
+
classes: "tna-tabs--demo",
|
163
|
+
},
|
164
|
+
})}
|
165
|
+
${Picture({
|
166
|
+
params: {
|
167
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
168
|
+
alt: "The National Archives office",
|
169
|
+
width: 1996,
|
170
|
+
height: 1331,
|
171
|
+
caption: "<p>This is a pretty image</p>",
|
172
|
+
transcript: "<p>Lorem ipsum transcript</p>",
|
173
|
+
translation: "<p>Lorem ipsum translation</p>",
|
174
|
+
classes: "tna-picture--demo",
|
175
|
+
},
|
176
|
+
})}
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
<article>
|
180
|
+
${Footer({})}
|
181
|
+
</div>
|
182
|
+
</div>`;
|
183
|
+
};
|
184
|
+
|
185
|
+
export const Examples = Template.bind({});
|
186
|
+
// Examples.parameters = { options: { showPanel: false } };
|
187
|
+
Examples.args = {
|
188
|
+
theme: "system",
|
189
|
+
};
|
@@ -31,6 +31,7 @@ In the second example, the heading will be read as two separate sentences; `Reco
|
|
31
31
|
## General typography
|
32
32
|
|
33
33
|
<Canvas of={TypographyStories.Paragraph} />
|
34
|
+
<Canvas of={TypographyStories.Blockquote} />
|
34
35
|
<Canvas of={ListStories.UnorderedList} />
|
35
36
|
<Canvas of={ListStories.UnorderedListPlain} />
|
36
37
|
<Canvas of={ListStories.OrderedList} />
|
@@ -12,3 +12,18 @@ export const Paragraph = ParagraphTemplate.bind({});
|
|
12
12
|
Paragraph.args = {
|
13
13
|
text: "This is some body text",
|
14
14
|
};
|
15
|
+
|
16
|
+
const BlockquoteTemplate = ({
|
17
|
+
html,
|
18
|
+
author,
|
19
|
+
}) => `<blockquote class="tna-blockquote">
|
20
|
+
<div class="tna-blockquote__quote">
|
21
|
+
${html}
|
22
|
+
</div>
|
23
|
+
<p class="tna-blockquote__author">${author}</p>
|
24
|
+
</p>`;
|
25
|
+
export const Blockquote = BlockquoteTemplate.bind({});
|
26
|
+
Blockquote.args = {
|
27
|
+
html: "<p>A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.</p>",
|
28
|
+
author: "Douglas Adams, Mostly Harmless",
|
29
|
+
};
|
@@ -1,7 +1,7 @@
|
|
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
|
4
|
+
<html lang="{{ htmlLang | default('en') }}" class="tna-template {{ htmlClasses }}">
|
5
5
|
<head>
|
6
6
|
<meta charset="utf-8">
|
7
7
|
<title{% if pageTitleLang %} lang="{{ pageTitleLang }}"{% endif %}>{% block pageTitle %}The National Archives{% endblock %}</title>
|
@@ -0,0 +1,129 @@
|
|
1
|
+
@use "sass:map";
|
2
|
+
@use "../features";
|
3
|
+
@use "../variables/colour";
|
4
|
+
|
5
|
+
@mixin colour-css-vars() {
|
6
|
+
@each $name, $value in colour.$colour-palette-default {
|
7
|
+
--#{$name}: #{$value};
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@mixin colour-css-vars-dark() {
|
12
|
+
@each $name, $value in colour.$colour-palette-dark {
|
13
|
+
--#{$name}: #{$value};
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
@mixin colour-css-vars-high-contrast() {
|
18
|
+
@each $name, $value in colour.$colour-palette-high-contrast {
|
19
|
+
--#{$name}: #{$value};
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
@mixin colour-css-vars-high-contrast-dark() {
|
24
|
+
@each $name, $value in colour.$colour-palette-high-contrast-dark {
|
25
|
+
--#{$name}: #{$value};
|
26
|
+
}
|
27
|
+
}
|
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
|
+
}
|
38
|
+
}
|
39
|
+
|
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
|
+
}
|
49
|
+
}
|
50
|
+
|
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
|
+
}
|
60
|
+
}
|
61
|
+
|
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
|
+
}
|
71
|
+
}
|
72
|
+
|
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
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
@mixin fixed {
|
85
|
+
@include colour-css-vars;
|
86
|
+
|
87
|
+
@include colour-font("font-base");
|
88
|
+
}
|
89
|
+
|
90
|
+
@mixin invert {
|
91
|
+
.tna-template--system-theme & {
|
92
|
+
@include colour-css-vars-dark;
|
93
|
+
|
94
|
+
@media (prefers-color-scheme: dark) {
|
95
|
+
@include colour-css-vars;
|
96
|
+
}
|
97
|
+
|
98
|
+
@media (prefers-contrast: more) {
|
99
|
+
@include colour-css-vars-high-contrast-dark;
|
100
|
+
}
|
101
|
+
|
102
|
+
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
|
103
|
+
@include colour-css-vars-high-contrast;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
.tna-template--light-theme & {
|
108
|
+
@include colour-css-vars-dark;
|
109
|
+
}
|
110
|
+
|
111
|
+
.tna-template--dark-theme & {
|
112
|
+
@include colour-css-vars;
|
113
|
+
}
|
114
|
+
|
115
|
+
.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
|
+
@include colour-css-vars-high-contrast;
|
121
|
+
}
|
122
|
+
|
123
|
+
@include colour-font("font-base", true);
|
124
|
+
@include colour-background("page-background", true);
|
125
|
+
}
|
126
|
+
|
127
|
+
%tna-invert {
|
128
|
+
@include invert;
|
129
|
+
}
|
@@ -52,7 +52,7 @@
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
55
|
-
@for $i from 1 through
|
55
|
+
@for $i from 1 through 3 {
|
56
56
|
&--flex-#{$i}#{$suffix} {
|
57
57
|
width: auto;
|
58
58
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
}
|
61
61
|
}
|
62
62
|
|
63
|
-
@for $i from 1 through
|
63
|
+
@for $i from 1 through 4 {
|
64
64
|
&--order-#{$i}#{$suffix} {
|
65
65
|
order: $i;
|
66
66
|
}
|
@@ -4,3 +4,18 @@
|
|
4
4
|
@mixin relative-font-size($fontSizePx) {
|
5
5
|
font-size: #{math.div($fontSizePx, typography.$base-font-size-px)}rem;
|
6
6
|
}
|
7
|
+
|
8
|
+
@mixin main-font {
|
9
|
+
font-family: typography.$font-family-main;
|
10
|
+
font-weight: typography.$font-weight-main;
|
11
|
+
}
|
12
|
+
|
13
|
+
@mixin heading-font {
|
14
|
+
font-family: typography.$font-family-heading;
|
15
|
+
font-weight: typography.$font-weight-heading;
|
16
|
+
}
|
17
|
+
|
18
|
+
@mixin detail-font {
|
19
|
+
font-family: typography.$font-family-detail;
|
20
|
+
font-weight: typography.$font-weight-detail;
|
21
|
+
}
|
@@ -1,26 +1,24 @@
|
|
1
1
|
@use "../features";
|
2
|
-
@use "../
|
2
|
+
@use "../tools/colour";
|
3
3
|
@use "../variables/typography";
|
4
4
|
|
5
5
|
:root {
|
6
6
|
@include colour.colour-css-vars;
|
7
7
|
|
8
|
-
@
|
9
|
-
@
|
10
|
-
|
11
|
-
}
|
8
|
+
@media (prefers-color-scheme: dark) {
|
9
|
+
@include colour.colour-css-vars-dark;
|
10
|
+
}
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
@media (prefers-contrast: more) {
|
13
|
+
@include colour.colour-css-vars-high-contrast;
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
}
|
15
|
+
* {
|
16
|
+
background-image: none !important;
|
19
17
|
}
|
18
|
+
}
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
}
|
20
|
+
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
|
21
|
+
@include colour.colour-css-vars-high-contrast-dark;
|
24
22
|
}
|
25
23
|
}
|
26
24
|
|
@@ -37,49 +35,67 @@
|
|
37
35
|
|
38
36
|
@include colour.colour-background("page-background");
|
39
37
|
|
40
|
-
&--
|
41
|
-
|
42
|
-
}
|
38
|
+
// &--black-accent {
|
39
|
+
// accent-color: colour.$_tna-black;
|
40
|
+
// }
|
43
41
|
|
44
|
-
&--yellow-accent {
|
45
|
-
|
46
|
-
}
|
42
|
+
// &--yellow-accent {
|
43
|
+
// accent-color: colour.$_tna-yellow;
|
44
|
+
// }
|
47
45
|
|
48
|
-
&--pink-accent {
|
49
|
-
|
50
|
-
}
|
46
|
+
// &--pink-accent {
|
47
|
+
// accent-color: colour.$_tna-pink;
|
48
|
+
// }
|
51
49
|
|
52
|
-
&--orange-accent {
|
53
|
-
|
54
|
-
}
|
50
|
+
// &--orange-accent {
|
51
|
+
// accent-color: colour.$_tna-orange;
|
52
|
+
// }
|
55
53
|
|
56
|
-
&--green-accent {
|
57
|
-
|
58
|
-
}
|
54
|
+
// &--green-accent {
|
55
|
+
// accent-color: colour.$_tna-green;
|
56
|
+
// }
|
59
57
|
|
60
|
-
&--blue-accent {
|
61
|
-
|
62
|
-
}
|
58
|
+
// &--blue-accent {
|
59
|
+
// accent-color: colour.$_tna-blue;
|
60
|
+
// }
|
63
61
|
|
64
|
-
|
65
|
-
|
66
|
-
@include colour.colour-css-vars;
|
67
|
-
}
|
62
|
+
/* &--system-theme {
|
63
|
+
@include colour.colour-css-vars;
|
68
64
|
|
69
|
-
|
65
|
+
@media (prefers-color-scheme: dark) {
|
70
66
|
@include colour.colour-css-vars-dark;
|
71
67
|
}
|
72
68
|
|
73
|
-
|
69
|
+
@media (prefers-contrast: more) {
|
74
70
|
@include colour.colour-css-vars-high-contrast;
|
75
71
|
|
76
72
|
* {
|
77
73
|
background-image: none !important;
|
78
74
|
}
|
75
|
+
}
|
79
76
|
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
|
78
|
+
@include colour.colour-css-vars-high-contrast-dark;
|
79
|
+
}
|
80
|
+
} */
|
81
|
+
|
82
|
+
&--light-theme {
|
83
|
+
@include colour.colour-css-vars;
|
84
|
+
}
|
85
|
+
|
86
|
+
&--dark-theme {
|
87
|
+
@include colour.colour-css-vars-dark;
|
88
|
+
}
|
89
|
+
|
90
|
+
&--high-contrast-theme {
|
91
|
+
@include colour.colour-css-vars-high-contrast;
|
92
|
+
|
93
|
+
* {
|
94
|
+
background-image: none !important;
|
95
|
+
}
|
96
|
+
|
97
|
+
&.tna-template--dark-theme {
|
98
|
+
@include colour.colour-css-vars-high-contrast-dark;
|
83
99
|
}
|
84
100
|
}
|
85
101
|
|
@@ -96,7 +112,7 @@
|
|
96
112
|
margin: 0;
|
97
113
|
padding: 0;
|
98
114
|
|
99
|
-
// background-
|
115
|
+
// @include colour.colour-background("page-background");
|
100
116
|
|
101
117
|
overflow: auto;
|
102
118
|
}
|
@@ -126,6 +142,14 @@ canvas {
|
|
126
142
|
outline-offset: 0.125rem;
|
127
143
|
}
|
128
144
|
|
145
|
+
hr {
|
146
|
+
margin: 1rem;
|
147
|
+
|
148
|
+
border-width: 1px 0 0;
|
149
|
+
@include colour.colour-border("keyline");
|
150
|
+
border-style: solid;
|
151
|
+
}
|
152
|
+
|
129
153
|
.tna-visually-hidden {
|
130
154
|
width: 1px !important;
|
131
155
|
height: 1px !important;
|