govuk_tech_docs 6.1.0 → 6.2.1
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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug.yaml +69 -0
- data/.github/ISSUE_TEMPLATE/config.yaml +6 -0
- data/.github/ISSUE_TEMPLATE/enhancement.yaml +25 -0
- data/.github/dependabot.yml +0 -5
- data/.github/pull_request_template.md +22 -8
- data/.github/workflows/dependency-review.yaml +17 -0
- data/.github/workflows/test.yaml +1 -1
- data/.nvmrc +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -2
- data/example/.ruby-version +1 -1
- data/example/source/code.html.md +1 -0
- data/govuk_tech_docs.gemspec +20 -21
- data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +1 -3
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +8 -4
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -6
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +14 -10
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +5 -2
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +10 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +14 -13
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +38 -70
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +17 -15
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +19 -13
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +48 -26
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +13 -11
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +10 -9
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +7 -2
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +18 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +28 -4
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -16
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +24 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +5 -3
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +3 -1
- data/package-lock.json +1259 -4963
- data/package.json +4 -4
- metadata +69 -93
- data/.github/ISSUE_TEMPLATE.md +0 -13
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
@import "../settings/colours-palette";
|
|
2
|
-
@import "../settings/colours-organisations";
|
|
3
|
-
@import "../settings/warnings";
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
/// @group helpers/colour
|
|
7
3
|
////
|
|
4
|
+
@use "sass:list";
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
@use "sass:string";
|
|
8
|
+
|
|
9
|
+
@import "../settings/colours-functional";
|
|
10
|
+
@import "../settings/colours-palette";
|
|
11
|
+
@import "../settings/colours-organisations";
|
|
12
|
+
@import "../settings/warnings";
|
|
8
13
|
|
|
9
14
|
/// Get a colour from the palette
|
|
10
15
|
///
|
|
@@ -37,11 +42,11 @@
|
|
|
37
42
|
// Sass parses unquoted colours as colours, so we need to turn them into
|
|
38
43
|
// strings before looking them up in the colour palette
|
|
39
44
|
// https://sass-lang.com/documentation/values/strings#unquoted
|
|
40
|
-
@if type-of($colour) != "string" {
|
|
45
|
+
@if meta.type-of($colour) != "string" {
|
|
41
46
|
$colour: "#{$colour}";
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
$colour-variants: map
|
|
49
|
+
$colour-variants: map.get($colours, $colour);
|
|
45
50
|
|
|
46
51
|
@if not $colour-variants {
|
|
47
52
|
// To ease the transition between the brand palette and old GOV.UK Frontend colours
|
|
@@ -53,33 +58,33 @@
|
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
@error "Unknown colour `#{$colour}` (available colours: #{map
|
|
61
|
+
@error "Unknown colour `#{$colour}` (available colours: #{map.keys($colours)})";
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
// Some colours may not have variants, if that's the case, we can return the colour straight away
|
|
60
|
-
@if type-of($colour-variants) == "color" {
|
|
65
|
+
@if meta.type-of($colour-variants) == "color" {
|
|
61
66
|
@return $colour-variants;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
@if type-of($colour-variants) != "map" {
|
|
65
|
-
@error "Colour `#{$colour}` should either be a `map` or `color`, not a `#{type-of($colour-variants)}`";
|
|
69
|
+
@if meta.type-of($colour-variants) != "map" {
|
|
70
|
+
@error "Colour `#{$colour}` should either be a `map` or `color`, not a `#{meta.type-of($colour-variants)}`";
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
$result: map
|
|
73
|
+
$result: map.get($colour-variants, $variant);
|
|
69
74
|
|
|
70
75
|
@if not $result {
|
|
71
|
-
@error "Unknown variant `#{$variant}` for colour `#{$colour}` (available variants: #{map
|
|
76
|
+
@error "Unknown variant `#{$variant}` for colour `#{$colour}` (available variants: #{map.keys($colour-variants)})";
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
@return $result;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
@function _govuk-corresponding-brand-colour($colour) {
|
|
78
|
-
$pre-brand-colour: map
|
|
83
|
+
$pre-brand-colour: map.get($_govuk-pre-brand-colours, $colour);
|
|
79
84
|
|
|
80
85
|
@if $pre-brand-colour {
|
|
81
|
-
$corresponding-colour: nth($pre-brand-colour, 1);
|
|
82
|
-
$corresponding-variant: nth($pre-brand-colour, 2);
|
|
86
|
+
$corresponding-colour: list.nth($pre-brand-colour, 1);
|
|
87
|
+
$corresponding-variant: list.nth($pre-brand-colour, 2);
|
|
83
88
|
|
|
84
89
|
$corresponding-govuk-colour-call: 'govuk-colour("#{$corresponding-colour}", $variant: "#{$corresponding-variant}")';
|
|
85
90
|
|
|
@@ -122,17 +127,17 @@
|
|
|
122
127
|
// Sass parses unquoted colours as colours, so we need to turn them into
|
|
123
128
|
// strings before looking them up in the colour palette
|
|
124
129
|
// https://sass-lang.com/documentation/values/strings#unquoted
|
|
125
|
-
@if type-of($colour) != "string" {
|
|
130
|
+
@if meta.type-of($colour) != "string" {
|
|
126
131
|
$colour: "#{$colour}";
|
|
127
132
|
}
|
|
128
133
|
|
|
129
|
-
@if map
|
|
130
|
-
$value: _govuk-resolve-colour(map
|
|
134
|
+
@if map.has-key($govuk-functional-colours, $colour) {
|
|
135
|
+
$value: _govuk-resolve-colour(map.get($govuk-functional-colours, $colour));
|
|
131
136
|
|
|
132
137
|
@return var(--govuk-#{$colour}-colour, #{$value});
|
|
133
138
|
}
|
|
134
139
|
|
|
135
|
-
@error "Unknown colour `#{$colour}` (available colours: #{map
|
|
140
|
+
@error "Unknown colour `#{$colour}` (available colours: #{map.keys($govuk-functional-colours)})";
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
/// Resolves the given reference to a colour in the palette
|
|
@@ -144,22 +149,22 @@
|
|
|
144
149
|
/// @access private
|
|
145
150
|
@function _govuk-resolve-colour($colour-reference) {
|
|
146
151
|
// If the reference is already a colour, return the colour
|
|
147
|
-
@if type-of($colour-reference) == "color" {
|
|
152
|
+
@if meta.type-of($colour-reference) == "color" {
|
|
148
153
|
@return $colour-reference;
|
|
149
154
|
}
|
|
150
155
|
|
|
151
|
-
@if not type-of($colour-reference) == "map" {
|
|
156
|
+
@if not meta.type-of($colour-reference) == "map" {
|
|
152
157
|
@error 'Colour reference should be a Sass colour or a Sass map';
|
|
153
158
|
}
|
|
154
159
|
|
|
155
|
-
$name: map
|
|
160
|
+
$name: map.get($colour-reference, "name");
|
|
156
161
|
@if not $name or $name == "" {
|
|
157
162
|
@error "Colour reference `name` shouldn't be empty.";
|
|
158
163
|
}
|
|
159
164
|
|
|
160
165
|
$variant: "primary";
|
|
161
|
-
@if map
|
|
162
|
-
$variant: map
|
|
166
|
+
@if map.has-key($colour-reference, "variant") {
|
|
167
|
+
$variant: map.get($colour-reference, "variant");
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
@if not $variant or $variant == "" {
|
|
@@ -169,18 +174,6 @@
|
|
|
169
174
|
@return govuk-colour($name, $variant: $variant);
|
|
170
175
|
}
|
|
171
176
|
|
|
172
|
-
@function _govuk-define-functional-colours($colours, $defaults) {
|
|
173
|
-
$existing-colours: map-keys($defaults);
|
|
174
|
-
|
|
175
|
-
@each $colour-name, $colour in $colours {
|
|
176
|
-
@if not index($existing-colours, $colour-name) {
|
|
177
|
-
@error 'Unknown colour `#{$colour-name}` (available colours: #{$existing-colours})';
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@return map-merge($defaults, $colours);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
177
|
/// Get the colour for a government organisation
|
|
185
178
|
///
|
|
186
179
|
/// @param {String} $organisation - Organisation name, lowercase, hyphenated
|
|
@@ -198,56 +191,31 @@
|
|
|
198
191
|
@function govuk-organisation-colour($organisation, $contrast-safe: true) {
|
|
199
192
|
// Check if the $organisation exists in the aliases map. If so, change the
|
|
200
193
|
// value of $organisation to the aliased value.
|
|
201
|
-
@if map
|
|
202
|
-
$organisation: map
|
|
194
|
+
@if map.has-key($_govuk_colours-organisations-aliases, $organisation) {
|
|
195
|
+
$organisation: map.get($_govuk_colours-organisations-aliases, $organisation);
|
|
203
196
|
}
|
|
204
197
|
|
|
205
198
|
// Check to see if the organisation exists
|
|
206
|
-
@if not map
|
|
199
|
+
@if not map.has-key($govuk-colours-organisations, $organisation) {
|
|
207
200
|
@error "Unknown organisation `#{$organisation}`";
|
|
208
201
|
}
|
|
209
202
|
|
|
210
|
-
$org-colour: map
|
|
203
|
+
$org-colour: map.get($govuk-colours-organisations, $organisation);
|
|
211
204
|
|
|
212
205
|
// If the organisation has a deprecation message associated with it
|
|
213
206
|
// (e.g. it has ceased to exist) then output a warning.
|
|
214
|
-
@if map
|
|
207
|
+
@if map.has-key($org-colour, "deprecation-message") and _should-warn("organisation-colours") {
|
|
215
208
|
@warn _warning-text(
|
|
216
209
|
"organisation-colours",
|
|
217
|
-
map
|
|
210
|
+
map.get($org-colour, "deprecation-message")
|
|
218
211
|
);
|
|
219
212
|
}
|
|
220
213
|
|
|
221
|
-
@if $contrast-safe and map
|
|
222
|
-
@return map
|
|
214
|
+
@if $contrast-safe and map.has-key($org-colour, "contrast-safe") {
|
|
215
|
+
@return map.get($org-colour, "contrast-safe");
|
|
223
216
|
} @else {
|
|
224
|
-
@return map
|
|
217
|
+
@return map.get($org-colour, "colour");
|
|
225
218
|
}
|
|
226
219
|
}
|
|
227
220
|
|
|
228
|
-
/// Converts a colour with potential float values for its RGB channels
|
|
229
|
-
/// into hexadecimal notation
|
|
230
|
-
///
|
|
231
|
-
/// This ensures the colour is rendered properly by Safari < 12
|
|
232
|
-
///
|
|
233
|
-
/// @param {Colour} $colour - The colour to convert
|
|
234
|
-
/// @return {Colour}
|
|
235
|
-
/// @access private
|
|
236
|
-
@function _as-hexadecimal($colour) {
|
|
237
|
-
@if not function-exists(change-color) {
|
|
238
|
-
@return $colour;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// `red`,`green` and `blue` functions are limited to 'legacy' colour spaces
|
|
242
|
-
// ensuring we don't get floating computations on them
|
|
243
|
-
$parts: (
|
|
244
|
-
"red": red($colour),
|
|
245
|
-
"green": green($colour),
|
|
246
|
-
"blue": blue($colour),
|
|
247
|
-
"alpha": alpha($colour)
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
@return change-color($colour, $parts...);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
221
|
/*# sourceMappingURL=_colour.scss.map */
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
// components such as textarea where we avoid changing `border-width` as
|
|
89
89
|
// it will change the element size. Also, `outline` cannot be utilised
|
|
90
90
|
// here as it is already used for the yellow focus state.
|
|
91
|
-
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
|
91
|
+
box-shadow: inset 0 0 0 $govuk-border-width-form-element govuk-functional-colour(input-border);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/*# sourceMappingURL=_focused.scss.map */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group helpers/layout
|
|
3
3
|
////
|
|
4
|
+
@use "sass:map";
|
|
4
5
|
|
|
5
6
|
/// Grid width percentage
|
|
6
7
|
///
|
|
@@ -10,8 +11,8 @@
|
|
|
10
11
|
/// @access public
|
|
11
12
|
|
|
12
13
|
@function govuk-grid-width($key) {
|
|
13
|
-
@if map
|
|
14
|
-
@return map
|
|
14
|
+
@if map.has-key($govuk-grid-widths, $key) {
|
|
15
|
+
@return map.get($govuk-grid-widths, $key);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
@error "Unknown grid width `#{$key}`";
|
|
@@ -224,13 +224,13 @@
|
|
|
224
224
|
|
|
225
225
|
@mixin govuk-link-style-text {
|
|
226
226
|
&:link,
|
|
227
|
-
&:visited
|
|
228
|
-
|
|
227
|
+
&:visited,
|
|
228
|
+
&:active {
|
|
229
|
+
color: govuk-functional-colour(text);
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
&:active,
|
|
232
232
|
&:focus {
|
|
233
|
-
|
|
233
|
+
color: govuk-functional-colour(focus-text);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group helpers/layout
|
|
3
3
|
////
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
@use "sass:string";
|
|
4
8
|
|
|
5
9
|
@import "../settings/media-queries";
|
|
6
10
|
@import "../tools/px-to-em";
|
|
@@ -41,9 +45,9 @@
|
|
|
41
45
|
|
|
42
46
|
@function govuk-breakpoint-value($value, $breakpoints: $govuk-breakpoints) {
|
|
43
47
|
// If $value is a number
|
|
44
|
-
@if type-of($value) == "number" {
|
|
48
|
+
@if meta.type-of($value) == "number" {
|
|
45
49
|
// If the number is unitless, coerce it into a pixel value
|
|
46
|
-
@if unitless($value) {
|
|
50
|
+
@if math.is-unitless($value) {
|
|
47
51
|
$value: $value * 1px;
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -52,8 +56,8 @@
|
|
|
52
56
|
|
|
53
57
|
// If $value is a string and exists as a key in in $breakpoints,
|
|
54
58
|
// look up and use the value of it
|
|
55
|
-
@if type-of($value) == "string" and map
|
|
56
|
-
@return map
|
|
59
|
+
@if meta.type-of($value) == "string" and map.has-key($breakpoints, $value) {
|
|
60
|
+
@return map.get($breakpoints, $value);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
// If we get this far, we can't use the value, so return an error
|
|
@@ -97,7 +101,7 @@
|
|
|
97
101
|
@function govuk-from-breakpoint($from, $breakpoints: $govuk-breakpoints) {
|
|
98
102
|
$value: govuk-breakpoint-value($from, $breakpoints);
|
|
99
103
|
|
|
100
|
-
@if type-of($value) == "number" and unit($value) == "px" {
|
|
104
|
+
@if meta.type-of($value) == "number" and math.unit($value) == "px" {
|
|
101
105
|
$value: govuk-em($value);
|
|
102
106
|
}
|
|
103
107
|
|
|
@@ -142,13 +146,13 @@
|
|
|
142
146
|
@function govuk-until-breakpoint($until, $breakpoints: $govuk-breakpoints) {
|
|
143
147
|
$value: govuk-breakpoint-value($until, $breakpoints);
|
|
144
148
|
|
|
145
|
-
@if type-of($value) == "number" and unit($value) == "px" {
|
|
149
|
+
@if meta.type-of($value) == "number" and math.unit($value) == "px" {
|
|
146
150
|
// If it's a pixel value, convert it to ems.
|
|
147
151
|
$value: govuk-em($value);
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
// If $value derives from a named breakpoint, additionally subtract .01em
|
|
151
|
-
@if type-of($until) != "number" and unit($value) == "em" {
|
|
155
|
+
@if meta.type-of($until) != "number" and math.unit($value) == "em" {
|
|
152
156
|
$value: $value - 0.01em;
|
|
153
157
|
}
|
|
154
158
|
|
|
@@ -191,26 +195,24 @@
|
|
|
191
195
|
|
|
192
196
|
@mixin govuk-media-query($from: null, $until: null, $and: null, $media-type: "all", $breakpoints: $govuk-breakpoints) {
|
|
193
197
|
$media-query: "";
|
|
194
|
-
$min-width: if($from, govuk-from-breakpoint($from, $breakpoints), null);
|
|
195
|
-
$max-width: if($until, govuk-until-breakpoint($until, $breakpoints), null);
|
|
196
198
|
|
|
197
199
|
// Assemble the media query string
|
|
198
200
|
@if $media-type != "all" {
|
|
199
201
|
$media-query: "#{$media-type}";
|
|
200
202
|
}
|
|
201
|
-
@if $
|
|
202
|
-
$media-query: "#{$media-query} and #{$
|
|
203
|
+
@if $from {
|
|
204
|
+
$media-query: "#{$media-query} and #{govuk-from-breakpoint($from, $breakpoints)}";
|
|
203
205
|
}
|
|
204
|
-
@if $
|
|
205
|
-
$media-query: "#{$media-query} and #{$
|
|
206
|
+
@if $until {
|
|
207
|
+
$media-query: "#{$media-query} and #{govuk-until-breakpoint($until, $breakpoints)}";
|
|
206
208
|
}
|
|
207
209
|
@if $and {
|
|
208
210
|
$media-query: "#{$media-query} and #{$and}";
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
// If $media-query currently begins with an orphaned ' and ', remove it.
|
|
212
|
-
@if
|
|
213
|
-
$media-query:
|
|
214
|
+
@if string.index($media-query, " and ") == 1 {
|
|
215
|
+
$media-query: string.slice($media-query, 6);
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
@media #{$media-query} {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@function _govuk-equilateral-height($base) {
|
|
15
15
|
$square-root-of-three: 1.732;
|
|
16
16
|
|
|
17
|
-
@return ($base
|
|
17
|
+
@return ($base * 0.5) * $square-root-of-three;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/// Arrow mixin
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
border-style: solid;
|
|
45
45
|
border-color: transparent; // 1
|
|
46
46
|
|
|
47
|
-
$perpendicular: $base
|
|
47
|
+
$perpendicular: $base * 0.5;
|
|
48
48
|
|
|
49
49
|
@if not $height {
|
|
50
50
|
$height: _govuk-equilateral-height($base);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group helpers/spacing
|
|
3
3
|
////
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
|
|
8
|
+
@import "../tools/if";
|
|
9
|
+
@import "../helpers/media-queries";
|
|
4
10
|
|
|
5
11
|
/// Single point spacing
|
|
6
12
|
///
|
|
@@ -29,7 +35,7 @@
|
|
|
29
35
|
/// @access public
|
|
30
36
|
|
|
31
37
|
@function govuk-spacing($spacing-point) {
|
|
32
|
-
$actual-input-type: type-of($spacing-point);
|
|
38
|
+
$actual-input-type: meta.type-of($spacing-point);
|
|
33
39
|
@if $actual-input-type != "number" {
|
|
34
40
|
@error "Expected a number (integer), but got a "
|
|
35
41
|
+ "#{$actual-input-type}.";
|
|
@@ -38,15 +44,15 @@
|
|
|
38
44
|
$is-negative: false;
|
|
39
45
|
@if $spacing-point < 0 {
|
|
40
46
|
$is-negative: true;
|
|
41
|
-
$spacing-point: abs($spacing-point);
|
|
47
|
+
$spacing-point: math.abs($spacing-point);
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
@if not map
|
|
50
|
+
@if not map.has-key($govuk-spacing-points, $spacing-point) {
|
|
45
51
|
@error "Unknown spacing variable `#{$spacing-point}`. Make sure you are using a point from the spacing scale in `_settings/spacing.scss`.";
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
$value: map
|
|
49
|
-
@return if($is-negative, $value * -1, $value);
|
|
54
|
+
$value: map.get($govuk-spacing-points, $spacing-point);
|
|
55
|
+
@return govuk-if($is-negative, $value * -1, $value);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
/// Responsive spacing
|
|
@@ -75,19 +81,19 @@
|
|
|
75
81
|
$important: false,
|
|
76
82
|
$adjustment: false
|
|
77
83
|
) {
|
|
78
|
-
$actual-input-type: type-of($responsive-spacing-point);
|
|
84
|
+
$actual-input-type: meta.type-of($responsive-spacing-point);
|
|
79
85
|
@if $actual-input-type != "number" {
|
|
80
86
|
@error "Expected a number (integer), but got a " + "#{$actual-input-type}.";
|
|
81
87
|
}
|
|
82
88
|
|
|
83
|
-
@if not map
|
|
89
|
+
@if not map.has-key($govuk-spacing-responsive-scale, $responsive-spacing-point) {
|
|
84
90
|
@error "Unknown spacing point `#{$responsive-spacing-point}`. Make sure you are using a point from the "
|
|
85
91
|
+ "responsive spacing scale in `_settings/spacing.scss`.";
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
// Make sure that the return value from `_settings/spacing.scss` is a map.
|
|
89
|
-
$scale-map: map
|
|
90
|
-
$actual-map-type: type-of($scale-map);
|
|
95
|
+
$scale-map: map.get($govuk-spacing-responsive-scale, $responsive-spacing-point);
|
|
96
|
+
$actual-map-type: meta.type-of($scale-map);
|
|
91
97
|
@if $actual-map-type != "map" {
|
|
92
98
|
@error "Expected a number (integer), but got a "
|
|
93
99
|
+ "#{$actual-map-type}. Make sure you are using a map to set the responsive spacing in `_settings/spacing.scss`)";
|
|
@@ -102,16 +108,16 @@
|
|
|
102
108
|
// The 'null' breakpoint is for mobile.
|
|
103
109
|
@if not $breakpoint {
|
|
104
110
|
@if $direction == all {
|
|
105
|
-
#{$property}: $breakpoint-value if($important, !important
|
|
111
|
+
#{$property}: $breakpoint-value govuk-if($important, !important);
|
|
106
112
|
} @else {
|
|
107
|
-
#{$property}-#{$direction}: $breakpoint-value if($important, !important
|
|
113
|
+
#{$property}-#{$direction}: $breakpoint-value govuk-if($important, !important);
|
|
108
114
|
}
|
|
109
115
|
} @else {
|
|
110
116
|
@media #{govuk-from-breakpoint($breakpoint)} {
|
|
111
117
|
@if $direction == all {
|
|
112
|
-
#{$property}: $breakpoint-value if($important, !important
|
|
118
|
+
#{$property}: $breakpoint-value govuk-if($important, !important);
|
|
113
119
|
} @else {
|
|
114
|
-
#{$property}-#{$direction}: $breakpoint-value if($important, !important
|
|
120
|
+
#{$property}-#{$direction}: $breakpoint-value govuk-if($important, !important);
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group helpers/typography
|
|
3
3
|
////
|
|
4
|
-
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
|
|
8
|
+
@import "../settings/assets";
|
|
9
|
+
@import "../settings/colours-functional";
|
|
10
|
+
@import "../settings/spacing";
|
|
11
|
+
@import "../settings/typography-font";
|
|
12
|
+
@import "../settings/warnings";
|
|
13
|
+
@import "../tools/font-url";
|
|
5
14
|
@import "../tools/px-to-rem";
|
|
15
|
+
@import "../tools/if";
|
|
16
|
+
@import "font-faces";
|
|
17
|
+
@import "media-queries";
|
|
18
|
+
@import "spacing";
|
|
6
19
|
|
|
7
20
|
/// 'Common typography' helper
|
|
8
21
|
///
|
|
@@ -32,14 +45,16 @@
|
|
|
32
45
|
///
|
|
33
46
|
/// Sets the text colour, including a suitable override for print.
|
|
34
47
|
///
|
|
48
|
+
/// @deprecated
|
|
35
49
|
/// @access public
|
|
36
50
|
|
|
37
51
|
@mixin govuk-text-colour {
|
|
38
|
-
|
|
52
|
+
@include _warning(
|
|
53
|
+
"govuk-text-colour",
|
|
54
|
+
"The `govuk-text-colour` mixin is deprecated. Use `color: govuk-colour(text)` instead."
|
|
55
|
+
);
|
|
39
56
|
|
|
40
|
-
|
|
41
|
-
color: govuk-functional-colour(print-text);
|
|
42
|
-
}
|
|
57
|
+
color: govuk-functional-colour(text);
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
/// Regular font weight helper
|
|
@@ -49,7 +64,7 @@
|
|
|
49
64
|
/// @access public
|
|
50
65
|
|
|
51
66
|
@mixin govuk-typography-weight-regular($important: false) {
|
|
52
|
-
font-weight: $govuk-font-weight-regular if($important, !important
|
|
67
|
+
font-weight: $govuk-font-weight-regular govuk-if($important, !important);
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
/// Bold font weight helper
|
|
@@ -59,7 +74,7 @@
|
|
|
59
74
|
/// @access public
|
|
60
75
|
|
|
61
76
|
@mixin govuk-typography-weight-bold($important: false) {
|
|
62
|
-
font-weight: $govuk-font-weight-bold if($important, !important
|
|
77
|
+
font-weight: $govuk-font-weight-bold govuk-if($important, !important);
|
|
63
78
|
}
|
|
64
79
|
|
|
65
80
|
/// Tabular number helper
|
|
@@ -76,7 +91,7 @@
|
|
|
76
91
|
/// @access public
|
|
77
92
|
|
|
78
93
|
@mixin govuk-font-tabular-numbers($important: false) {
|
|
79
|
-
font-variant-numeric: tabular-nums if($important, !important
|
|
94
|
+
font-variant-numeric: tabular-nums govuk-if($important, !important);
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
/// Word break helper
|
|
@@ -90,10 +105,10 @@
|
|
|
90
105
|
|
|
91
106
|
@mixin govuk-text-break-word($important: false) {
|
|
92
107
|
// IE 11 and Edge 16–17 only support the non-standard `word-wrap` property
|
|
93
|
-
word-wrap: break-word if($important, !important
|
|
108
|
+
word-wrap: break-word govuk-if($important, !important);
|
|
94
109
|
|
|
95
110
|
// All other browsers support `overflow-wrap`
|
|
96
|
-
overflow-wrap: break-word if($important, !important
|
|
111
|
+
overflow-wrap: break-word govuk-if($important, !important);
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
/// Convert line-heights specified in pixels into a relative value, unless
|
|
@@ -107,8 +122,8 @@
|
|
|
107
122
|
/// @access private
|
|
108
123
|
|
|
109
124
|
@function _govuk-line-height($line-height, $font-size) {
|
|
110
|
-
@if not unitless($line-height) and unit($line-height) == unit($font-size) {
|
|
111
|
-
$line-height: $line-height
|
|
125
|
+
@if not math.is-unitless($line-height) and math.unit($line-height) == math.unit($font-size) {
|
|
126
|
+
$line-height: math.div($line-height, $font-size);
|
|
112
127
|
}
|
|
113
128
|
|
|
114
129
|
@return $line-height;
|
|
@@ -153,21 +168,21 @@
|
|
|
153
168
|
@mixin govuk-font-size($size, $line-height: false, $important: false) {
|
|
154
169
|
// Flag font sizes that start with underscores so we can suppress warnings on
|
|
155
170
|
// deprecated sizes used internally, for example `govuk-font($size: "_14")`
|
|
156
|
-
$size-internal-use-only:
|
|
171
|
+
$size-internal-use-only: string.slice(#{$size}, 1, 1) == "_";
|
|
157
172
|
|
|
158
173
|
// Remove underscore from font sizes flagged for internal use
|
|
159
174
|
@if $size-internal-use-only {
|
|
160
|
-
$size:
|
|
175
|
+
$size: string.slice(#{$size}, 2);
|
|
161
176
|
}
|
|
162
177
|
|
|
163
178
|
// Check for a font map exactly matching the given size
|
|
164
|
-
$font-map: map
|
|
179
|
+
$font-map: map.get($govuk-typography-scale, $size);
|
|
165
180
|
|
|
166
181
|
// No match? Try with string type (e.g. $size: "16" not 16)
|
|
167
182
|
@if not $font-map {
|
|
168
|
-
@each $font-size in map
|
|
183
|
+
@each $font-size in map.keys($govuk-typography-scale) {
|
|
169
184
|
@if not $font-map and "#{$font-size}" == "#{$size}" {
|
|
170
|
-
$font-map: map
|
|
185
|
+
$font-map: map.get($govuk-typography-scale, $font-size);
|
|
171
186
|
}
|
|
172
187
|
}
|
|
173
188
|
}
|
|
@@ -178,39 +193,46 @@
|
|
|
178
193
|
}
|
|
179
194
|
|
|
180
195
|
// Check for a deprecation within the type scale
|
|
181
|
-
$deprecation: map
|
|
196
|
+
$deprecation: map.get($font-map, "deprecation");
|
|
182
197
|
|
|
183
198
|
@if $deprecation {
|
|
184
199
|
// Warn on deprecated font sizes unless flagged for internal use
|
|
185
200
|
@if not $size-internal-use-only {
|
|
186
|
-
@include _warning(map
|
|
201
|
+
@include _warning(map.get($deprecation, "key"), map.get($deprecation, "message"));
|
|
187
202
|
}
|
|
188
203
|
|
|
189
204
|
// remove the deprecation map keys so they do not break the breakpoint loop
|
|
190
|
-
$font-map: map
|
|
205
|
+
$font-map: map.remove($font-map, "deprecation");
|
|
191
206
|
}
|
|
192
207
|
|
|
193
208
|
@each $breakpoint, $breakpoint-map in $font-map {
|
|
194
|
-
$font-size: map
|
|
209
|
+
$font-size: map.get($breakpoint-map, "font-size");
|
|
195
210
|
$font-size-rem: govuk-px-to-rem($font-size);
|
|
196
211
|
|
|
197
212
|
// $calculated-line-height is a separate variable from $line-height,
|
|
198
213
|
// as otherwise the value would get redefined with each loop and
|
|
199
214
|
// eventually break _govuk-line-height.
|
|
200
|
-
//
|
|
215
|
+
// 1. See if the function was called with a specific line-height
|
|
216
|
+
$calculated-line-height: $line-height;
|
|
217
|
+
// 2. Default to the breakpoint-map if no specific value was given
|
|
218
|
+
@if not $calculated-line-height {
|
|
219
|
+
$calculated-line-height: map.get($breakpoint-map, "line-height");
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// 3. Turn the value into a unitless line-height if possible
|
|
201
223
|
// We continue to call the param $line-height to stay consistent with the
|
|
202
224
|
// naming with govuk-font.
|
|
203
225
|
$calculated-line-height: _govuk-line-height(
|
|
204
|
-
$line-height:
|
|
226
|
+
$line-height: $calculated-line-height,
|
|
205
227
|
$font-size: $font-size
|
|
206
228
|
);
|
|
207
229
|
|
|
208
230
|
// Mark rules as !important if $important is true - this will result in
|
|
209
231
|
// these variables becoming strings, so this needs to happen *after* they
|
|
210
232
|
// are used in calculations
|
|
211
|
-
$font-size: $font-size if($important, !important
|
|
212
|
-
$font-size-rem: $font-size-rem if($important, !important
|
|
213
|
-
$calculated-line-height: $calculated-line-height if($important, !important
|
|
233
|
+
$font-size: $font-size govuk-if($important, !important);
|
|
234
|
+
$font-size-rem: $font-size-rem govuk-if($important, !important);
|
|
235
|
+
$calculated-line-height: $calculated-line-height govuk-if($important, !important);
|
|
214
236
|
|
|
215
237
|
@if not $breakpoint {
|
|
216
238
|
font-size: $font-size-rem;
|