@nationalarchives/frontend 0.1.15-prerelease → 0.1.16-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/LICENCE +21 -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/components/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +11 -39
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +8 -4
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +9 -30
- package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
- package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
- package/nationalarchives/components/breadcrumbs/template.njk +17 -12
- package/nationalarchives/components/button/_index.scss +1 -2
- package/nationalarchives/components/button/button.stories.js +2 -3
- package/nationalarchives/components/card/_index.scss +10 -9
- package/nationalarchives/components/card/card.stories.js +67 -5
- package/nationalarchives/components/card/fixtures.json +13 -0
- package/nationalarchives/components/card/macro-options.json +0 -6
- package/nationalarchives/components/card/template.njk +1 -1
- package/nationalarchives/components/filters/filters.stories.js +3 -4
- package/nationalarchives/components/footer/_index.scss +5 -16
- package/nationalarchives/components/footer/footer.stories.js +2 -3
- package/nationalarchives/components/grid/_index.scss +2 -2
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/header/_index.scss +17 -19
- package/nationalarchives/components/header/header.stories.js +2 -3
- package/nationalarchives/components/hero/_index.scss +3 -7
- package/nationalarchives/components/hero/hero.stories.js +2 -3
- package/nationalarchives/components/index-grid/_index.scss +1 -2
- package/nationalarchives/components/index-grid/index-grid.stories.js +2 -3
- package/nationalarchives/components/message/_index.scss +4 -6
- package/nationalarchives/components/message/phase-banner.stories.js +2 -3
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
- package/nationalarchives/components/picture/_index.scss +3 -5
- package/nationalarchives/components/picture/picture.stories.js +2 -3
- package/nationalarchives/components/profile/profile.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
- package/nationalarchives/components/skip-link/_index.scss +63 -0
- package/nationalarchives/components/skip-link/fixtures.json +11 -0
- package/nationalarchives/components/skip-link/macro-options.json +26 -0
- package/nationalarchives/components/skip-link/macro.njk +3 -0
- package/nationalarchives/components/skip-link/skip-link.stories.js +31 -0
- package/nationalarchives/components/skip-link/template.njk +4 -0
- package/nationalarchives/components/tabs/_index.scss +1 -2
- package/nationalarchives/components/tabs/tabs.stories.js +2 -3
- package/nationalarchives/patterns/featured-collection/_index.scss +2 -2
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +2 -3
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +19 -2
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +8 -14
- package/nationalarchives/templates/layouts/_generic.njk +10 -8
- package/nationalarchives/tools/_colour.scss +87 -18
- package/nationalarchives/tools/_index.scss +0 -1
- package/nationalarchives/utilities/_debug.scss +41 -1
- package/nationalarchives/utilities/_global.scss +5 -0
- package/nationalarchives/utilities/_overrides.scss +17 -4
- package/nationalarchives/utilities/_typography.scss +6 -7
- package/nationalarchives/variables/_colour.scss +78 -84
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_index.scss +0 -1
- package/nationalarchives/variables/_media.scss +23 -23
- package/nationalarchives/variables/_spacing.scss +10 -2
- package/package.json +2 -2
- package/nationalarchives/tools/_assets.scss +0 -5
- package/nationalarchives/variables/_assets.scss +0 -1
@@ -1,4 +1,5 @@
|
|
1
1
|
@use "../variables/spacing";
|
2
|
+
@use "../tools/media";
|
2
3
|
|
3
4
|
@each $property in margin, padding {
|
4
5
|
@each $direction in top, bottom {
|
@@ -6,12 +7,24 @@
|
|
6
7
|
.tna-\!--no-#{$property}-vertical {
|
7
8
|
#{$property}-#{$direction}: 0 !important;
|
8
9
|
}
|
10
|
+
}
|
11
|
+
}
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
@mixin overrides($spacing) {
|
14
|
+
@each $property in margin, padding {
|
15
|
+
@each $direction in top, bottom {
|
16
|
+
@each $size, $amount in $spacing {
|
17
|
+
.tna-\!--#{$property}-#{$direction}-#{$size},
|
18
|
+
.tna-\!--#{$property}-vertical-#{$size} {
|
19
|
+
#{$property}-#{$direction}: #{$amount}rem !important;
|
20
|
+
}
|
14
21
|
}
|
15
22
|
}
|
16
23
|
}
|
17
24
|
}
|
25
|
+
|
26
|
+
@include overrides(spacing.$spacing);
|
27
|
+
|
28
|
+
@include media.on-mobile {
|
29
|
+
@include overrides(spacing.$spacing-mobile);
|
30
|
+
}
|
@@ -198,20 +198,19 @@ a {
|
|
198
198
|
margin: 0 0 2rem;
|
199
199
|
padding: 1rem 1rem 1rem 2rem;
|
200
200
|
|
201
|
-
border
|
202
|
-
@include colour.colour-border("keyline");
|
201
|
+
@include colour.colour-border("keyline", 0.35rem, solid, left);
|
203
202
|
|
204
|
-
quotes: "“" "”" "‘" "’";
|
203
|
+
// quotes: "“" "”" "‘" "’";
|
205
204
|
|
206
205
|
&:last-child {
|
207
206
|
margin-bottom: 0;
|
208
207
|
}
|
209
208
|
|
210
|
-
&::before {
|
211
|
-
|
209
|
+
// &::before {
|
210
|
+
// float: left;
|
212
211
|
|
213
|
-
|
214
|
-
}
|
212
|
+
// content: open-quote;
|
213
|
+
// }
|
215
214
|
|
216
215
|
&__quote {
|
217
216
|
font-weight: 700;
|
@@ -1,80 +1,70 @@
|
|
1
1
|
@use "sass:map";
|
2
2
|
@use "../features";
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
$colour-palette-brand: (
|
5
|
+
"black": #000,
|
6
|
+
"grey": #8c9694,
|
7
|
+
"light-grey": #d9d9d6,
|
8
|
+
"white": #fff,
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
"yellow": #fc0,
|
11
|
+
"pink": #fe1d57,
|
12
|
+
"orange": #fd3f03,
|
13
|
+
"green": #86bc25,
|
14
|
+
"blue": #00b0ff,
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
"brown": #654e37,
|
17
|
+
"maroon": #9c193a,
|
18
|
+
"chestnut": #8f3415,
|
19
|
+
"forest": #00623b,
|
20
|
+
"navy": #004c7e,
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
"cream": #f9f7e2,
|
23
|
+
"pastel-pink": #fad3d4,
|
24
|
+
"pastel-orange": #f9e1bc,
|
25
|
+
"pastel-green": #dde5d5,
|
26
|
+
"pastel-blue": #d4e5ef,
|
27
|
+
);
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
$dark-grey: #26262a;
|
30
|
+
$base-font: #343338;
|
29
31
|
|
30
|
-
$-accent-colour-default:
|
32
|
+
$-accent-colour-default: map.get($colour-palette-brand, "yellow");
|
31
33
|
$-accent-colour-default-dark: $-accent-colour-default;
|
32
34
|
|
33
|
-
// TODO: Scoped variables should not be used directly outside of this file
|
34
|
-
$tna-black: $-tna-black;
|
35
|
-
$dark-grey: $-dark-grey;
|
36
|
-
$tna-yellow: $-tna-yellow;
|
37
|
-
$tna-pink: $-tna-pink;
|
38
|
-
$tna-orange: $-tna-orange;
|
39
|
-
$tna-green: $-tna-green;
|
40
|
-
$tna-forest: $-tna-forest;
|
41
|
-
$tna-blue: $-tna-blue;
|
42
|
-
$tna-cream: $-tna-cream;
|
43
|
-
$tna-white: $-tna-white;
|
44
|
-
|
45
35
|
/*
|
46
36
|
=========================================
|
47
|
-
LIGHT
|
37
|
+
LIGHT THEME (DEFAULT)
|
48
38
|
=========================================
|
49
39
|
*/
|
50
40
|
$colour-palette-default: (
|
51
|
-
"page-background":
|
52
|
-
"font-base":
|
53
|
-
"font-dark":
|
54
|
-
"font-light": rgba(
|
41
|
+
"page-background": map.get($colour-palette-brand, "white"),
|
42
|
+
"font-base": $base-font,
|
43
|
+
"font-dark": map.get($colour-palette-brand, "black"),
|
44
|
+
"font-light": rgba($base-font, 0.7),
|
55
45
|
"link": #1d70ab,
|
56
46
|
"link-visited": #4c2c92,
|
57
47
|
// "focus-outline": #004c7e, // Old value
|
58
|
-
"focus-outline":
|
48
|
+
"focus-outline": map.get($colour-palette-brand, "blue"),
|
59
49
|
"keyline": #ccc,
|
60
|
-
"keyline-dark":
|
50
|
+
"keyline-dark": $dark-grey,
|
61
51
|
"accent-default": $-accent-colour-default,
|
62
|
-
"button-primary-text":
|
63
|
-
"button-primary-background":
|
64
|
-
"button-primary-hover-text":
|
65
|
-
"button-primary-hover-background":
|
66
|
-
"button-secondary-text":
|
67
|
-
"button-secondary-background":
|
68
|
-
"button-secondary-hover-text":
|
69
|
-
"button-secondary-hover-background":
|
70
|
-
"contrast-background":
|
71
|
-
"contrast-font-base":
|
72
|
-
"contrast-font-dark":
|
73
|
-
"contrast-font-light": rgba(
|
74
|
-
"contrast-link":
|
52
|
+
"button-primary-text": map.get($colour-palette-brand, "white"),
|
53
|
+
"button-primary-background": map.get($colour-palette-brand, "black"),
|
54
|
+
"button-primary-hover-text": map.get($colour-palette-brand, "black"),
|
55
|
+
"button-primary-hover-background": map.get($colour-palette-brand, "white"),
|
56
|
+
"button-secondary-text": map.get($colour-palette-brand, "black"),
|
57
|
+
"button-secondary-background": map.get($colour-palette-brand, "yellow"),
|
58
|
+
"button-secondary-hover-text": map.get($colour-palette-brand, "black"),
|
59
|
+
"button-secondary-hover-background": map.get($colour-palette-brand, "white"),
|
60
|
+
"contrast-background": $dark-grey,
|
61
|
+
"contrast-font-base": map.get($colour-palette-brand, "white"),
|
62
|
+
"contrast-font-dark": map.get($colour-palette-brand, "white"),
|
63
|
+
"contrast-font-light": rgba(map.get($colour-palette-brand, "white"), 0.7),
|
64
|
+
"contrast-link": map.get($colour-palette-brand, "blue"),
|
75
65
|
"contrast-link-visited": #b9f,
|
76
|
-
"contrast-keyline": rgba(
|
77
|
-
"contrast-keyline-dark": rgba(
|
66
|
+
"contrast-keyline": rgba(map.get($colour-palette-brand, "white"), 0.5),
|
67
|
+
"contrast-keyline-dark": rgba(map.get($colour-palette-brand, "white"), 0.8),
|
78
68
|
);
|
79
69
|
|
80
70
|
/*
|
@@ -86,13 +76,13 @@ $colour-palette-dark: map.merge(
|
|
86
76
|
$colour-palette-default,
|
87
77
|
(
|
88
78
|
"page-background": #222,
|
89
|
-
"font-base": rgba(
|
90
|
-
"font-dark":
|
91
|
-
"font-light": rgba(
|
92
|
-
"link":
|
79
|
+
"font-base": rgba(map.get($colour-palette-brand, "white"), 0.95),
|
80
|
+
"font-dark": map.get($colour-palette-brand, "white"),
|
81
|
+
"font-light": rgba(map.get($colour-palette-brand, "white"), 0.5),
|
82
|
+
"link": map.get($colour-palette-brand, "blue"),
|
93
83
|
"link-visited": map.get($colour-palette-default, "contrast-link-visited"),
|
94
|
-
"keyline": rgba(
|
95
|
-
"keyline-dark":
|
84
|
+
"keyline": rgba(map.get($colour-palette-brand, "white"), 0.25),
|
85
|
+
"keyline-dark": map.get($colour-palette-brand, "white"),
|
96
86
|
"accent-default": $-accent-colour-default-dark,
|
97
87
|
"contrast-background": #111,
|
98
88
|
"contrast-link-visited":
|
@@ -108,21 +98,21 @@ LIGHT, HIGH_CONTRAST THEME
|
|
108
98
|
$colour-palette-high-contrast: map.merge(
|
109
99
|
$colour-palette-default,
|
110
100
|
(
|
111
|
-
"font-base":
|
112
|
-
"font-light":
|
113
|
-
"link":
|
114
|
-
"link-visited":
|
115
|
-
"focus-outline":
|
116
|
-
"keyline":
|
117
|
-
"keyline-dark":
|
118
|
-
"contrast-background":
|
119
|
-
"contrast-font-base":
|
120
|
-
"contrast-font-dark":
|
121
|
-
"contrast-font-light":
|
122
|
-
"contrast-link":
|
123
|
-
"contrast-link-visited":
|
124
|
-
"contrast-keyline":
|
125
|
-
"contrast-keyline-dark":
|
101
|
+
"font-base": map.get($colour-palette-brand, "black"),
|
102
|
+
"font-light": map.get($colour-palette-brand, "black"),
|
103
|
+
"link": map.get($colour-palette-brand, "navy"),
|
104
|
+
"link-visited": map.get($colour-palette-brand, "black"),
|
105
|
+
"focus-outline": map.get($colour-palette-brand, "orange"),
|
106
|
+
"keyline": map.get($colour-palette-brand, "black"),
|
107
|
+
"keyline-dark": map.get($colour-palette-brand, "black"),
|
108
|
+
"contrast-background": map.get($colour-palette-brand, "white"),
|
109
|
+
"contrast-font-base": map.get($colour-palette-brand, "black"),
|
110
|
+
"contrast-font-dark": map.get($colour-palette-brand, "black"),
|
111
|
+
"contrast-font-light": map.get($colour-palette-brand, "black"),
|
112
|
+
"contrast-link": map.get($colour-palette-brand, "navy"),
|
113
|
+
"contrast-link-visited": map.get($colour-palette-brand, "black"),
|
114
|
+
"contrast-keyline": map.get($colour-palette-brand, "black"),
|
115
|
+
"contrast-keyline-dark": map.get($colour-palette-brand, "black"),
|
126
116
|
)
|
127
117
|
);
|
128
118
|
|
@@ -134,12 +124,16 @@ DARK, HIGH_CONTRAST THEME
|
|
134
124
|
$colour-palette-high-contrast-dark: map.merge(
|
135
125
|
$colour-palette-dark,
|
136
126
|
(
|
137
|
-
"page-background": $
|
138
|
-
"font-base":
|
139
|
-
"font-light":
|
140
|
-
"link":
|
141
|
-
"link-visited":
|
142
|
-
"keyline":
|
143
|
-
"
|
127
|
+
"page-background": map.get($colour-palette-brand, "black"),
|
128
|
+
"font-base": map.get($colour-palette-brand, "white"),
|
129
|
+
"font-light": map.get($colour-palette-brand, "white"),
|
130
|
+
"link": map.get($colour-palette-brand, "white"),
|
131
|
+
"link-visited": map.get($colour-palette-brand, "white"),
|
132
|
+
"keyline": map.get($colour-palette-brand, "white"),
|
133
|
+
"button-primary-text": map.get($colour-palette-brand, "black"),
|
134
|
+
"button-primary-background": map.get($colour-palette-brand, "white"),
|
135
|
+
"button-primary-hover-text": map.get($colour-palette-brand, "white"),
|
136
|
+
"button-primary-hover-background": map.get($colour-palette-brand, "black"),
|
137
|
+
"contrast-background": map.get($colour-palette-brand, "black"),
|
144
138
|
)
|
145
139
|
);
|
@@ -1,40 +1,40 @@
|
|
1
1
|
@use "sass:math";
|
2
2
|
@use "./typography";
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
$-largest-medium-device-px: 1024 !default;
|
5
|
+
$-largest-small-device-px: 768 !default;
|
6
|
+
$-largest-tiny-device-px: 480 !default;
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
$-smallest-large-device-em: #{math.div(
|
9
|
+
$-largest-medium-device-px + 1,
|
10
10
|
typography.$base-font-size-px
|
11
11
|
)}em;
|
12
|
-
|
13
|
-
|
12
|
+
$-largest-medium-device-em: #{math.div(
|
13
|
+
$-largest-medium-device-px,
|
14
14
|
typography.$base-font-size-px
|
15
15
|
)}em;
|
16
|
-
|
17
|
-
|
16
|
+
$-smallest-medium-device-em: #{math.div(
|
17
|
+
$-largest-small-device-px + 1,
|
18
18
|
typography.$base-font-size-px
|
19
19
|
)}em;
|
20
|
-
|
21
|
-
|
20
|
+
$-largest-small-device-em: #{math.div(
|
21
|
+
$-largest-small-device-px,
|
22
22
|
typography.$base-font-size-px
|
23
23
|
)}em;
|
24
|
-
|
25
|
-
|
24
|
+
$-smallest-small-device-em: #{math.div(
|
25
|
+
$-largest-tiny-device-px + 1,
|
26
26
|
typography.$base-font-size-px
|
27
27
|
)}em;
|
28
|
-
|
29
|
-
|
28
|
+
$-largest-tiny-device-em: #{math.div(
|
29
|
+
$-largest-tiny-device-px,
|
30
30
|
typography.$base-font-size-px
|
31
31
|
)}em;
|
32
32
|
|
33
|
-
$media-large: "(min-width: #{
|
34
|
-
$media-lt-large: "(max-width: #{
|
35
|
-
$media-medium: "(min-width: #{
|
36
|
-
$media-gt-mobile: "(min-width: #{
|
37
|
-
$media-mobile: "(max-width: #{
|
38
|
-
$media-small: "(min-width: #{
|
39
|
-
$media-gt-tiny: "(min-width: #{
|
40
|
-
$media-tiny: "(max-width: #{
|
33
|
+
$media-large: "(min-width: #{$-smallest-large-device-em})";
|
34
|
+
$media-lt-large: "(max-width: #{$-largest-medium-device-em})";
|
35
|
+
$media-medium: "(min-width: #{$-smallest-medium-device-em}) and (max-width: #{$-largest-medium-device-em})";
|
36
|
+
$media-gt-mobile: "(min-width: #{$-smallest-medium-device-em})";
|
37
|
+
$media-mobile: "(max-width: #{$-largest-small-device-em})";
|
38
|
+
$media-small: "(min-width: #{$-smallest-small-device-em}) and (max-width: #{$-largest-small-device-em})";
|
39
|
+
$media-gt-tiny: "(min-width: #{$-smallest-small-device-em})";
|
40
|
+
$media-tiny: "(max-width: #{$-largest-tiny-device-em})";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nationalarchives/frontend",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.16-prerelease",
|
4
4
|
"description": "The National Archives frontend styles",
|
5
5
|
"scripts": {
|
6
6
|
"start": "storybook dev -p 6006",
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"test": "node tasks/test-fixtures.js && test-storybook --verbose --stories-json",
|
9
9
|
"lint": "prettier --check '{src,.storybook,tasks}/**/*.{js,mjs,scss,json,html}' && stylelint 'src/**/*.scss' && eslint 'src/**/*.mjs'",
|
10
10
|
"lint:fix": "prettier --write '{src,.storybook,tasks}/**/*.{js,mjs,scss,json,html}' && stylelint --fix 'src/**/*.scss' && eslint --fix 'src/**/*.mjs'",
|
11
|
-
"package:sass": "sass --style=compressed --
|
11
|
+
"package:sass": "sass --style=compressed --embed-sources src/nationalarchives/all.scss package/nationalarchives/all.css",
|
12
12
|
"package:scripts": "webpack"
|
13
13
|
},
|
14
14
|
"repository": {
|
@@ -1 +0,0 @@
|
|
1
|
-
$tna-assets-path: "/assets" !default;
|