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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +0 -4
  3. data/Gemfile.lock +1 -1
  4. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  5. data/package-lock.json +5 -12
  6. data/package.json +1 -1
  7. data/vendor/assets/javascripts/govuk_frontend_rails.js +4527 -2376
  8. data/vendor/assets/stylesheets/all-ie8.scss +8 -0
  9. data/vendor/assets/stylesheets/components/_all.scss +2 -1
  10. data/vendor/assets/stylesheets/components/accordion/_index.scss +294 -99
  11. data/vendor/assets/stylesheets/components/back-link/_index.scss +20 -20
  12. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +22 -13
  13. data/vendor/assets/stylesheets/components/button/_index.scss +37 -27
  14. data/vendor/assets/stylesheets/components/character-count/_index.scss +9 -0
  15. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +9 -8
  16. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +0 -2
  17. data/vendor/assets/stylesheets/components/error-message/_index.scss +1 -0
  18. data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -1
  19. data/vendor/assets/stylesheets/components/footer/_index.scss +16 -67
  20. data/vendor/assets/stylesheets/components/header/_index.scss +44 -26
  21. data/vendor/assets/stylesheets/components/hint/_index.scss +1 -3
  22. data/vendor/assets/stylesheets/components/input/_index.scss +29 -27
  23. data/vendor/assets/stylesheets/components/pagination/_index.scss +247 -0
  24. data/vendor/assets/stylesheets/components/pagination/_pagination.scss +2 -0
  25. data/vendor/assets/stylesheets/components/panel/_index.scss +1 -1
  26. data/vendor/assets/stylesheets/components/radios/_index.scss +10 -17
  27. data/vendor/assets/stylesheets/components/select/_index.scss +19 -2
  28. data/vendor/assets/stylesheets/components/skip-link/_index.scss +14 -3
  29. data/vendor/assets/stylesheets/components/summary-list/_index.scss +164 -33
  30. data/vendor/assets/stylesheets/components/table/_index.scss +1 -1
  31. data/vendor/assets/stylesheets/components/tabs/_index.scss +2 -2
  32. data/vendor/assets/stylesheets/components/tag/_index.scss +18 -23
  33. data/vendor/assets/stylesheets/components/textarea/_index.scss +9 -2
  34. data/vendor/assets/stylesheets/core/_all.scss +1 -1
  35. data/vendor/assets/stylesheets/core/_global-styles.scss +0 -6
  36. data/vendor/assets/stylesheets/core/_govuk-frontend-version.scss +5 -0
  37. data/vendor/assets/stylesheets/core/_links.scss +0 -6
  38. data/vendor/assets/stylesheets/core/_lists.scss +0 -6
  39. data/vendor/assets/stylesheets/core/_section-break.scss +1 -7
  40. data/vendor/assets/stylesheets/core/_typography.scss +0 -6
  41. data/vendor/assets/stylesheets/helpers/_colour.scss +10 -7
  42. data/vendor/assets/stylesheets/helpers/_focused.scss +6 -1
  43. data/vendor/assets/stylesheets/helpers/_font-faces.scss +1 -1
  44. data/vendor/assets/stylesheets/helpers/_links.scss +13 -11
  45. data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -2
  46. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  47. data/vendor/assets/stylesheets/helpers/_spacing.scss +3 -3
  48. data/vendor/assets/stylesheets/helpers/_typography.scss +16 -9
  49. data/vendor/assets/stylesheets/objects/_all.scss +1 -0
  50. data/vendor/assets/stylesheets/objects/_button-group.scss +10 -26
  51. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -30
  52. data/vendor/assets/stylesheets/objects/_template.scss +32 -0
  53. data/vendor/assets/stylesheets/objects/_width-container.scss +1 -5
  54. data/vendor/assets/stylesheets/overrides/_display.scss +0 -6
  55. data/vendor/assets/stylesheets/overrides/_spacing.scss +56 -18
  56. data/vendor/assets/stylesheets/overrides/_text-align.scss +0 -6
  57. data/vendor/assets/stylesheets/overrides/_typography.scss +0 -6
  58. data/vendor/assets/stylesheets/overrides/_width.scss +0 -6
  59. data/vendor/assets/stylesheets/settings/_all.scss +1 -0
  60. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +7 -0
  61. data/vendor/assets/stylesheets/settings/_colours-palette.scss +12 -0
  62. data/vendor/assets/stylesheets/settings/_compatibility.scss +26 -0
  63. data/vendor/assets/stylesheets/settings/_ie8.scss +16 -0
  64. data/vendor/assets/stylesheets/settings/_links.scss +5 -1
  65. data/vendor/assets/stylesheets/settings/_measurements.scss +5 -15
  66. data/vendor/assets/stylesheets/settings/_spacing.scss +4 -8
  67. data/vendor/assets/stylesheets/settings/_typography-font.scss +23 -0
  68. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -0
  69. data/vendor/assets/stylesheets/settings/_warnings.scss +53 -0
  70. data/vendor/assets/stylesheets/tools/_all.scss +0 -1
  71. data/vendor/assets/stylesheets/tools/_compatibility.scss +20 -6
  72. data/vendor/assets/stylesheets/tools/_exports.scss +1 -1
  73. data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
  74. data/vendor/assets/stylesheets/tools/_ie8.scss +38 -2
  75. data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
  76. data/vendor/assets/stylesheets/tools/_px-to-em.scss +2 -2
  77. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
  78. 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
- // Font size is set in .govuk-accordion__section-button
19
- @include govuk-font(24);
17
+ margin-top: 0;
18
+ margin-bottom: 0;
20
19
 
21
- margin-top: 0; // Override browser default
22
- margin-bottom: 0; // Override browser default
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
- display: inline-block;
29
- margin-bottom: 0;
30
- padding-top: govuk-spacing(3);
31
- }
26
+ @include govuk-text-colour;
32
27
 
33
- .govuk-accordion__section-summary {
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: 1px solid $govuk-border-colour;
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(3, "bottom");
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
- // This is styled to look like a link not a button
68
- .govuk-accordion__open-all {
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
- margin: 0;
73
- padding: 0;
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-link-common;
81
- @include govuk-link-style-default;
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
- // Section headers have a pointer cursor as an additional affordance
91
- .govuk-accordion__section-header {
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
- // Safe area on the right to avoid clashing with icon
94
- padding-right: 40px;
95
- border-top: 1px solid $govuk-border-colour;
96
- cursor: pointer;
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
- @include govuk-typography-common;
102
- margin-top: 0;
103
- margin-bottom: 0;
104
- margin-left: 0;
105
- padding: 0;
106
- border-width: 0;
107
- color: $govuk-link-colour;
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
- @include govuk-focused-text;
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
- // Extend the touch area of the button to span the section header
125
- .govuk-accordion__section-button:after {
126
- content: "";
127
- position: absolute;
128
- top: 0;
129
- right: 0;
130
- bottom: 0;
131
- left: 0;
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
- .govuk-accordion__section-button:hover:not(:focus) {
135
- color: $govuk-link-hover-colour;
136
- text-decoration: underline;
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
- // This needs to come after the text-decoration property otherwise
139
- // text-decoration, as a shorthand property, resets it to auto
140
- @include govuk-link-hover-decoration;
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
- // For devices that can't hover such as touch devices,
145
- // remove hover state as it can be stuck in that state (iOS).
146
- @media (hover: none) {
147
- .govuk-accordion__section-button:hover {
148
- text-decoration: none;
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
- .govuk-accordion__controls {
153
- text-align: right;
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
- // Display an icon to the right of each header to indicate open/closed status,
157
- // and as an additional affordance.
158
- .govuk-accordion__icon {
159
- position: absolute;
160
- top: 50%;
161
- right: 15px;
162
- width: 16px;
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
- .govuk-accordion__icon:after,
168
- .govuk-accordion__icon:before {
169
- content: "";
170
- box-sizing: border-box;
171
- position: absolute;
172
- top: 0;
173
- right: 0;
174
- bottom: 0;
175
- left: 0;
176
- width: 25%;
177
- height: 25%;
178
- margin: auto;
179
- border: 2px solid transparent;
180
- background-color: govuk-colour("black");
181
- }
182
-
183
- .govuk-accordion__icon:before {
184
- width: 100%;
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
- .govuk-accordion__icon:after {
188
- height: 100%;
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
- // Vertical bar should be hidden when section is open, to display a '-' icon
192
- .govuk-accordion__section--expanded .govuk-accordion__icon:after {
193
- content: " ";
194
- display: none;
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);
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
- top: -1px;
39
- bottom: 1px;
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 govuk-if-ie8 {
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
  }