dxw_govuk_frontend_rails 2.13.0 → 3.0.0

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -9
  3. data/Rakefile +8 -8
  4. data/dxw_govuk_frontend_rails.gemspec +3 -3
  5. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  6. data/package-lock.json +3 -3
  7. data/package.json +1 -1
  8. data/vendor/assets/fonts/bold-affa96571d-v2.woff +0 -0
  9. data/vendor/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  10. data/vendor/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  11. data/vendor/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  12. data/vendor/assets/javascripts/govuk_frontend_rails.js +116 -63
  13. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +48 -28
  14. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +17 -9
  15. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +10 -11
  16. data/vendor/assets/stylesheets/components/button/_button.scss +70 -47
  17. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +4 -6
  18. data/vendor/assets/stylesheets/components/details/_details.scss +12 -13
  19. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +4 -17
  20. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +63 -1
  21. data/vendor/assets/stylesheets/components/footer/_footer.scss +47 -16
  22. data/vendor/assets/stylesheets/components/header/_header.scss +34 -20
  23. data/vendor/assets/stylesheets/components/input/_input.scss +24 -1
  24. data/vendor/assets/stylesheets/components/panel/_panel.scss +1 -1
  25. data/vendor/assets/stylesheets/components/radios/_radios.scss +7 -9
  26. data/vendor/assets/stylesheets/components/select/_select.scss +23 -1
  27. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +6 -1
  28. data/vendor/assets/stylesheets/components/table/_table.scss +1 -0
  29. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +63 -51
  30. data/vendor/assets/stylesheets/components/tag/_tag.scss +18 -7
  31. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +24 -1
  32. data/vendor/assets/stylesheets/helpers/_all.scss +1 -1
  33. data/vendor/assets/stylesheets/helpers/_colour.scss +23 -1
  34. data/vendor/assets/stylesheets/helpers/_focused.scss +28 -0
  35. data/vendor/assets/stylesheets/helpers/_font-faces.scss +10 -36
  36. data/vendor/assets/stylesheets/helpers/_grid.scss +11 -58
  37. data/vendor/assets/stylesheets/helpers/_links.scss +15 -1
  38. data/vendor/assets/stylesheets/helpers/_typography.scss +22 -4
  39. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +4 -2
  40. data/vendor/assets/stylesheets/objects/_grid.scss +2 -2
  41. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -1
  42. data/vendor/assets/stylesheets/settings/_colours-applied.scss +9 -8
  43. data/vendor/assets/stylesheets/settings/_colours-palette.scss +70 -6
  44. data/vendor/assets/stylesheets/settings/_compatibility.scss +31 -7
  45. data/vendor/assets/stylesheets/settings/_measurements.scss +2 -2
  46. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +11 -1
  47. data/vendor/assets/stylesheets/settings/_typography-font.scss +27 -7
  48. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +9 -10
  49. metadata +10 -22
  50. data/vendor/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
  51. data/vendor/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
  52. data/vendor/assets/fonts/bold-fb2676462a-v1.eot +0 -0
  53. data/vendor/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
  54. data/vendor/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
  55. data/vendor/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
  56. data/vendor/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
  57. data/vendor/assets/fonts/light-458f8ea81c-v1.woff +0 -0
  58. data/vendor/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
  59. data/vendor/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
  60. data/vendor/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
  61. data/vendor/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
  62. data/vendor/assets/images/icon-arrow-left.png +0 -0
  63. data/vendor/assets/images/icon-important.png +0 -0
  64. data/vendor/assets/images/icon-pointer-2x.png +0 -0
  65. data/vendor/assets/images/icon-pointer.png +0 -0
  66. data/vendor/assets/stylesheets/helpers/_focusable.scss +0 -34
@@ -25,6 +25,12 @@
25
25
  // Underline is provided by a bottom border
26
26
  text-decoration: none;
27
27
 
28
+ // When the back link is focused, hide the bottom link border as the
29
+ // focus styles has a bottom border.
30
+ &:focus {
31
+ border-bottom-color: transparent;
32
+ }
33
+
28
34
  // Prepend left pointing arrow
29
35
  &:before {
30
36
  @include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
@@ -34,21 +40,23 @@
34
40
  // Vertically align with the parent element
35
41
  position: absolute;
36
42
 
37
- top: -1px;
38
- bottom: 1px;
43
+ top: 0;
44
+ bottom: 0;
39
45
  left: 0;
40
46
 
41
47
  margin: auto;
42
48
  }
43
49
  }
44
50
 
45
- // Begin adjustments for font baseline offset
46
- // These should be removed when the font is updated with the correct baseline
47
-
48
- .govuk-back-link:before {
49
- $offset: 1px;
51
+ @if $govuk-use-legacy-font {
52
+ // Begin adjustments for font baseline offset
53
+ // These should be removed when legacy font support is dropped
54
+ .govuk-back-link:before {
55
+ $offset: 1px;
50
56
 
51
- top: $offset * -1;
52
- bottom: $offset;
57
+ top: $offset * -1;
58
+ bottom: $offset;
59
+ }
53
60
  }
61
+
54
62
  }
@@ -56,17 +56,16 @@
56
56
 
57
57
  position: absolute;
58
58
 
59
- // Begin adjustments for font baseline offset
60
- // These should be reverted when the font is updated with the correct
61
- // baseline
62
-
63
- // top: 0;
64
- // bottom: 0;
65
-
66
- top: -1px;
67
- bottom: 1px;
68
-
69
- // End adjustments for font baseline offset
59
+ @if $govuk-use-legacy-font {
60
+ // Begin adjustments for font baseline offset
61
+ // These should be removed when legacy font support is dropped
62
+ top: -1px;
63
+ bottom: 1px;
64
+
65
+ } @else {
66
+ top: 0;
67
+ bottom: 0;
68
+ }
70
69
 
71
70
  // Offset by the difference between the width of the non-rotated square
72
71
  // and its width when rotated
@@ -3,14 +3,13 @@
3
3
  @import "../../helpers/all";
4
4
 
5
5
  @include govuk-exports("govuk/component/button") {
6
- // Primary button variables
7
- $govuk-button-colour: #00823b; // sass-lint:disable no-color-literals
6
+ $govuk-button-colour: govuk-colour("green", $legacy: #00823b); // sass-lint:disable no-color-literals
8
7
  $govuk-button-hover-colour: govuk-shade($govuk-button-colour, 20%);
9
8
  $govuk-button-shadow-colour: govuk-shade($govuk-button-colour, 60%);
10
9
  $govuk-button-text-colour: govuk-colour("white");
11
10
 
12
11
  // Secondary button variables
13
- $govuk-secondary-button-colour: govuk-colour("grey-3");
12
+ $govuk-secondary-button-colour: govuk-colour("light-grey", $legacy: "grey-3");
14
13
  $govuk-secondary-button-hover-colour: govuk-shade($govuk-secondary-button-colour, 10%);
15
14
  $govuk-secondary-button-shadow-colour: govuk-shade($govuk-secondary-button-colour, 40%);
16
15
  $govuk-secondary-button-text-colour: govuk-colour("black");
@@ -28,7 +27,6 @@
28
27
 
29
28
  .govuk-button {
30
29
  @include govuk-font($size: 19, $line-height: 19px);
31
- @include govuk-focusable;
32
30
 
33
31
  box-sizing: border-box;
34
32
  display: inline-block;
@@ -36,7 +34,7 @@
36
34
  width: 100%;
37
35
  margin-top: 0;
38
36
  @include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2
39
- padding: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)) govuk-spacing(2); // s1
37
+ padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2) (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)); // s1
40
38
  border: $govuk-border-width-form-element solid transparent;
41
39
  border-radius: 0;
42
40
  color: $govuk-button-text-colour;
@@ -64,37 +62,49 @@
64
62
  text-decoration: none;
65
63
  }
66
64
 
67
- // alphagov/govuk_template includes a specific a:link:focus selector
68
- // designed to make unvisited links a slightly darker blue when focussed, so
69
- // we need to override the text colour for that combination of selectors so
70
- // so that unvisited links styled as buttons do not end up with dark blue
71
- // text when focussed.
72
- @include govuk-compatibility(govuk_template) {
73
- &:link:focus {
74
- color: $govuk-button-text-colour;
75
- }
76
- }
77
-
78
65
  // Fix unwanted button padding in Firefox
79
66
  &::-moz-focus-inner {
80
67
  padding: 0;
81
68
  border: 0;
82
69
  }
83
70
 
84
- &:hover,
85
- &:focus {
71
+ &:hover {
86
72
  background-color: $govuk-button-hover-colour;
87
73
  }
88
74
 
89
75
  &:active {
76
+ // Bump the button down so it looks like its being pressed in
90
77
  top: $button-shadow-size;
91
- box-shadow: none;
92
78
 
93
79
  @include govuk-if-ie8 {
94
80
  border-bottom-width: 0;
95
81
  }
96
82
  }
97
83
 
84
+ &:focus {
85
+ border-color: $govuk-focus-colour;
86
+ // When colours are overridden, for example when users have a dark mode,
87
+ // backgrounds and box-shadows disappear, so we need to ensure there's a
88
+ // transparent outline which will be set to a visible colour.
89
+ // Since Internet Explorer 8 does not support box-shadow, we want to force the user-agent outlines
90
+ @include govuk-not-ie8 {
91
+ outline: $govuk-focus-width solid transparent;
92
+ }
93
+ // Since Internet Explorer does not support `:not()` we set a clearer focus style to match user-agent outlines.
94
+ @include govuk-if-ie8 {
95
+ color: $govuk-focus-text-colour;
96
+ background-color: $govuk-focus-colour;
97
+ }
98
+ box-shadow: inset 0 0 0 1px $govuk-focus-colour;
99
+ }
100
+
101
+ &:focus:not(:active):not(:hover) {
102
+ border-color: $govuk-focus-colour;
103
+ color: $govuk-focus-text-colour;
104
+ background-color: $govuk-focus-colour;
105
+ box-shadow: 0 2px 0 $govuk-focus-text-colour;
106
+ }
107
+
98
108
  // The following adjustments do not work for <input type="button"> as
99
109
  // non-container elements cannot include pseudo elements (i.e. ::before).
100
110
 
@@ -175,8 +185,7 @@
175
185
  }
176
186
  }
177
187
 
178
- &:hover,
179
- &:focus {
188
+ &:hover {
180
189
  background-color: $govuk-secondary-button-hover-colour;
181
190
 
182
191
  &[disabled] {
@@ -208,8 +217,7 @@
208
217
  }
209
218
  }
210
219
 
211
- &:hover,
212
- &:focus {
220
+ &:hover {
213
221
  background-color: $govuk-warning-button-hover-colour;
214
222
 
215
223
  &[disabled] {
@@ -222,35 +230,50 @@
222
230
  @include govuk-typography-weight-bold;
223
231
  @include govuk-typography-responsive($size: 24, $override-line-height: 1);
224
232
 
233
+ display: -webkit-inline-box;
234
+
235
+ display: -webkit-inline-flex;
236
+
237
+ display: -ms-inline-flexbox;
238
+
239
+ display: inline-flex;
225
240
  min-height: auto;
226
- padding-top: govuk-spacing(2) - $govuk-border-width-form-element;
227
- padding-right: govuk-spacing(7);
228
- padding-bottom: govuk-spacing(2) - $govuk-border-width-form-element;
229
- padding-left: govuk-spacing(3);
230
-
231
- background-image: govuk-image-url("icon-pointer.png");
232
- background-repeat: no-repeat;
233
- background-position: 100% 50%;
234
-
235
- @include govuk-device-pixel-ratio {
236
- background-image: govuk-image-url("icon-pointer-2x.png");
237
- background-size: 30px 19px;
238
- }
239
- }
240
241
 
241
- // Begin adjustments for font baseline offset
242
- // These should be removed when the font is updated with the correct baseline
243
- // For the 1px addition please see https://github.com/alphagov/govuk-frontend/pull/365#discussion_r154349428
242
+ -webkit-box-pack: center;
244
243
 
245
- $offset: 2;
244
+ -webkit-justify-content: center;
246
245
 
247
- .govuk-button {
248
- padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
249
- padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
246
+ -ms-flex-pack: center;
247
+
248
+ justify-content: center;
250
249
  }
251
250
 
252
- .govuk-button--start {
253
- padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
254
- padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
251
+ .govuk-button__start-icon {
252
+ margin-left: govuk-spacing(1);
253
+
254
+ @include govuk-media-query($from: desktop) {
255
+ margin-left: govuk-spacing(2);
256
+ }
257
+ vertical-align: middle;
258
+ -webkit-flex-shrink: 0;
259
+ -ms-flex-negative: 0;
260
+ flex-shrink: 0;
261
+ -webkit-align-self: center;
262
+ -ms-flex-item-align: center;
263
+ align-self: center;
264
+ }
265
+
266
+ @if $govuk-use-legacy-font {
267
+ // Begin adjustments for font baseline offset when using v1 of nta
268
+ $offset: 2;
269
+
270
+ .govuk-button {
271
+ padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
272
+ padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
273
+ }
274
+
275
+ .govuk-button__start-icon {
276
+ margin-top: -3px;
277
+ }
255
278
  }
256
279
  }
@@ -127,11 +127,7 @@
127
127
 
128
128
  // Focused state
129
129
  .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
130
- // Since box-shadows are removed when users customise their colours, we set
131
- // a transparent outline that is shown instead.
132
- // https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
133
- outline: $govuk-focus-width solid transparent;
134
- outline-offset: $govuk-focus-width;
130
+ border-width: 4px;
135
131
  box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
136
132
  }
137
133
 
@@ -154,7 +150,9 @@
154
150
  // Conditional reveals
155
151
  // =========================================================
156
152
 
157
- $conditional-border-width: $govuk-border-width-mobile;
153
+ // The narrow border is used in the conditional reveals because the border has
154
+ // to be an even number in order to be centred under the 40px checkbox or radio.
155
+ $conditional-border-width: $govuk-border-width-narrow;
158
156
  // Calculate the amount of padding needed to keep the border centered against the checkbox.
159
157
  $conditional-border-padding: ($govuk-checkboxes-size / 2) - ($conditional-border-width / 2);
160
158
  // Move the border centered with the checkbox
@@ -27,6 +27,14 @@
27
27
  // Style the summary to look like a link...
28
28
  color: $govuk-link-colour;
29
29
  cursor: pointer;
30
+
31
+ &:hover {
32
+ color: $govuk-link-hover-colour;
33
+ }
34
+
35
+ &:focus {
36
+ @include govuk-focused-text;
37
+ }
30
38
  }
31
39
 
32
40
  // ...but only underline the text, not the arrow
@@ -34,18 +42,9 @@
34
42
  text-decoration: underline;
35
43
  }
36
44
 
37
- .govuk-details__summary:hover {
38
- color: $govuk-link-hover-colour;
39
- }
40
-
41
- .govuk-details__summary:focus {
42
- // -1px offset fixes gap between background and outline in Firefox
43
- outline: ($govuk-focus-width + 1px) solid $govuk-focus-colour;
44
- outline-offset: -1px;
45
- // When focussed, the text colour needs to be darker to ensure that colour
46
- // contrast is still acceptable
47
- color: $govuk-focus-text-colour;
48
- background: $govuk-focus-colour;
45
+ // Remove the underline when focussed to avoid duplicate borders
46
+ .govuk-details__summary:focus .govuk-details__summary-text {
47
+ text-decoration: none;
49
48
  }
50
49
 
51
50
  // Remove the default details marker so we can style our own consistently and
@@ -59,7 +58,7 @@
59
58
  content: "";
60
59
  position: absolute;
61
60
 
62
- top: 0;
61
+ top: -1px;
63
62
  bottom: 0;
64
63
  left: 0;
65
64
 
@@ -10,12 +10,11 @@
10
10
  @include govuk-text-colour;
11
11
  @include govuk-responsive-padding(4);
12
12
  @include govuk-responsive-margin(8, "bottom");
13
- @include govuk-focusable;
14
13
 
15
- border: $govuk-border-width-mobile solid $govuk-error-colour;
14
+ border: $govuk-border-width solid $govuk-error-colour;
16
15
 
17
- @include govuk-media-query($from: tablet) {
18
- border: $govuk-border-width solid $govuk-error-colour;
16
+ &:focus {
17
+ outline: $govuk-focus-width solid $govuk-focus-colour;
19
18
  }
20
19
  }
21
20
 
@@ -42,7 +41,6 @@
42
41
  }
43
42
 
44
43
  .govuk-error-summary__list a {
45
- @include govuk-focusable-fill;
46
44
  @include govuk-typography-weight-bold;
47
45
 
48
46
  // Override default link styling to use error colour
@@ -53,19 +51,8 @@
53
51
  color: $govuk-error-colour;
54
52
  }
55
53
 
56
- // When focussed, the text colour needs to be darker to ensure that colour
57
- // contrast is still acceptable
58
54
  &:focus {
59
- color: $govuk-focus-text-colour;
60
- }
61
-
62
- // alphagov/govuk_template includes a specific a:link:focus selector
63
- // designed to make unvisited links a slightly darker blue when focussed, so
64
- // we need to override the text colour for that combination of selectors.
65
- @include govuk-compatibility(govuk_template) {
66
- &:link:focus {
67
- color: $govuk-error-colour;
68
- }
55
+ @include govuk-focused-text;
69
56
  }
70
57
  }
71
58
 
@@ -7,13 +7,75 @@
7
7
  @import "../label/label";
8
8
 
9
9
  @include govuk-exports("govuk/component/file-upload") {
10
+ $component-padding: govuk-spacing(1);
11
+
10
12
  .govuk-file-upload {
11
13
  @include govuk-font($size: 19);
12
14
  @include govuk-text-colour;
13
- @include govuk-focusable;
15
+ padding-top: $component-padding;
16
+ padding-bottom: $component-padding;
17
+
18
+ &:focus {
19
+ // "Yank" the padding with negative margin to avoid a jump
20
+ // when element is focused
21
+ margin-right: -$component-padding;
22
+ margin-left: -$component-padding;
23
+ padding-right: $component-padding;
24
+ padding-left: $component-padding;
25
+
26
+ outline: $govuk-focus-width solid $govuk-focus-colour;
27
+ // Use `box-shadow` to add border instead of changing `border-width`
28
+ // (which changes element size) and since `outline` is already used for the
29
+ // yellow focus state.
30
+ box-shadow: inset 0 0 0 4px $govuk-input-border-colour;
31
+
32
+ @include govuk-if-ie8 {
33
+ // IE8 doesn't support `box-shadow` so add an actual border
34
+ border: 4px solid $govuk-input-border-colour;
35
+ }
36
+ }
37
+
38
+ // Set "focus-within" to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1430196
39
+ // so that component receives focus in Firefox.
40
+ // This can't be set together with `:focus` as all versions of IE fail
41
+ // to recognise `focus-within` and don't set any styles from the block
42
+ // when it's a selector.
43
+ &:focus-within {
44
+ margin-right: -$component-padding;
45
+ margin-left: -$component-padding;
46
+ padding-right: $component-padding;
47
+ padding-left: $component-padding;
48
+
49
+ outline: $govuk-focus-width solid $govuk-focus-colour;
50
+
51
+ box-shadow: inset 0 0 0 4px $govuk-input-border-colour;
52
+ }
14
53
  }
15
54
 
16
55
  .govuk-file-upload--error {
56
+ // As `upload--error` has border, it needs to have the same padding as
57
+ // the standard focused element.
58
+ margin-right: -$component-padding;
59
+ margin-left: -$component-padding;
60
+ padding-right: $component-padding;
61
+ padding-left: $component-padding;
17
62
  border: $govuk-border-width-form-element-error solid $govuk-error-colour;
63
+
64
+ &:focus {
65
+ border-color: $govuk-input-border-colour;
66
+ // Remove `box-shadow` inherited from `:focus` as `file-upload--error`
67
+ // already has the thicker border.
68
+ box-shadow: none;
69
+ }
70
+
71
+ // Repeat `:focus` styles to prevent error styles from being applied when
72
+ // input button is pressed as this moves the focus to "within".
73
+ // This can't be set together with `:focus` as all versions of IE fail
74
+ // to recognise `focus-within` and don't set any styles from the block
75
+ // when it's a selector.
76
+ &:focus-within {
77
+ border-color: $govuk-input-border-colour;
78
+ box-shadow: none;
79
+ }
18
80
  }
19
81
  }
@@ -7,11 +7,24 @@
7
7
  @include govuk-exports("govuk/component/footer") {
8
8
 
9
9
  $govuk-footer-background: $govuk-canvas-background-colour;
10
- $govuk-footer-border-top: #a1acb2;
11
- $govuk-footer-border: govuk-colour("grey-2");
12
- $govuk-footer-text: #454a4c;
10
+ $govuk-footer-border: $govuk-border-colour;
11
+ // This variable can be removed entirely once the legacy palette goes away,
12
+ // as it'll just be the same as $govuk-footer-border.
13
+ $govuk-footer-border-top: $govuk-border-colour;
14
+ $govuk-footer-text: $govuk-text-colour;
13
15
  $govuk-footer-link: $govuk-footer-text;
14
- $govuk-footer-link-hover: #171819;
16
+ $govuk-footer-link-hover: false;
17
+
18
+ @if ($govuk-use-legacy-palette) {
19
+ // sass-lint:disable no-color-literals
20
+ $govuk-footer-border-top: #a1acb2;
21
+ $govuk-footer-border: govuk-colour("grey-2");
22
+ $govuk-footer-text: #454a4c;
23
+ $govuk-footer-link: $govuk-footer-text;
24
+
25
+ // Only used with the legacy palette
26
+ $govuk-footer-link-hover: #171819;
27
+ }
15
28
 
16
29
  // Based on the govuk-crest-2x.png image dimensions.
17
30
  $govuk-footer-crest-image-width-2x: 250px;
@@ -31,22 +44,27 @@
31
44
  }
32
45
 
33
46
  .govuk-footer__link {
34
- @include govuk-focusable-fill;
35
-
36
- &:link,
37
- &:visited {
38
- color: $govuk-footer-link;
39
- }
47
+ @if ($govuk-use-legacy-palette) {
48
+ &:link,
49
+ &:visited {
50
+ color: $govuk-footer-link;
51
+ }
40
52
 
41
- &:hover,
42
- &:active {
43
- color: $govuk-footer-link-hover;
53
+ &:hover,
54
+ &:active {
55
+ color: $govuk-footer-link-hover;
56
+ }
57
+ } @else {
58
+ &:link,
59
+ &:visited,
60
+ &:hover,
61
+ &:active {
62
+ color: $govuk-footer-link;
63
+ }
44
64
  }
45
65
 
46
- // When focussed, the text colour needs to be darker to ensure that colour
47
- // contrast is still acceptable
48
66
  &:focus {
49
- color: $govuk-focus-text-colour;
67
+ @include govuk-focused-text;
50
68
  }
51
69
 
52
70
  // alphagov/govuk_template includes a specific a:link:focus selector
@@ -59,6 +77,19 @@
59
77
  }
60
78
  }
61
79
 
80
+ // Internet Explorer 8 does not support `:not()` selectors, so don't conditionally show underlines.
81
+ @include govuk-not-ie8 {
82
+ .govuk-footer__inline-list .govuk-footer__link,
83
+ .govuk-footer__list .govuk-footer__link {
84
+ text-decoration: none;
85
+
86
+ &:hover:not(:focus),
87
+ &:active:not(:focus) {
88
+ text-decoration: underline;
89
+ }
90
+ }
91
+ }
92
+
62
93
  .govuk-footer__section-break {
63
94
  margin: 0; // Reset `<hr>` default margins
64
95
  @include govuk-responsive-margin(8, "bottom");
@@ -46,9 +46,11 @@
46
46
  }
47
47
 
48
48
  .govuk-header__logotype-crown {
49
+ position: relative;
50
+ top: -1px;
49
51
  margin-right: 1px;
50
52
  fill: currentColor;
51
- vertical-align: middle;
53
+ vertical-align: top;
52
54
  }
53
55
 
54
56
  .govuk-header__logotype-crown-fallback-image {
@@ -59,14 +61,12 @@
59
61
  }
60
62
 
61
63
  .govuk-header__product-name {
62
- @include govuk-font($size: 24);
64
+ @include govuk-font($size: 24, $line-height: 1);
63
65
  display: inline-table;
64
66
  padding-right: govuk-spacing(2);
65
67
  }
66
68
 
67
69
  .govuk-header__link {
68
- @include govuk-focusable-fill;
69
-
70
70
  text-decoration: none;
71
71
 
72
72
  &:link,
@@ -78,10 +78,8 @@
78
78
  text-decoration: underline;
79
79
  }
80
80
 
81
- // When focussed, the text colour needs to be darker to ensure that colour
82
- // contrast is still acceptable
83
81
  &:focus {
84
- color: $govuk-focus-text-colour;
82
+ @include govuk-focused-text;
85
83
  }
86
84
 
87
85
  // alphagov/govuk_template includes a specific a:link:focus selector
@@ -101,7 +99,7 @@
101
99
 
102
100
  display: inline-block;
103
101
  font-size: 30px; // We don't have a mixin that produces 30px font size
104
- line-height: 30px;
102
+ line-height: 1;
105
103
 
106
104
  &:link,
107
105
  &:visited {
@@ -116,6 +114,12 @@
116
114
  // specified currentColor explicitly IE8 would ignore this rule.
117
115
  border-bottom: 1px solid;
118
116
  }
117
+
118
+ // Remove any borders that show when focused and hovered.
119
+ &:focus {
120
+ margin-bottom: 0;
121
+ border-bottom: 0;
122
+ }
119
123
  }
120
124
 
121
125
  .govuk-header__link--service-name {
@@ -165,14 +169,16 @@
165
169
  text-decoration: underline;
166
170
  }
167
171
 
172
+ &:focus {
173
+ @include govuk-focused-text;
174
+ }
175
+
168
176
  &::after {
169
177
  @include govuk-shape-arrow($direction: down, $base: 10px, $display: inline-block);
170
178
  content: "";
171
179
  margin-left: govuk-spacing(1);
172
180
  }
173
181
 
174
- @include govuk-focusable;
175
-
176
182
  @include mq ($from: tablet) {
177
183
  top: govuk-spacing(3);
178
184
  }
@@ -287,17 +293,25 @@
287
293
  }
288
294
  }
289
295
 
290
- // Begin adjustments for font baseline offset
291
- // These should be removed when the font is updated with the correct baseline
292
- .govuk-header__logotype-crown {
293
- position: relative;
294
- top: -4px;
295
- }
296
+ @if $govuk-use-legacy-font {
297
+ // Begin adjustments for font baseline offset
298
+ // These should be removed when the font is updated with the correct baseline
299
+ .govuk-header__logotype-crown,
300
+ .govuk-header__logotype-crown-fallback-image {
301
+ position: relative;
302
+ top: -4px;
303
+ vertical-align: middle;
304
+ }
296
305
 
297
- .govuk-header {
298
- $offset: 3px;
299
- padding-top: $offset;
306
+ .govuk-header {
307
+ $offset: 3px;
308
+ padding-top: $offset;
309
+ }
310
+
311
+ .govuk-header__link--homepage {
312
+ line-height: 30px;
313
+ }
314
+ // End adjustments
300
315
  }
301
- // End adjustments
302
316
 
303
317
  }