dxw_govuk_frontend_rails 3.14.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +0 -4
- data/Gemfile.lock +1 -1
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +5 -12
- data/package.json +1 -1
- data/vendor/assets/javascripts/govuk_frontend_rails.js +4527 -2376
- data/vendor/assets/stylesheets/all-ie8.scss +8 -0
- data/vendor/assets/stylesheets/components/_all.scss +2 -1
- data/vendor/assets/stylesheets/components/accordion/_index.scss +294 -99
- data/vendor/assets/stylesheets/components/back-link/_index.scss +20 -20
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +22 -13
- data/vendor/assets/stylesheets/components/button/_index.scss +37 -27
- data/vendor/assets/stylesheets/components/character-count/_index.scss +9 -0
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +9 -8
- data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +0 -2
- data/vendor/assets/stylesheets/components/error-message/_index.scss +1 -0
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -1
- data/vendor/assets/stylesheets/components/footer/_index.scss +16 -67
- data/vendor/assets/stylesheets/components/header/_index.scss +44 -26
- data/vendor/assets/stylesheets/components/hint/_index.scss +1 -3
- data/vendor/assets/stylesheets/components/input/_index.scss +29 -27
- data/vendor/assets/stylesheets/components/pagination/_index.scss +247 -0
- data/vendor/assets/stylesheets/components/pagination/_pagination.scss +2 -0
- data/vendor/assets/stylesheets/components/panel/_index.scss +1 -1
- data/vendor/assets/stylesheets/components/radios/_index.scss +10 -17
- data/vendor/assets/stylesheets/components/select/_index.scss +19 -2
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +14 -3
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +164 -33
- data/vendor/assets/stylesheets/components/table/_index.scss +1 -1
- data/vendor/assets/stylesheets/components/tabs/_index.scss +2 -2
- data/vendor/assets/stylesheets/components/tag/_index.scss +18 -23
- data/vendor/assets/stylesheets/components/textarea/_index.scss +9 -2
- data/vendor/assets/stylesheets/core/_all.scss +1 -1
- data/vendor/assets/stylesheets/core/_global-styles.scss +0 -6
- data/vendor/assets/stylesheets/core/_govuk-frontend-version.scss +5 -0
- data/vendor/assets/stylesheets/core/_links.scss +0 -6
- data/vendor/assets/stylesheets/core/_lists.scss +0 -6
- data/vendor/assets/stylesheets/core/_section-break.scss +1 -7
- data/vendor/assets/stylesheets/core/_typography.scss +0 -6
- data/vendor/assets/stylesheets/helpers/_colour.scss +10 -7
- data/vendor/assets/stylesheets/helpers/_focused.scss +6 -1
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_links.scss +13 -11
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -2
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_spacing.scss +3 -3
- data/vendor/assets/stylesheets/helpers/_typography.scss +16 -9
- data/vendor/assets/stylesheets/objects/_all.scss +1 -0
- data/vendor/assets/stylesheets/objects/_button-group.scss +10 -26
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -30
- data/vendor/assets/stylesheets/objects/_template.scss +32 -0
- data/vendor/assets/stylesheets/objects/_width-container.scss +1 -5
- data/vendor/assets/stylesheets/overrides/_display.scss +0 -6
- data/vendor/assets/stylesheets/overrides/_spacing.scss +56 -18
- data/vendor/assets/stylesheets/overrides/_text-align.scss +0 -6
- data/vendor/assets/stylesheets/overrides/_typography.scss +0 -6
- data/vendor/assets/stylesheets/overrides/_width.scss +0 -6
- data/vendor/assets/stylesheets/settings/_all.scss +1 -0
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +7 -0
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +12 -0
- data/vendor/assets/stylesheets/settings/_compatibility.scss +26 -0
- data/vendor/assets/stylesheets/settings/_ie8.scss +16 -0
- data/vendor/assets/stylesheets/settings/_links.scss +5 -1
- data/vendor/assets/stylesheets/settings/_measurements.scss +5 -15
- data/vendor/assets/stylesheets/settings/_spacing.scss +4 -8
- data/vendor/assets/stylesheets/settings/_typography-font.scss +23 -0
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -0
- data/vendor/assets/stylesheets/settings/_warnings.scss +53 -0
- data/vendor/assets/stylesheets/tools/_all.scss +0 -1
- data/vendor/assets/stylesheets/tools/_compatibility.scss +20 -6
- data/vendor/assets/stylesheets/tools/_exports.scss +1 -1
- data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
- data/vendor/assets/stylesheets/tools/_ie8.scss +38 -2
- data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +2 -2
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
- metadata +8 -3
@@ -1,3 +1,11 @@
|
|
1
|
+
// Ignore IE8 related warnings whilst we continue to generate IE8 specific
|
2
|
+
// stylesheets for the review app or dist versions of GOV.UK Frontend
|
3
|
+
$govuk-suppressed-warnings: if(
|
4
|
+
variable-exists(govuk-suppressed-warnings),
|
5
|
+
append($govuk-suppressed-warnings, "ie8"),
|
6
|
+
("ie8")
|
7
|
+
);
|
8
|
+
|
1
9
|
// By setting $govuk-is-ie8 to true, we create a version of the stylesheet that
|
2
10
|
// targets IE8 – e.g. conditionally including or excluding styles, and
|
3
11
|
// rasterizing media queries.
|
@@ -7,7 +7,6 @@
|
|
7
7
|
@import "checkboxes/index";
|
8
8
|
@import "character-count/index";
|
9
9
|
@import "cookie-banner/index";
|
10
|
-
@import "summary-list/index";
|
11
10
|
@import "date-input/index";
|
12
11
|
@import "details/index";
|
13
12
|
@import "error-message/index";
|
@@ -21,6 +20,7 @@
|
|
21
20
|
@import "inset-text/index";
|
22
21
|
@import "label/index";
|
23
22
|
@import "notification-banner/index";
|
23
|
+
@import "pagination/index";
|
24
24
|
@import "panel/index";
|
25
25
|
@import "phase-banner/index";
|
26
26
|
@import "tabs/index";
|
@@ -28,6 +28,7 @@
|
|
28
28
|
@import "radios/index";
|
29
29
|
@import "select/index";
|
30
30
|
@import "skip-link/index";
|
31
|
+
@import "summary-list/index";
|
31
32
|
@import "table/index";
|
32
33
|
@import "textarea/index";
|
33
34
|
@import "warning-text/index";
|
@@ -1,38 +1,33 @@
|
|
1
1
|
@include govuk-exports("govuk/component/accordion") {
|
2
|
+
$govuk-accordion-base-colour: govuk-colour("black");
|
3
|
+
$govuk-accordion-hover-colour: govuk-colour("light-grey", $legacy: "grey-3");
|
4
|
+
$govuk-accordion-icon-focus-colour: $govuk-focus-colour;
|
5
|
+
$govuk-accordion-bottom-border-width: 1px;
|
6
|
+
|
2
7
|
.govuk-accordion {
|
3
8
|
@include govuk-responsive-margin(6, "bottom");
|
4
9
|
}
|
5
10
|
|
6
|
-
// Borders between accordion sections
|
7
11
|
.govuk-accordion__section {
|
8
12
|
padding-top: govuk-spacing(3);
|
9
13
|
}
|
10
14
|
|
11
|
-
.govuk-accordion__section-header {
|
12
|
-
padding-top: govuk-spacing(3);
|
13
|
-
padding-bottom: govuk-spacing(3);
|
14
|
-
}
|
15
|
-
|
16
15
|
.govuk-accordion__section-heading {
|
17
16
|
// Override browser defaults to ensure consistent element height
|
18
|
-
|
19
|
-
|
17
|
+
margin-top: 0;
|
18
|
+
margin-bottom: 0;
|
20
19
|
|
21
|
-
|
22
|
-
|
20
|
+
padding-top: govuk-spacing(3);
|
21
|
+
padding-bottom: govuk-spacing(3);
|
23
22
|
}
|
24
23
|
|
25
|
-
// Buttons within the sections don’t need default styling
|
26
24
|
.govuk-accordion__section-button {
|
27
25
|
@include govuk-font($size: 24, $weight: bold);
|
28
|
-
|
29
|
-
margin-bottom: 0;
|
30
|
-
padding-top: govuk-spacing(3);
|
31
|
-
}
|
26
|
+
@include govuk-text-colour;
|
32
27
|
|
33
|
-
|
34
|
-
margin-top: govuk-spacing(2);
|
28
|
+
display: block;
|
35
29
|
margin-bottom: 0;
|
30
|
+
padding-top: govuk-spacing(3);
|
36
31
|
}
|
37
32
|
|
38
33
|
// Remove the bottom margin from the last item inside the content
|
@@ -44,19 +39,33 @@
|
|
44
39
|
.js-enabled {
|
45
40
|
.govuk-accordion {
|
46
41
|
// Border at the bottom of the whole accordion
|
47
|
-
border-bottom:
|
42
|
+
border-bottom: $govuk-accordion-bottom-border-width solid $govuk-border-colour;
|
48
43
|
}
|
49
44
|
|
50
|
-
// Borders between accordion sections
|
51
45
|
.govuk-accordion__section {
|
52
46
|
padding-top: 0;
|
53
47
|
}
|
54
48
|
|
55
|
-
// Hide the body of collapsed sections
|
49
|
+
// Hide the body of collapsed sections by default for browsers that lack
|
50
|
+
// support for `content-visibility` paired with [hidden=until-found]
|
56
51
|
.govuk-accordion__section-content {
|
57
52
|
display: none;
|
53
|
+
|
58
54
|
@include govuk-responsive-padding(3, "top");
|
59
|
-
@include govuk-responsive-padding(
|
55
|
+
@include govuk-responsive-padding(8, "bottom");
|
56
|
+
}
|
57
|
+
|
58
|
+
// Hide the body of collapsed sections using `content-visibility` to enable
|
59
|
+
// page search within [hidden=until-found] regions where browser supported
|
60
|
+
.govuk-accordion__section-content[hidden] {
|
61
|
+
@supports (content-visibility: hidden) {
|
62
|
+
content-visibility: hidden;
|
63
|
+
display: inherit;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Hide the padding of collapsed sections
|
67
|
+
padding-top: 0;
|
68
|
+
padding-bottom: 0;
|
60
69
|
}
|
61
70
|
|
62
71
|
// Show the body of expanded sections
|
@@ -64,54 +73,209 @@
|
|
64
73
|
display: block;
|
65
74
|
}
|
66
75
|
|
67
|
-
|
68
|
-
|
69
|
-
@include govuk-font($size: 16);
|
76
|
+
.govuk-accordion__show-all {
|
77
|
+
@include govuk-font($size: 19);
|
70
78
|
position: relative;
|
71
79
|
z-index: 1;
|
72
|
-
|
73
|
-
|
80
|
+
|
81
|
+
margin-bottom: 9px;
|
82
|
+
padding: govuk-spacing(1) 2px govuk-spacing(1) 0;
|
83
|
+
|
74
84
|
border-width: 0;
|
85
|
+
|
75
86
|
color: $govuk-link-colour;
|
76
87
|
background: none;
|
88
|
+
|
77
89
|
cursor: pointer;
|
78
90
|
-webkit-appearance: none;
|
79
91
|
|
80
|
-
@include govuk-
|
81
|
-
|
92
|
+
@include govuk-media-query ($from: tablet) {
|
93
|
+
margin-bottom: 14px;
|
94
|
+
}
|
82
95
|
|
83
96
|
// Remove default button focus outline in Firefox
|
84
97
|
&::-moz-focus-inner {
|
85
98
|
padding: 0;
|
86
99
|
border: 0;
|
87
100
|
}
|
101
|
+
|
102
|
+
&:hover {
|
103
|
+
color: $govuk-accordion-base-colour;
|
104
|
+
background: $govuk-accordion-hover-colour;
|
105
|
+
// The GOV.UK Design System focus state adds a box-shadow to the top and bottom of the
|
106
|
+
// button. We add a grey box-shadow on hover too, to make the height of the hover state
|
107
|
+
// match the height of the focus state.
|
108
|
+
box-shadow: 0 -2px $govuk-accordion-hover-colour, 0 4px $govuk-accordion-hover-colour;
|
109
|
+
|
110
|
+
.govuk-accordion__section-toggle-text {
|
111
|
+
color: $govuk-accordion-base-colour;
|
112
|
+
}
|
113
|
+
|
114
|
+
.govuk-accordion-nav__chevron {
|
115
|
+
color: $govuk-accordion-base-colour;
|
116
|
+
background: $govuk-accordion-base-colour;
|
117
|
+
}
|
118
|
+
|
119
|
+
.govuk-accordion-nav__chevron:after {
|
120
|
+
color: $govuk-accordion-hover-colour;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
&:focus {
|
125
|
+
@include govuk-focused-text;
|
126
|
+
|
127
|
+
.govuk-accordion-nav__chevron {
|
128
|
+
background: $govuk-accordion-base-colour;
|
129
|
+
}
|
130
|
+
|
131
|
+
.govuk-accordion-nav__chevron:after {
|
132
|
+
color: $govuk-accordion-icon-focus-colour;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
.govuk-accordion__section-heading {
|
138
|
+
padding: 0;
|
88
139
|
}
|
89
140
|
|
90
|
-
//
|
91
|
-
.govuk-
|
141
|
+
// Create Chevron icon aligned with text
|
142
|
+
.govuk-accordion-nav__chevron {
|
143
|
+
box-sizing: border-box;
|
144
|
+
display: inline-block;
|
145
|
+
|
92
146
|
position: relative;
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
147
|
+
|
148
|
+
// Set size using rems to make the icon scale with text if user resizes text in their browser
|
149
|
+
width: govuk-px-to-rem(20px);
|
150
|
+
height: govuk-px-to-rem(20px);
|
151
|
+
|
152
|
+
border: govuk-px-to-rem(1px) solid;
|
153
|
+
border-radius: 50%;
|
154
|
+
|
155
|
+
vertical-align: middle;
|
156
|
+
|
157
|
+
// IE8 fallback of icon
|
158
|
+
@include _govuk-if-ie8 {
|
159
|
+
display: inline-block;
|
160
|
+
max-height: 20px;
|
161
|
+
line-height: 1;
|
162
|
+
}
|
163
|
+
|
164
|
+
// Create inner chevron arrow
|
165
|
+
&:after {
|
166
|
+
content: "";
|
167
|
+
box-sizing: border-box;
|
168
|
+
display: block;
|
169
|
+
|
170
|
+
position: absolute;
|
171
|
+
bottom: govuk-px-to-rem(5px);
|
172
|
+
left: govuk-px-to-rem(6px);
|
173
|
+
|
174
|
+
width: govuk-px-to-rem(6px);
|
175
|
+
height: govuk-px-to-rem(6px);
|
176
|
+
|
177
|
+
-webkit-transform: rotate(-45deg);
|
178
|
+
|
179
|
+
-ms-transform: rotate(-45deg);
|
180
|
+
|
181
|
+
transform: rotate(-45deg);
|
182
|
+
|
183
|
+
border-top: govuk-px-to-rem(2px) solid;
|
184
|
+
border-right: govuk-px-to-rem(2px) solid;
|
185
|
+
|
186
|
+
// IE8 fallback of icon with HTML symbol
|
187
|
+
@include _govuk-if-ie8 {
|
188
|
+
content: "\25B2"; // "▲"
|
189
|
+
position: relative;
|
190
|
+
border: 0;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
// Rotate icon to create "Down" version
|
196
|
+
.govuk-accordion-nav__chevron--down {
|
197
|
+
-webkit-transform: rotate(180deg);
|
198
|
+
-ms-transform: rotate(180deg);
|
199
|
+
transform: rotate(180deg);
|
200
|
+
|
201
|
+
// IE8 fallback of arrow icon
|
202
|
+
@include _govuk-if-ie8 {
|
203
|
+
&:after {
|
204
|
+
content: "\25BC"; // "▼"
|
205
|
+
-webkit-transform: none;
|
206
|
+
-ms-transform: none;
|
207
|
+
transform: none;
|
208
|
+
}
|
209
|
+
}
|
97
210
|
}
|
98
211
|
|
99
|
-
// Buttons within the headers don’t need default styling
|
100
212
|
.govuk-accordion__section-button {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
213
|
+
width: 100%;
|
214
|
+
|
215
|
+
padding: govuk-spacing(2) 0 0 0;
|
216
|
+
|
217
|
+
border: 0;
|
218
|
+
|
219
|
+
border-top: $govuk-accordion-bottom-border-width solid $govuk-border-colour;
|
220
|
+
|
221
|
+
// Visually separate the section from the one underneath when user changes colours in their
|
222
|
+
// browser. See https://github.com/alphagov/govuk-frontend/issues/2321#issuecomment-924201488
|
223
|
+
border-bottom: govuk-spacing(2) solid transparent;
|
224
|
+
|
225
|
+
color: $govuk-text-colour;
|
108
226
|
background: none;
|
227
|
+
|
109
228
|
text-align: left;
|
229
|
+
// Section headers have a pointer cursor as an additional affordance
|
110
230
|
cursor: pointer;
|
111
231
|
-webkit-appearance: none;
|
112
232
|
|
233
|
+
@include govuk-media-query ($from: tablet) {
|
234
|
+
padding-bottom: govuk-spacing(2);
|
235
|
+
}
|
236
|
+
|
237
|
+
&:active {
|
238
|
+
color: $govuk-link-active-colour;
|
239
|
+
background: none;
|
240
|
+
}
|
241
|
+
|
242
|
+
&:hover {
|
243
|
+
color: $govuk-accordion-base-colour;
|
244
|
+
background: $govuk-accordion-hover-colour;
|
245
|
+
|
246
|
+
.govuk-accordion__section-toggle-text {
|
247
|
+
color: $govuk-accordion-base-colour;
|
248
|
+
}
|
249
|
+
|
250
|
+
.govuk-accordion-nav__chevron {
|
251
|
+
color: $govuk-accordion-base-colour;
|
252
|
+
background: $govuk-accordion-base-colour;
|
253
|
+
}
|
254
|
+
|
255
|
+
.govuk-accordion-nav__chevron:after {
|
256
|
+
color: $govuk-accordion-hover-colour;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
113
260
|
&:focus {
|
114
|
-
|
261
|
+
// Remove default focus border around button as
|
262
|
+
// styling is being applied to inner text elements that receive focus
|
263
|
+
outline: 0;
|
264
|
+
|
265
|
+
.govuk-accordion__section-heading-text-focus,
|
266
|
+
.govuk-accordion__section-summary-focus,
|
267
|
+
.govuk-accordion__section-toggle-focus {
|
268
|
+
@include govuk-focused-text;
|
269
|
+
}
|
270
|
+
|
271
|
+
.govuk-accordion-nav__chevron {
|
272
|
+
color: $govuk-accordion-base-colour;
|
273
|
+
background: $govuk-accordion-base-colour;
|
274
|
+
}
|
275
|
+
|
276
|
+
.govuk-accordion-nav__chevron:after {
|
277
|
+
color: $govuk-accordion-icon-focus-colour;
|
278
|
+
}
|
115
279
|
}
|
116
280
|
|
117
281
|
// Remove default button focus outline in Firefox
|
@@ -121,77 +285,108 @@
|
|
121
285
|
}
|
122
286
|
}
|
123
287
|
|
124
|
-
//
|
125
|
-
.
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
288
|
+
// Remove the transparent border when the section is expanded to make it clear that the heading
|
289
|
+
// relates to the content below. Adjust padding to maintain the height of the element.
|
290
|
+
// See https://github.com/alphagov/govuk-frontend/pull/2257#issuecomment-951920798
|
291
|
+
.govuk-accordion__section--expanded .govuk-accordion__section-button {
|
292
|
+
padding-bottom: govuk-spacing(3);
|
293
|
+
border-bottom: 0;
|
294
|
+
|
295
|
+
@include govuk-media-query ($from: tablet) {
|
296
|
+
padding-bottom: govuk-spacing(4);
|
297
|
+
}
|
132
298
|
}
|
133
299
|
|
134
|
-
|
135
|
-
|
136
|
-
|
300
|
+
// As Chevron icon is vertically aligned it overlaps with the focus state bottom border
|
301
|
+
// Styling adds some spacing
|
302
|
+
.govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus {
|
303
|
+
padding-bottom: 3px;
|
137
304
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
text-underline-offset: $govuk-link-underline-offset;
|
305
|
+
@include govuk-media-query ($from: desktop) {
|
306
|
+
padding-bottom: 2px;
|
307
|
+
}
|
142
308
|
}
|
143
309
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
310
|
+
.govuk-accordion__section-toggle,
|
311
|
+
.govuk-accordion__section-heading-text,
|
312
|
+
.govuk-accordion__section-summary {
|
313
|
+
display: block;
|
314
|
+
margin-bottom: 13px;
|
315
|
+
|
316
|
+
.govuk-accordion__section-heading-text-focus,
|
317
|
+
.govuk-accordion__section-summary-focus,
|
318
|
+
.govuk-accordion__section-toggle-focus {
|
319
|
+
display: inline;
|
149
320
|
}
|
150
321
|
}
|
151
322
|
|
152
|
-
.
|
153
|
-
|
323
|
+
// Add toggle link with Chevron icon on left.
|
324
|
+
.govuk-accordion__section-toggle {
|
325
|
+
@include govuk-typography-responsive($size: 19);
|
326
|
+
@include govuk-typography-weight-regular;
|
327
|
+
color: $govuk-link-colour;
|
154
328
|
}
|
155
329
|
|
156
|
-
//
|
157
|
-
//
|
158
|
-
.
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
height: 16px;
|
164
|
-
margin-top: -8px;
|
330
|
+
// Add space between the icon and text.
|
331
|
+
// Avoid applying spacing directly to the icon as the use of `transform` will change the
|
332
|
+
// placement of any margins.
|
333
|
+
.govuk-accordion__show-all-text,
|
334
|
+
.govuk-accordion__section-toggle-text {
|
335
|
+
margin-left: govuk-spacing(1);
|
336
|
+
vertical-align: middle;
|
165
337
|
}
|
166
338
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
339
|
+
// Background colour adjustment when user changes colours in Firefox
|
340
|
+
//
|
341
|
+
// When user changes colours in Firefox, text colour inside <button> is always black
|
342
|
+
// (regardless of the custom colours the user has set). This is fine when the text in the
|
343
|
+
// button is not nested inside another element because when user changes colours in Firefox,
|
344
|
+
// the immediate background colour of buttons is always white (again, regardless of user's
|
345
|
+
// custom colours).
|
346
|
+
//
|
347
|
+
// However, when the text inside <button> is wrapped inside another element AND that element
|
348
|
+
// sets a background colour, the text colour is still black but the background of that nested
|
349
|
+
// element gets the user's custom background colour. When the custom background is a lighter
|
350
|
+
// hue, the contrast might be sufficient. But if the user's custom background colour is a
|
351
|
+
// darker colour, the contrast with the text might not be sufficient.
|
352
|
+
//
|
353
|
+
// To ensure sufficient contrast, override the background colour set by the focus state on the
|
354
|
+
// nested elements to be transparent.
|
355
|
+
//
|
356
|
+
// Also override the background colour of the Show/Hide chevrons which set a background colour
|
357
|
+
// on hover.
|
358
|
+
@media screen and (forced-colors: active) {
|
359
|
+
.govuk-accordion__show-all:hover,
|
360
|
+
.govuk-accordion__section-button:hover {
|
361
|
+
.govuk-accordion-nav__chevron {
|
362
|
+
background-color: transparent;
|
363
|
+
}
|
364
|
+
}
|
186
365
|
|
187
|
-
|
188
|
-
|
366
|
+
.govuk-accordion__show-all:focus,
|
367
|
+
.govuk-accordion__section-button:focus {
|
368
|
+
.govuk-accordion__section-heading-text-focus,
|
369
|
+
.govuk-accordion__section-summary-focus,
|
370
|
+
.govuk-accordion__section-toggle-focus,
|
371
|
+
.govuk-accordion-nav__chevron {
|
372
|
+
background: transparent;
|
373
|
+
background-color: transparent;
|
374
|
+
}
|
375
|
+
}
|
189
376
|
}
|
190
377
|
|
191
|
-
//
|
192
|
-
|
193
|
-
|
194
|
-
|
378
|
+
// For devices that can't hover such as touch devices,
|
379
|
+
// remove hover state as it can be stuck in that state (iOS).
|
380
|
+
@media (hover: none) {
|
381
|
+
.govuk-accordion__section-header:hover {
|
382
|
+
border-top-color: $govuk-border-colour;
|
383
|
+
|
384
|
+
box-shadow: inset 0 3px 0 0 $govuk-link-colour;
|
385
|
+
|
386
|
+
.govuk-accordion__section-button {
|
387
|
+
border-top-color: $govuk-border-colour;
|
388
|
+
}
|
389
|
+
}
|
195
390
|
}
|
196
391
|
}
|
197
392
|
}
|
@@ -1,16 +1,19 @@
|
|
1
1
|
@include govuk-exports("govuk/component/back-link") {
|
2
|
+
// Component font-size on the Frontend (used for calculations)
|
3
|
+
$font-size: 16;
|
2
4
|
|
3
5
|
// Size of chevron (excluding border)
|
4
|
-
$chevron-size: 7px;
|
6
|
+
$chevron-size: govuk-em(7px, $font-size);
|
5
7
|
|
6
8
|
// Size of chevron border
|
7
|
-
$chevron-border-width: 1px;
|
9
|
+
$chevron-border-min-width: 1px;
|
10
|
+
$chevron-border-width: govuk-em($chevron-border-min-width, $font-size);
|
8
11
|
|
9
12
|
// Colour of chevron
|
10
13
|
$chevron-border-colour: $govuk-secondary-text-colour;
|
11
14
|
|
12
15
|
.govuk-back-link {
|
13
|
-
@include govuk-typography-responsive($size:
|
16
|
+
@include govuk-typography-responsive($size: $font-size);
|
14
17
|
@include govuk-link-common;
|
15
18
|
@include govuk-link-style-text;
|
16
19
|
|
@@ -21,7 +24,7 @@
|
|
21
24
|
margin-bottom: govuk-spacing(3);
|
22
25
|
|
23
26
|
// Allow space for the arrow
|
24
|
-
padding-left: 14px;
|
27
|
+
padding-left: govuk-em(14px, $font-size);
|
25
28
|
}
|
26
29
|
|
27
30
|
// Prepend left pointing chevron
|
@@ -35,14 +38,15 @@
|
|
35
38
|
@if $govuk-use-legacy-font {
|
36
39
|
// Begin adjustments for font baseline offset
|
37
40
|
// These should be removed when legacy font support is dropped
|
38
|
-
|
39
|
-
|
41
|
+
$offset: govuk-em(1px, $font-size);
|
42
|
+
top: $offset * -1;
|
43
|
+
bottom: $offset;
|
40
44
|
} @else {
|
41
45
|
top: 0;
|
42
46
|
bottom: 0;
|
43
47
|
}
|
44
48
|
|
45
|
-
left: 3px;
|
49
|
+
left: govuk-em(3px, $font-size);
|
46
50
|
|
47
51
|
width: $chevron-size;
|
48
52
|
height: $chevron-size;
|
@@ -56,11 +60,18 @@
|
|
56
60
|
transform: rotate(225deg);
|
57
61
|
|
58
62
|
border: solid;
|
59
|
-
border-width: $chevron-border-width $chevron-border-width 0 0;
|
63
|
+
border-width: $chevron-border-min-width $chevron-border-min-width 0 0;
|
60
64
|
border-color: $chevron-border-colour;
|
61
65
|
|
66
|
+
@supports (border-width: unquote("max(0px)")) {
|
67
|
+
border-width: unquote("max(#{$chevron-border-min-width}, #{$chevron-border-width}) max(#{$chevron-border-min-width}, #{$chevron-border-width})") 0 0;
|
68
|
+
|
69
|
+
// Ensure that the chevron never gets smaller than 16px
|
70
|
+
font-size: unquote("max(#{$font-size * 1px}, 1em)");
|
71
|
+
}
|
72
|
+
|
62
73
|
// Fall back to a less than sign for IE8
|
63
|
-
@include
|
74
|
+
@include _govuk-if-ie8 {
|
64
75
|
content: "\003c"; // Less than sign (<)
|
65
76
|
width: auto;
|
66
77
|
height: auto;
|
@@ -85,15 +96,4 @@
|
|
85
96
|
bottom: -14px;
|
86
97
|
left: 0;
|
87
98
|
}
|
88
|
-
|
89
|
-
@if $govuk-use-legacy-font {
|
90
|
-
// Begin adjustments for font baseline offset
|
91
|
-
// These should be removed when legacy font support is dropped
|
92
|
-
.govuk-back-link:before {
|
93
|
-
$offset: 1px;
|
94
|
-
|
95
|
-
top: $offset * -1;
|
96
|
-
bottom: $offset;
|
97
|
-
}
|
98
|
-
}
|
99
99
|
}
|