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
@@ -6,21 +6,40 @@
6
6
  display: table;
7
7
  width: 100%;
8
8
  table-layout: fixed; // Required to allow us to wrap words that overflow.
9
+ border-collapse: collapse;
9
10
  }
10
11
  margin: 0; // Reset default user agent styles
11
12
  @include govuk-responsive-margin(6, "bottom");
12
13
  }
13
14
 
14
15
  .govuk-summary-list__row {
16
+ border-bottom: 1px solid $govuk-border-colour;
17
+
15
18
  @include govuk-media-query($until: tablet) {
16
19
  margin-bottom: govuk-spacing(3);
17
- border-bottom: 1px solid $govuk-border-colour;
18
20
  }
19
21
  @include govuk-media-query($from: tablet) {
20
22
  display: table-row;
21
23
  }
22
24
  }
23
25
 
26
+ // Remove right padding from the last column in the row
27
+ .govuk-summary-list__row:not(.govuk-summary-list__row--no-actions) > :last-child {
28
+ padding-right: 0;
29
+ }
30
+
31
+ // Provide an empty 'cell' for rows that don't have actions – otherwise the
32
+ // bottom border is not drawn for that part of the row in some browsers.
33
+ .govuk-summary-list__row--no-actions {
34
+ @include govuk-media-query($from: tablet) {
35
+ &:after {
36
+ content: "";
37
+ display: table-cell;
38
+ width: 20%;
39
+ }
40
+ }
41
+ }
42
+
24
43
  .govuk-summary-list__key,
25
44
  .govuk-summary-list__value,
26
45
  .govuk-summary-list__actions {
@@ -31,7 +50,6 @@
31
50
  padding-top: govuk-spacing(2);
32
51
  padding-right: govuk-spacing(4);
33
52
  padding-bottom: govuk-spacing(2);
34
- border-bottom: 1px solid $govuk-border-colour;
35
53
  }
36
54
  }
37
55
 
@@ -39,7 +57,7 @@
39
57
  margin-bottom: govuk-spacing(3);
40
58
  @include govuk-media-query($from: tablet) {
41
59
  width: 20%;
42
- padding-right: 0;
60
+ padding-right: 0; // Needed for IE8
43
61
  text-align: right;
44
62
  }
45
63
  }
@@ -63,16 +81,6 @@
63
81
  @include govuk-media-query($until: tablet) {
64
82
  margin-bottom: govuk-spacing(3);
65
83
  }
66
- @include govuk-media-query($from: tablet) {
67
- width: 50%;
68
- }
69
- }
70
-
71
- // Expand width when value is last column (no action)
72
- .govuk-summary-list__value:last-child {
73
- @include govuk-media-query($from: tablet) {
74
- width: 70%;
75
- }
76
84
  }
77
85
 
78
86
  .govuk-summary-list__value > p {
@@ -90,56 +98,179 @@
90
98
  }
91
99
 
92
100
  .govuk-summary-list__actions-list-item {
93
- display: inline;
94
- margin-right: govuk-spacing(2);
95
- padding-right: govuk-spacing(2);
101
+ display: inline-block;
96
102
  }
97
103
 
98
104
  // In older browsers such as IE8, :last-child is not available,
99
105
  // so only show the border divider where it is available.
100
- .govuk-summary-list__actions-list-item:not(:last-child) {
101
- border-right: 1px solid $govuk-border-colour;
106
+ @include govuk-media-query($until: tablet) {
107
+ .govuk-summary-list__actions-list-item {
108
+ margin-right: govuk-spacing(2);
109
+ padding-right: govuk-spacing(2);
110
+ }
111
+
112
+ .govuk-summary-list__actions-list-item:not(:last-child) {
113
+ border-right: 1px solid $govuk-border-colour;
114
+ }
115
+
116
+ .govuk-summary-list__actions-list-item:last-child {
117
+ margin-right: 0;
118
+ padding-right: 0;
119
+ border: 0;
120
+ }
102
121
  }
103
122
 
104
- .govuk-summary-list__actions-list-item:last-child {
105
- margin-right: 0;
106
- padding-right: 0;
107
- border: 0;
123
+ @include govuk-media-query($from: tablet) {
124
+ .govuk-summary-list__actions-list-item {
125
+ margin-left: govuk-spacing(2);
126
+ padding-left: govuk-spacing(2);
127
+ }
128
+
129
+ .govuk-summary-list__actions-list-item:not(:first-child) {
130
+ border-left: 1px solid $govuk-border-colour;
131
+ }
132
+
133
+ .govuk-summary-list__actions-list-item:first-child {
134
+ margin-left: 0;
135
+ padding-left: 0;
136
+ border: 0;
137
+ }
108
138
  }
109
139
 
110
140
  // No border on entire summary list
111
141
  .govuk-summary-list--no-border {
112
- @include govuk-media-query($until: tablet) {
113
- .govuk-summary-list__row {
114
- border: 0;
115
- }
142
+ .govuk-summary-list__row {
143
+ border: 0;
116
144
  }
117
145
 
146
+ // Increase padding by 1px to compensate for 'missing' border
118
147
  @include govuk-media-query($from: tablet) {
119
148
  .govuk-summary-list__key,
120
149
  .govuk-summary-list__value,
121
150
  .govuk-summary-list__actions {
122
- // Remove 1px border, add 1px height back on
123
151
  padding-bottom: govuk-spacing(2) + 1px;
124
- border: 0;
125
152
  }
126
153
  }
127
154
  }
128
155
 
129
156
  // No border on specific rows
130
157
  .govuk-summary-list__row--no-border {
131
- @include govuk-media-query($until: tablet) {
132
- border: 0;
133
- }
158
+ border: 0;
134
159
 
160
+ // Increase padding by 1px to compensate for 'missing' border
135
161
  @include govuk-media-query($from: tablet) {
136
162
  .govuk-summary-list__key,
137
163
  .govuk-summary-list__value,
138
164
  .govuk-summary-list__actions {
139
- // Remove 1px border, add 1px height back on
140
165
  padding-bottom: govuk-spacing(2) + 1px;
141
- border: 0;
142
166
  }
143
167
  }
144
168
  }
169
+
170
+ // Additional block for the summary card
171
+ .govuk-summary-card {
172
+ @include govuk-responsive-margin(6, "bottom");
173
+ border: 1px solid $govuk-border-colour;
174
+ }
175
+
176
+ .govuk-summary-card__title-wrapper {
177
+ padding: govuk-spacing(3);
178
+
179
+ // Ensures the card header appears separate to the summary list in forced colours mode
180
+ border-bottom: 1px solid transparent;
181
+ background-color: govuk-colour("light-grey", $legacy: "grey-3");
182
+
183
+ @include govuk-media-query($from: "tablet") {
184
+ display: -ms-flexbox;
185
+ display: flex;
186
+ -ms-flex-pack: justify;
187
+ justify-content: space-between;
188
+ -ms-flex-wrap: nowrap;
189
+ flex-wrap: nowrap;
190
+ padding: govuk-spacing(3) govuk-spacing(4);
191
+ }
192
+ }
193
+
194
+ .govuk-summary-card__title {
195
+ @include govuk-font($size: 19, $weight: bold);
196
+ margin: govuk-spacing(1) govuk-spacing(4) govuk-spacing(2) 0;
197
+
198
+ @include govuk-media-query($from: "tablet") {
199
+ margin-bottom: govuk-spacing(1);
200
+ }
201
+ }
202
+
203
+ .govuk-summary-card__actions {
204
+ @include govuk-font($size: 19, $weight: bold);
205
+ display: -ms-flexbox;
206
+ display: flex;
207
+ -ms-flex-wrap: wrap;
208
+ flex-wrap: wrap;
209
+ row-gap: 10px;
210
+ margin: govuk-spacing(1) 0;
211
+ padding: 0;
212
+ list-style: none;
213
+
214
+ @include govuk-media-query($from: "tablet") {
215
+ -ms-flex-pack: right;
216
+ justify-content: right;
217
+ text-align: right;
218
+ }
219
+ }
220
+
221
+ .govuk-summary-card__action {
222
+ display: inline;
223
+ margin: 0 govuk-spacing(2) 0 0;
224
+ padding-right: govuk-spacing(2);
225
+ border-right: 1px solid $govuk-border-colour;
226
+
227
+ @include govuk-media-query($from: "tablet") {
228
+ margin-right: 0;
229
+ }
230
+
231
+ // We use the following media query to target IE11 and 10 only to add margin
232
+ // between actions.
233
+ //
234
+ // We do this because we're using row-gap to create space between actions on
235
+ // more evergreen browsers which IE doesn't support. @supports currently isn't
236
+ // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.
237
+ //
238
+ // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860
239
+ // which also includes an explanation of why this works
240
+ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
241
+ margin-bottom: govuk-spacing(1);
242
+ }
243
+ }
244
+
245
+ .govuk-summary-card__action:last-child {
246
+ margin: 0;
247
+ padding-right: 0;
248
+ border-right: none;
249
+
250
+ @include govuk-media-query($from: "tablet") {
251
+ padding-left: govuk-spacing(2);
252
+ }
253
+
254
+ // See above comment for why this is here
255
+ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
256
+ margin-bottom: 0;
257
+ }
258
+ }
259
+
260
+ .govuk-summary-card__content {
261
+ padding: govuk-spacing(3) govuk-spacing(3) 0;
262
+
263
+ @include govuk-media-query($from: "tablet") {
264
+ padding: govuk-spacing(3) govuk-spacing(4);
265
+ }
266
+
267
+ .govuk-summary-list {
268
+ margin-bottom: 0;
269
+ }
270
+
271
+ .govuk-summary-list__row:last-of-type {
272
+ margin-bottom: 0;
273
+ border-bottom: none;
274
+ }
275
+ }
145
276
  }
@@ -21,7 +21,7 @@
21
21
  vertical-align: top;
22
22
  // GOV.UK Elements sets the font-size and line-height for all headers and cells
23
23
  // in tables.
24
- @include govuk-compatibility(govuk_elements) {
24
+ @include _govuk-compatibility(govuk_elements) {
25
25
  font-size: inherit;
26
26
  line-height: inherit;
27
27
  }
@@ -24,7 +24,7 @@
24
24
  &:before {
25
25
  @include govuk-text-colour;
26
26
  content: "\2014 "; // "— "
27
- margin-left: - govuk-spacing(5);
27
+ margin-left: govuk-spacing(-5);
28
28
  padding-right: govuk-spacing(1);
29
29
  }
30
30
  }
@@ -77,7 +77,7 @@
77
77
 
78
78
  position: relative;
79
79
 
80
- margin-top: - govuk-spacing(1);
80
+ margin-top: govuk-spacing(-1);
81
81
 
82
82
  // Compensation for border (otherwise we get a shift)
83
83
  margin-bottom: -$border-width;
@@ -34,53 +34,48 @@
34
34
  }
35
35
  }
36
36
 
37
- // Deprecated. We'll remove this class in a future release. Use `.govuk-tag--grey` instead.
38
- .govuk-tag--inactive {
39
- background-color: govuk-colour("dark-grey", $legacy: "grey-1");
40
- }
41
-
42
37
  .govuk-tag--grey {
43
- color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30);
44
- background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90);
38
+ color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30%);
39
+ background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90%);
45
40
  }
46
41
 
47
42
  .govuk-tag--purple {
48
- color: govuk-shade(govuk-colour("purple"), 20);
49
- background: govuk-tint(govuk-colour("purple"), 80);
43
+ color: govuk-shade(govuk-colour("purple"), 20%);
44
+ background: govuk-tint(govuk-colour("purple"), 80%);
50
45
  }
51
46
 
52
47
  .govuk-tag--turquoise {
53
- color: govuk-shade(govuk-colour("turquoise"), 60);
54
- background: govuk-tint(govuk-colour("turquoise"), 70);
48
+ color: govuk-shade(govuk-colour("turquoise"), 60%);
49
+ background: govuk-tint(govuk-colour("turquoise"), 70%);
55
50
  }
56
51
 
57
52
  .govuk-tag--blue {
58
- color: govuk-shade(govuk-colour("blue"), 30);
59
- background: govuk-tint(govuk-colour("blue"), 80);
53
+ color: govuk-shade(govuk-colour("blue"), 30%);
54
+ background: govuk-tint(govuk-colour("blue"), 80%);
60
55
  }
61
56
 
62
57
  .govuk-tag--yellow {
63
- color: govuk-shade(govuk-colour("yellow"), 65);
64
- background: govuk-tint(govuk-colour("yellow"), 75);
58
+ color: govuk-shade(govuk-colour("yellow"), 65%);
59
+ background: govuk-tint(govuk-colour("yellow"), 75%);
65
60
  }
66
61
 
67
62
  .govuk-tag--orange {
68
- color: govuk-shade(govuk-colour("orange"), 55);
69
- background: govuk-tint(govuk-colour("orange"), 70);
63
+ color: govuk-shade(govuk-colour("orange"), 55%);
64
+ background: govuk-tint(govuk-colour("orange"), 70%);
70
65
  }
71
66
 
72
67
  .govuk-tag--red {
73
- color: govuk-shade(govuk-colour("red"), 30);
74
- background: govuk-tint(govuk-colour("red"), 80);
68
+ color: govuk-shade(govuk-colour("red"), 30%);
69
+ background: govuk-tint(govuk-colour("red"), 80%);
75
70
  }
76
71
 
77
72
  .govuk-tag--pink {
78
- color: govuk-shade(govuk-colour("pink"), 40);
79
- background: govuk-tint(govuk-colour("pink"), 80);
73
+ color: govuk-shade(govuk-colour("pink"), 40%);
74
+ background: govuk-tint(govuk-colour("pink"), 80%);
80
75
  }
81
76
 
82
77
  .govuk-tag--green {
83
- color: govuk-shade(govuk-colour("green"), 20);
84
- background: govuk-tint(govuk-colour("green"), 80);
78
+ color: govuk-shade(govuk-colour("green"), 20%);
79
+ background: govuk-tint(govuk-colour("green"), 80%);
85
80
  }
86
81
  }
@@ -29,16 +29,23 @@
29
29
  // since `outline` is already used for the yellow focus state.
30
30
  box-shadow: inset 0 0 0 $govuk-border-width-form-element;
31
31
 
32
- @include govuk-if-ie8 {
32
+ @include _govuk-if-ie8 {
33
33
  // IE8 doesn't support `box-shadow` so double the border with
34
34
  // `border-width`.
35
35
  border-width: $govuk-border-width-form-element * 2;
36
36
  }
37
37
  }
38
+
39
+ &:disabled {
40
+ opacity: .5;
41
+ color: inherit;
42
+ background-color: transparent;
43
+ cursor: not-allowed;
44
+ }
38
45
  }
39
46
 
40
47
  .govuk-textarea--error {
41
- border: $govuk-border-width-form-element-error solid $govuk-error-colour;
48
+ border-color: $govuk-error-colour;
42
49
 
43
50
  &:focus {
44
51
  border-color: $govuk-input-border-colour;
@@ -1,6 +1,6 @@
1
+ @import "govuk-frontend-version";
1
2
  @import "links";
2
3
  @import "lists";
3
- @import "template";
4
4
  @import "typography";
5
5
  @import "section-break";
6
6
  @import "global-styles";
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @import "links";
8
2
  @import "typography";
9
3
 
@@ -0,0 +1,5 @@
1
+ :root {
2
+ // This variable is automatically overwritten during builds and releases.
3
+ // It doesn't need to be updated manually.
4
+ --govuk-frontend-version: "4.6.0";
5
+ }
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/links") {
8
2
 
9
3
  %govuk-link {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/lists") {
8
2
 
9
3
  %govuk-list {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/section-break") {
8
2
 
9
3
  %govuk-section-break {
@@ -12,7 +6,7 @@
12
6
 
13
7
  // fix double-width section break and forced visible section break
14
8
  // when combined with styles from alphagov/elements
15
- @include govuk-compatibility(govuk_elements) {
9
+ @include _govuk-compatibility(govuk_elements) {
16
10
  height: 0;
17
11
  }
18
12
  }
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/typography") {
8
2
 
9
3
  // Headings
@@ -8,7 +8,7 @@
8
8
 
9
9
  /// Get colour
10
10
  ///
11
- /// @param {String} $colour - Name of colour from the colour palette
11
+ /// @param {String | Colour} $colour - Name of colour from the colour palette
12
12
  /// (`$govuk-colours`)
13
13
  /// @param {String} $legacy - Either the name of colour from the legacy palette
14
14
  /// or a colour literal, to return instead when in 'legacy mode' - matching
@@ -29,14 +29,17 @@
29
29
  /// @access public
30
30
 
31
31
  @function govuk-colour($colour, $legacy: false) {
32
- @if ($govuk-use-legacy-palette and $legacy) {
33
- @if (type-of($legacy) == "color") {
32
+ @if $govuk-use-legacy-palette and $legacy {
33
+ @if type-of($legacy) == "color" {
34
34
  @return $legacy;
35
35
  }
36
36
  $colour: $legacy;
37
37
  }
38
38
 
39
- $colour: quote($colour);
39
+ @if type-of($colour) == "color" {
40
+ // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside
41
+ $colour: quote("#{$colour}");
42
+ }
40
43
 
41
44
  @if not map-has-key($govuk-colours, $colour) {
42
45
  @error "Unknown colour `#{$colour}`";
@@ -65,7 +68,7 @@
65
68
 
66
69
  $org-colour: map-get($govuk-colours-organisations, $organisation);
67
70
 
68
- @if ($websafe and map-has-key($org-colour, colour-websafe)) {
71
+ @if $websafe and map-has-key($org-colour, colour-websafe) {
69
72
  @return map-get($org-colour, colour-websafe);
70
73
  } @else {
71
74
  @return map-get($org-colour, colour);
@@ -75,7 +78,7 @@
75
78
  /// Make a colour darker by mixing it with black
76
79
  ///
77
80
  /// @param {Colour} $colour - colour to shade
78
- /// @param {Number} $percentage - percentage of `$colour` in returned colour
81
+ /// @param {Number} $percentage - percentage of black to mix with $colour
79
82
  /// @return {Colour}
80
83
  /// @access public
81
84
 
@@ -86,7 +89,7 @@
86
89
  /// Make a colour lighter by mixing it with white
87
90
  ///
88
91
  /// @param {Colour} $colour - colour to tint
89
- /// @param {Number} $percentage - percentage of `$colour` in returned colour
92
+ /// @param {Number} $percentage - percentage of white to mix with $colour
90
93
  /// @return {Colour}
91
94
  /// @access public
92
95
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  // Since Internet Explorer 8 does not support box-shadow, we want to force the
18
18
  // user-agent outlines
19
- @include govuk-not-ie8 {
19
+ @include _govuk-not-ie8 {
20
20
  outline: $govuk-focus-width solid transparent;
21
21
  }
22
22
  color: $govuk-focus-text-colour;
@@ -25,4 +25,9 @@
25
25
  // When link is focussed, hide the default underline since the
26
26
  // box shadow adds the "underline"
27
27
  text-decoration: none;
28
+
29
+ // When a focused box is broken by e.g. a line break, ensure that the
30
+ // box-shadow is applied to each fragment independently.
31
+ -webkit-box-decoration-break: clone;
32
+ box-decoration-break: clone;
28
33
  }
@@ -12,7 +12,7 @@
12
12
  /// @access private
13
13
 
14
14
  @mixin _govuk-font-face-gds-transport {
15
- @include govuk-not-ie8 { // In IE8, which cannot render WOFF format, we fall back to system fonts
15
+ @include _govuk-not-ie8 { // In IE8, which cannot render WOFF format, we fall back to system fonts
16
16
  @include govuk-exports("govuk/helpers/font-faces") {
17
17
  @at-root {
18
18
  /*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */ /* stylelint-disable-line scss/comment-no-loud */
@@ -30,12 +30,12 @@
30
30
  @mixin govuk-link-decoration {
31
31
  text-decoration: underline;
32
32
 
33
- @if ($govuk-new-link-styles) {
34
- @if ($govuk-link-underline-thickness) {
33
+ @if $govuk-new-link-styles {
34
+ @if $govuk-link-underline-thickness {
35
35
  text-decoration-thickness: $govuk-link-underline-thickness;
36
36
  }
37
37
 
38
- @if ($govuk-link-underline-offset) {
38
+ @if $govuk-link-underline-offset {
39
39
  text-underline-offset: $govuk-link-underline-offset;
40
40
  }
41
41
  }
@@ -50,7 +50,7 @@
50
50
  /// @access public
51
51
 
52
52
  @mixin govuk-link-hover-decoration {
53
- @if ($govuk-new-link-styles and $govuk-link-hover-underline-thickness) {
53
+ @if $govuk-new-link-styles and $govuk-link-hover-underline-thickness {
54
54
  text-decoration-thickness: $govuk-link-hover-underline-thickness;
55
55
  // Disable ink skipping on underlines on hover. Browsers haven't
56
56
  // standardised on this part of the spec yet, so set both properties
@@ -104,7 +104,7 @@
104
104
  // we need to override the text colour for that combination of selectors so
105
105
  // so that unvisited links styled as buttons do not end up with dark blue
106
106
  // text when focussed.
107
- @include govuk-compatibility(govuk_template) {
107
+ @include _govuk-compatibility(govuk_template) {
108
108
  &:link:focus {
109
109
  color: $govuk-focus-text-colour;
110
110
  }
@@ -152,7 +152,7 @@
152
152
  // we need to override the text colour for that combination of selectors so
153
153
  // so that unvisited links styled as buttons do not end up with dark blue
154
154
  // text when focussed.
155
- @include govuk-compatibility(govuk_template) {
155
+ @include _govuk-compatibility(govuk_template) {
156
156
  &:link:focus {
157
157
  color: $govuk-focus-text-colour;
158
158
  }
@@ -200,7 +200,7 @@
200
200
  // we need to override the text colour for that combination of selectors so
201
201
  // so that unvisited links styled as buttons do not end up with dark blue
202
202
  // text when focussed.
203
- @include govuk-compatibility(govuk_template) {
203
+ @include _govuk-compatibility(govuk_template) {
204
204
  &:link:focus {
205
205
  color: $govuk-focus-text-colour;
206
206
  }
@@ -243,7 +243,7 @@
243
243
  // alphagov/govuk_template includes a specific a:link:focus selector designed
244
244
  // to make unvisited links a slightly darker blue when focussed, so we need to
245
245
  // override the text colour for that combination of selectors.
246
- @include govuk-compatibility(govuk_template) {
246
+ @include _govuk-compatibility(govuk_template) {
247
247
  &:link:focus {
248
248
  @include govuk-text-colour;
249
249
  }
@@ -275,7 +275,9 @@
275
275
  // Force a colour change on hover to work around a bug in Safari
276
276
  // https://bugs.webkit.org/show_bug.cgi?id=224483
277
277
  &:hover {
278
- color: rgba($govuk-text-colour, .99);
278
+ @if type-of($govuk-text-colour) == color {
279
+ color: rgba($govuk-text-colour, .99);
280
+ }
279
281
  }
280
282
 
281
283
  &:active,
@@ -286,7 +288,7 @@
286
288
  // alphagov/govuk_template includes a specific a:link:focus selector designed
287
289
  // to make unvisited links a slightly darker blue when focussed, so we need to
288
290
  // override the text colour for that combination of selectors.
289
- @include govuk-compatibility(govuk_template) {
291
+ @include _govuk-compatibility(govuk_template) {
290
292
  &:link:focus {
291
293
  @include govuk-text-colour;
292
294
  }
@@ -329,7 +331,7 @@
329
331
  // alphagov/govuk_template includes a specific a:link:focus selector designed
330
332
  // to make unvisited links a slightly darker blue when focussed, so we need to
331
333
  // override the text colour for that combination of selectors.
332
- @include govuk-compatibility(govuk_template) {
334
+ @include _govuk-compatibility(govuk_template) {
333
335
  &:link:focus {
334
336
  color: $govuk-focus-text-colour;
335
337
  }
@@ -12,7 +12,7 @@ $mq-static-breakpoint: if(variable-exists(govuk-ie8-breakpoint), $govuk-ie8-brea
12
12
 
13
13
  $mq-show-breakpoints: ();
14
14
 
15
- @if (variable-exists(govuk-show-breakpoints) and $govuk-show-breakpoints) {
15
+ @if variable-exists(govuk-show-breakpoints) and $govuk-show-breakpoints {
16
16
  $mq-show-breakpoints: map-keys($govuk-breakpoints);
17
17
  }
18
18
 
@@ -20,7 +20,7 @@ $mq-show-breakpoints: ();
20
20
  // 'rasterize' any media queries.
21
21
 
22
22
  $mq-responsive: true;
23
- @if (variable-exists(govuk-is-ie8) and $govuk-is-ie8) {
23
+ @if variable-exists(govuk-is-ie8) and $govuk-is-ie8 {
24
24
  $mq-responsive: false;
25
25
  }
26
26