govuk_publishing_components 27.17.0 → 28.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
  3. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
  4. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
  5. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
  6. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +21 -16
  8. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +1 -1
  9. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +46 -32
  10. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +20 -7
  11. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +74 -65
  12. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +1 -126
  13. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +18 -18
  14. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +25 -11
  15. data/app/assets/javascripts/govuk_publishing_components/lib/extend-object.js +22 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +6 -35
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -104
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -14
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +8 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +141 -0
  26. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
  27. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
  28. data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
  29. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  30. data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
  31. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
  33. data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
  34. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
  35. data/app/views/govuk_publishing_components/components/docs/feedback.yml +5 -0
  36. data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
  37. data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
  38. data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
  39. data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
  40. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +9 -6
  41. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +4 -3
  42. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +4 -4
  43. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  44. data/config/locales/ar.yml +0 -8
  45. data/config/locales/az.yml +0 -8
  46. data/config/locales/be.yml +0 -8
  47. data/config/locales/bg.yml +0 -8
  48. data/config/locales/bn.yml +0 -8
  49. data/config/locales/cs.yml +0 -8
  50. data/config/locales/cy.yml +0 -8
  51. data/config/locales/da.yml +0 -8
  52. data/config/locales/de.yml +0 -8
  53. data/config/locales/dr.yml +0 -8
  54. data/config/locales/el.yml +0 -8
  55. data/config/locales/en.yml +9 -13
  56. data/config/locales/es-419.yml +0 -8
  57. data/config/locales/es.yml +0 -8
  58. data/config/locales/et.yml +0 -8
  59. data/config/locales/fa.yml +0 -8
  60. data/config/locales/fi.yml +0 -8
  61. data/config/locales/fr.yml +0 -8
  62. data/config/locales/gd.yml +0 -8
  63. data/config/locales/gu.yml +0 -8
  64. data/config/locales/he.yml +0 -8
  65. data/config/locales/hi.yml +0 -8
  66. data/config/locales/hr.yml +0 -8
  67. data/config/locales/hu.yml +0 -8
  68. data/config/locales/hy.yml +0 -8
  69. data/config/locales/id.yml +0 -8
  70. data/config/locales/is.yml +0 -8
  71. data/config/locales/it.yml +0 -8
  72. data/config/locales/ja.yml +0 -8
  73. data/config/locales/ka.yml +0 -8
  74. data/config/locales/kk.yml +0 -8
  75. data/config/locales/ko.yml +0 -8
  76. data/config/locales/lt.yml +0 -8
  77. data/config/locales/lv.yml +0 -8
  78. data/config/locales/ms.yml +0 -8
  79. data/config/locales/mt.yml +0 -8
  80. data/config/locales/nl.yml +0 -8
  81. data/config/locales/no.yml +0 -8
  82. data/config/locales/pa-pk.yml +0 -8
  83. data/config/locales/pa.yml +0 -8
  84. data/config/locales/pl.yml +0 -8
  85. data/config/locales/ps.yml +0 -8
  86. data/config/locales/pt.yml +0 -8
  87. data/config/locales/ro.yml +0 -8
  88. data/config/locales/ru.yml +0 -8
  89. data/config/locales/si.yml +0 -8
  90. data/config/locales/sk.yml +0 -8
  91. data/config/locales/sl.yml +0 -8
  92. data/config/locales/so.yml +0 -8
  93. data/config/locales/sq.yml +0 -8
  94. data/config/locales/sr.yml +0 -8
  95. data/config/locales/sv.yml +0 -8
  96. data/config/locales/sw.yml +0 -8
  97. data/config/locales/ta.yml +0 -8
  98. data/config/locales/th.yml +0 -8
  99. data/config/locales/tk.yml +0 -8
  100. data/config/locales/tr.yml +0 -8
  101. data/config/locales/uk.yml +0 -8
  102. data/config/locales/ur.yml +0 -8
  103. data/config/locales/uz.yml +0 -8
  104. data/config/locales/vi.yml +0 -8
  105. data/config/locales/zh-hk.yml +0 -8
  106. data/config/locales/zh-tw.yml +0 -8
  107. data/config/locales/zh.yml +0 -8
  108. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
  109. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
  110. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
  111. data/lib/govuk_publishing_components/version.rb +1 -1
  112. data/lib/govuk_publishing_components.rb +0 -2
  113. metadata +13 -14
  114. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +0 -84
  115. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +0 -21
  116. data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +0 -20
  117. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +0 -86
  118. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +0 -47
  119. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +0 -30
  120. data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +0 -10
  121. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +0 -20
  122. data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +0 -171
  123. data/app/views/govuk_publishing_components/components/docs/taxonomy_list.yml +0 -112
  124. data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +0 -13
  125. data/lib/govuk_publishing_components/presenters/taxonomy_list_helper.rb +0 -23
@@ -25,10 +25,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
25
25
  this.setInitialAriaAttributes()
26
26
  this.setHiddenValues()
27
27
 
28
+ this.prompt.hidden = false
29
+ for (var k = 0; k < this.promptQuestions.length; k++) {
30
+ this.promptQuestions[k].hidden = false
31
+ }
32
+ this.surveyForm.hidden = true
33
+
28
34
  for (var j = 0; j < this.toggleForms.length; j++) {
29
35
  this.toggleForms[j].addEventListener('click', function (e) {
30
36
  e.preventDefault()
31
- var el = e.target
37
+ var el = e.target.closest('button')
32
38
  this.toggleForm(el.getAttribute('aria-controls'))
33
39
  this.trackEvent(this.getTrackEventParams(el))
34
40
  this.updateAriaAttributes(el)
@@ -36,6 +42,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
36
42
  }
37
43
 
38
44
  for (var i = 0; i < this.closeForms.length; i++) {
45
+ this.closeForms[i].hidden = false
39
46
  this.closeForms[i].addEventListener('click', function (e) {
40
47
  e.preventDefault()
41
48
  var el = e.target
@@ -89,7 +96,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
89
96
  this.showFormSuccess(xhr.message)
90
97
  this.revealInitialPrompt()
91
98
  this.setInitialAriaAttributes()
92
- this.activeForm.classList.toggle(this.jshiddenClass)
99
+ this.activeForm.hidden ? this.activeForm.hidden = false : this.activeForm.hidden = true
93
100
  } else {
94
101
  this.showError(xhr)
95
102
  this.enableSubmitFormButton($form)
@@ -114,9 +121,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
114
121
  }
115
122
 
116
123
  Feedback.prototype.setInitialAriaAttributes = function () {
117
- for (var i = 0; i < this.forms.length; i++) {
118
- this.forms[i].setAttribute('aria-hidden', true)
119
- }
120
124
  this.pageIsNotUsefulButton.setAttribute('aria-expanded', false)
121
125
  this.somethingIsWrongButton.setAttribute('aria-expanded', false)
122
126
  }
@@ -168,20 +172,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
168
172
 
169
173
  Feedback.prototype.updateAriaAttributes = function (linkClicked) {
170
174
  linkClicked.setAttribute('aria-expanded', true)
171
- var controls = linkClicked.getAttribute('aria-controls')
172
- var ariaControls = document.querySelector('#' + controls)
173
- ariaControls.setAttribute('aria-hidden', false)
174
175
  }
175
176
 
176
177
  Feedback.prototype.toggleForm = function (formId) {
177
178
  this.activeForm = this.$module.querySelector('#' + formId)
178
- this.activeForm.classList.toggle(this.jshiddenClass)
179
- this.prompt.classList.toggle(this.jshiddenClass)
180
-
181
- var formIsVisible = !this.activeForm.classList.contains(this.jshiddenClass)
179
+ this.activeForm.hidden ? this.activeForm.hidden = false : this.activeForm.hidden = true
180
+ this.prompt.hidden ? this.prompt.hidden = false : this.prompt.hidden = true
182
181
 
183
- if (formIsVisible) {
184
- this.activeForm.querySelector('.gem-c-input').focus()
182
+ if (!this.activeForm.hidden) {
183
+ this.activeForm.querySelectorAll('.gem-c-textarea .govuk-textarea, .gem-c-input.govuk-input')[0]
184
+ .focus()
185
185
  } else {
186
186
  this.activeForm = false
187
187
  }
@@ -223,20 +223,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
223
223
  }
224
224
  var $errors = this.activeForm.querySelector('.js-errors')
225
225
  $errors.innerHTML = error
226
- $errors.classList.remove(this.jshiddenClass)
226
+ $errors.hidden = false
227
227
  $errors.focus()
228
228
  }
229
229
 
230
230
  Feedback.prototype.showFormSuccess = function () {
231
231
  for (var i = 0; i < this.promptQuestions.length; i++) {
232
- this.promptQuestions[i].classList.add(this.jshiddenClass)
232
+ this.promptQuestions[i].hidden = true
233
233
  }
234
- this.promptSuccessMessage.classList.remove(this.jshiddenClass)
234
+ this.promptSuccessMessage.hidden = false
235
235
  this.promptSuccessMessage.focus()
236
236
  }
237
237
 
238
238
  Feedback.prototype.revealInitialPrompt = function () {
239
- this.prompt.classList.remove(this.jshiddenClass)
239
+ this.prompt.hidden = false
240
240
  this.prompt.focus()
241
241
  }
242
242
 
@@ -7,6 +7,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
7
7
  this.$module = $module
8
8
  this.basePath = this.$module.querySelector('input[name="base_path"]').value
9
9
  this.buttonLocation = this.$module.getAttribute('data-button-location')
10
+ this.buttonVisibleClass = 'gem-c-single-page-notification-button--visible'
10
11
 
11
12
  this.personalisationEndpoint = '/api/personalisation/check-email-subscription?base_path=' + this.basePath
12
13
  // This attribute is passed through to the personalisation API to ensure the updated button has the same button_location for analytics
@@ -16,21 +17,30 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
16
17
  SinglePageNotificationButton.prototype.init = function () {
17
18
  var xhr = new XMLHttpRequest()
18
19
  xhr.open('GET', this.personalisationEndpoint, true)
20
+ // if XHR to the personalisation endpoint is taking an incredibly long time to complete, we are better off leaving the button in its default unpersonalised state. Content changing before the user's eyes while they are browsing can be jarring and should be avoided.
21
+ xhr.timeout = 10000
22
+
23
+ xhr.ontimeout = function () {
24
+ this.makeVisible(this.$module)
25
+ }.bind(this)
19
26
 
20
27
  xhr.onreadystatechange = function () {
21
- if (xhr.readyState === 4 && xhr.status === 200) {
22
- var responseText = xhr.responseText
23
- // if response text exists and is JSON parse-able, parse the response and get the button html
24
- if (responseText && this.responseIsJSON(responseText)) {
25
- var newButton = JSON.parse(responseText).button_html
26
- var html = document.createElement('div')
27
- html.innerHTML = newButton
28
- // test that the html returned contains the button component; if yes, swap the button for the updated version
29
- var responseButtonContainer = html.querySelector('form.gem-c-single-page-notification-button')
30
- if (responseButtonContainer) {
31
- this.$module.parentNode.replaceChild(responseButtonContainer, this.$module)
28
+ if (xhr.readyState === 4) {
29
+ if (xhr.status === 200) {
30
+ var responseText = xhr.responseText
31
+ // if response text exists and is JSON parse-able, parse the response and get the button html
32
+ if (responseText && this.responseIsJSON(responseText)) {
33
+ var newButton = JSON.parse(responseText).button_html
34
+ var html = document.createElement('div')
35
+ html.innerHTML = newButton
36
+ // test that the html returned contains the button component; if yes, swap the button for the updated version
37
+ var responseButtonContainer = html.querySelector('form.gem-c-single-page-notification-button')
38
+ if (responseButtonContainer) {
39
+ this.$module.parentNode.replaceChild(responseButtonContainer, this.$module)
40
+ }
32
41
  }
33
42
  }
43
+ this.makeVisible(this.$module)
34
44
  }
35
45
  }.bind(this)
36
46
  xhr.send()
@@ -44,5 +54,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
44
54
  }
45
55
  return true
46
56
  }
57
+
58
+ SinglePageNotificationButton.prototype.makeVisible = function (target) {
59
+ target.classList.add(this.buttonVisibleClass)
60
+ }
47
61
  Modules.SinglePageNotificationButton = SinglePageNotificationButton
48
62
  })(window.GOVUK.Modules)
@@ -0,0 +1,22 @@
1
+ (function (root) {
2
+ 'use strict'
3
+ window.GOVUK = window.GOVUK || {}
4
+
5
+ window.GOVUK.extendObject = function (obj) {
6
+ obj = obj || {}
7
+
8
+ for (var i = 1; i < arguments.length; i++) {
9
+ if (!arguments[i]) {
10
+ continue
11
+ }
12
+
13
+ for (var key in arguments[i]) {
14
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
15
+ obj[key] = arguments[i][key]
16
+ }
17
+ }
18
+ }
19
+
20
+ return obj
21
+ }
22
+ }(window))
@@ -39,7 +39,6 @@ $govuk-new-link-styles: true;
39
39
  @import "components/govspeak-html-publication";
40
40
  @import "components/govspeak";
41
41
  @import "components/heading";
42
- @import "components/highlight-boxes";
43
42
  @import "components/hint";
44
43
  @import "components/image-card";
45
44
  @import "components/input";
@@ -68,6 +67,7 @@ $govuk-new-link-styles: true;
68
67
  @import "components/select";
69
68
  @import "components/share-links";
70
69
  @import "components/show-password";
70
+ @import "components/signup-link";
71
71
  @import "components/single-page-notification-button";
72
72
  @import "components/skip-link";
73
73
  @import "components/step-by-step-nav-header";
@@ -78,7 +78,6 @@ $govuk-new-link-styles: true;
78
78
  @import "components/summary-list";
79
79
  @import "components/tabs";
80
80
  @import "components/table";
81
- @import "components/taxonomy-list";
82
81
  @import "components/textarea";
83
82
  @import "components/title";
84
83
  @import "components/translation-nav";
@@ -1,31 +1,36 @@
1
1
  $transition-campaign-red: #ff003b;
2
+ $covid-colour: $govuk-link-colour;
2
3
 
3
- .gem-c-contextual-sidebar__brexit-related-links {
4
+ .gem-c-contextual-sidebar__related-links {
4
5
  border-top: 2px solid $govuk-brand-colour;
5
6
  }
6
7
 
7
- .gem-c-contextual-sidebar__brexit-heading {
8
+ .gem-c-contextual-sidebar__heading {
8
9
  margin-top: govuk-spacing(3);
9
10
  margin-bottom: govuk-spacing(2);
11
+ color: $govuk-text-colour;
10
12
  }
11
13
 
12
- .gem-c-contextual-sidebar__brexit-cta {
14
+ .gem-c-contextual-sidebar__text {
15
+ @include govuk-font(16);
16
+ margin-bottom: govuk-spacing(1);
17
+ @include govuk-media-query($from: tablet) {
18
+ margin-bottom: govuk-spacing(2);
19
+ }
20
+ }
21
+
22
+ .gem-c-contextual-sidebar__cta {
13
23
  margin-bottom: govuk-spacing(6);
14
24
  background-color: govuk-colour('light-grey', $legacy: 'grey-4');
15
- border-top: 2px solid $transition-campaign-red;
16
25
  display: block;
17
26
  padding: 0 govuk-spacing(3) govuk-spacing(3);
18
27
  text-decoration: none;
28
+ }
19
29
 
20
- .gem-c-contextual-sidebar__brexit-heading {
21
- color: $govuk-text-colour;
22
- }
30
+ .gem-c-contextual-sidebar__cta--brexit {
31
+ border-top: 2px solid $transition-campaign-red;
32
+ }
23
33
 
24
- .gem-c-contextual-sidebar__brexit-text {
25
- @include govuk-font(16);
26
- margin-bottom: govuk-spacing(1);
27
- @include govuk-media-query($from: tablet) {
28
- margin-bottom: govuk-spacing(2);
29
- }
30
- }
34
+ .gem-c-contextual-sidebar__cta--covid {
35
+ border-top: 2px solid $covid-colour;
31
36
  }
@@ -6,6 +6,12 @@
6
6
  margin-top: govuk-spacing(9);
7
7
  border-bottom: 1px solid govuk-colour("white");
8
8
  }
9
+
10
+ // Scoped to the feedback component temporarily
11
+ [hidden] {
12
+ // stylelint-disable-next-line declaration-no-important
13
+ display: none !important;
14
+ }
9
15
  }
10
16
 
11
17
  .gem-c-feedback__prompt-questions {
@@ -238,38 +244,3 @@
238
244
  outline: $govuk-focus-width solid $govuk-focus-colour;
239
245
  }
240
246
  }
241
-
242
- // hide without js
243
- // show with js, unless also has the js-hidden class
244
- .gem-c-feedback__js-show,
245
- .gem-c-feedback__prompt-success,
246
- .gem-c-feedback__prompt-questions,
247
- .gem-c-feedback__error-summary {
248
- display: none;
249
-
250
- .js-enabled & {
251
- display: block;
252
-
253
- &.js-hidden {
254
- display: none;
255
- }
256
- }
257
- }
258
-
259
- // maintain table display for prompt and prompt-questions
260
- .js-enabled .gem-c-feedback__prompt {
261
- @include govuk-media-query($from: tablet) {
262
- display: table;
263
- }
264
- }
265
-
266
- .js-enabled .gem-c-feedback__prompt-questions {
267
- @include govuk-media-query($from: tablet) {
268
- display: table-cell;
269
- }
270
- }
271
-
272
- // show the default feedback form without js
273
- .js-enabled .gem-c-feedback__form.js-hidden {
274
- display: none;
275
- }
@@ -45,17 +45,21 @@
45
45
  }
46
46
 
47
47
  .gem-c-image-card__image-wrapper {
48
- @include govuk-grid-column($width: one-third, $at: mobile);
48
+ @include govuk-grid-column($width: one-half, $at: mobile);
49
49
  }
50
50
 
51
51
  .gem-c-image-card__text-wrapper {
52
- @include govuk-grid-column($width: two-thirds, $at: mobile);
52
+ @include govuk-grid-column($width: one-half, $at: mobile);
53
53
  }
54
54
  }
55
55
 
56
56
  .gem-c-image-card__image {
57
57
  display: block;
58
58
  max-width: 100%;
59
+ border-top: 1px solid $govuk-border-colour;
60
+ border-left: none;
61
+ border-right: none;
62
+ border-bottom: none;
59
63
  }
60
64
 
61
65
  .gem-c-image-card__title {
@@ -100,7 +104,13 @@
100
104
 
101
105
  .gem-c-image-card__context,
102
106
  .gem-c-image-card__metadata {
103
- @include govuk-font(14);
107
+ @include govuk-font($size: false);
108
+ font-size: 16px;
109
+
110
+ @if $govuk-typography-use-rem {
111
+ font-size: govuk-px-to-rem(16px);
112
+ }
113
+
104
114
  margin: 0 0 (govuk-spacing(3) / 2);
105
115
  color: govuk-colour("dark-grey", $legacy: "grey-1");
106
116
 
@@ -110,13 +120,13 @@
110
120
  }
111
121
 
112
122
  .gem-c-image-card__description {
113
- @include govuk-font($size: 16);
123
+ @include govuk-font($size: 19);
114
124
  padding-top: (govuk-spacing(3) / 2);
115
125
  word-wrap: break-word;
116
126
  }
117
127
 
118
128
  .gem-c-image-card__list {
119
- @include govuk-font($size: 16);
129
+ @include govuk-font($size: 19);
120
130
  position: relative;
121
131
  z-index: 2;
122
132
  padding: (govuk-spacing(3) / 2) 0 0 0;
@@ -160,7 +170,7 @@
160
170
 
161
171
  .gem-c-image-card--large {
162
172
  .gem-c-image-card__image-wrapper {
163
- @include govuk-grid-column($width: two-thirds, $at: tablet);
173
+ @include govuk-grid-column($width: one-half, $at: tablet);
164
174
 
165
175
  margin-bottom: govuk-spacing(2);
166
176
  float: none;
@@ -175,7 +185,7 @@
175
185
  }
176
186
 
177
187
  .gem-c-image-card__text-wrapper {
178
- @include govuk-grid-column($width: one-third, $at: tablet);
188
+ @include govuk-grid-column($width: one-half, $at: tablet);
179
189
 
180
190
  padding: 0;
181
191
  overflow: hidden;
@@ -1,102 +1,5 @@
1
1
  @import "mixins/prefixed-transform";
2
-
3
- /// Set grid row or column value using the fraction unit.
4
- ///
5
- /// @param {Integer} $number - number of fractions that the grid row or column
6
- /// needs to be divided into.
7
- /// @returns {String} - the value
8
- ///
9
- /// @example scss - Five fractions will return `1fr 1fr 1fr 1fr 1fr`.
10
- /// .container {
11
- /// grid-template-rows: fractions(5);
12
- /// }
13
- ///
14
- @function fractions($number) {
15
- $fractions: "1fr";
16
-
17
- @for $i from 1 to $number {
18
- $fractions: $fractions + " 1fr";
19
- }
20
-
21
- @return unquote($fractions);
22
- }
23
-
24
- /// Arrange items into vertical columns
25
- ///
26
- /// @param {Integer} $items - number of items that need to be arranged
27
- /// @param {Integer} $columns - number of columns required
28
- /// @param {String} $selector - (optional) the inner element to be targeted.
29
- ///
30
- /// @example scss - A 7 item 2 column layout.
31
- /// .container {
32
- /// @include columns(7, 2);
33
- /// }
34
-
35
- /// @example scss - A 9 item 3 column layout that has `div`s as the inner
36
- /// elements.
37
- /// .container {
38
- /// @include columns(9, 3, "div");
39
- /// }
40
- ///
41
- @mixin columns($items, $columns, $selector: "*") {
42
- $rows: ceil($items / $columns);
43
-
44
- display: -ms-grid;
45
- display: grid;
46
- grid-auto-flow: column;
47
- -ms-grid-columns: fractions($columns);
48
- grid-template-columns: fractions($columns);
49
- -ms-grid-rows: fractions($rows);
50
- grid-template-rows: fractions($rows);
51
- }
52
-
53
- @mixin columns-children($items, $columns, $selector: "*") {
54
- $rows: ceil($items / $columns);
55
-
56
- // Internet Explorer 10-11 require each element to be placed in the grid -
57
- // the `grid-auto-flow` property isn't supported. This means that both the
58
- // column and row needs to be set for every element.
59
-
60
- // This creates a list of lists to represent the columns and rows; for
61
- // example, a 7 item 2 column list would create this:
62
- // [
63
- // [1, 2, 3, 4 ] // column one
64
- // [5, 6, 7] // column two
65
- // ]
66
- $grid: ();
67
- $counter: 0;
68
-
69
- @for $column from 1 through $columns {
70
- $this-row: ();
71
-
72
- @for $row from 1 through $rows {
73
- $counter: $counter + 1;
74
-
75
- @if $counter <= $items {
76
- $this-row: append($this-row, $counter);
77
- }
78
- }
79
-
80
- $grid: append($grid, $this-row, "comma");
81
- }
82
-
83
- // Now we can loop through the list of lists to create the rules needed for
84
- // the older grid syntax; fist looping through the list to get the number
85
- // needed for the column, then looping again to get the number for the grid
86
- // row:
87
- @for $column_index from 1 through length($grid) {
88
- $this-row: nth($grid, $column_index);
89
-
90
- @for $item-index from 1 through length($this-row) {
91
- $this-item: nth($this-row, $item-index);
92
-
93
- & > #{$selector}:nth-child(#{$this-item}) {
94
- -ms-grid-column: $column_index;
95
- -ms-grid-row: $item-index;
96
- }
97
- }
98
- }
99
- }
2
+ @import "mixins/grid-helper";
100
3
 
101
4
  $icon-size: 20px;
102
5
  $chevron-indent-spacing: 7px;
@@ -866,15 +769,13 @@ $pseudo-underline-height: 3px;
866
769
 
867
770
  .gem-c-layout-super-navigation-header__navigation-second-items--topics {
868
771
  @include govuk-media-query($from: "desktop") {
869
- @include columns(17, 2, "li");
870
- @include columns-children(17, 2, "li");
772
+ @include columns($items: 17, $columns: 2, $selector: "li", $flow: column);
871
773
  }
872
774
  }
873
775
 
874
776
  .gem-c-layout-super-navigation-header__navigation-second-items--government-activity {
875
777
  @include govuk-media-query($from: "desktop") {
876
- @include columns(6, 2, "li");
877
- @include columns-children(6, 2, "li");
778
+ @include columns($items: 6, $columns: 2, $selector: "li", $flow: column);
878
779
  padding-bottom: 0;
879
780
 
880
781
  & > li {
@@ -924,8 +825,7 @@ $pseudo-underline-height: 3px;
924
825
  padding: 0 0 govuk-spacing(8) govuk-spacing(4);
925
826
 
926
827
  @include govuk-media-query($from: "desktop") {
927
- @include columns(2, 2, "li");
928
- @include columns-children(2, 2, "li");
828
+ @include columns($items: 2, $columns: 2, $selector: "li");
929
829
  margin: 0 (0 - govuk-spacing(3));
930
830
  padding: govuk-spacing(6) 0 govuk-spacing(7) 0;
931
831
  }
@@ -963,6 +863,7 @@ $pseudo-underline-height: 3px;
963
863
  }
964
864
 
965
865
  .gem-c-layout-super-navigation-header__navigation-second-item-description {
866
+ @include govuk-typography-common;
966
867
  font-size: 16px;
967
868
  @if $govuk-typography-use-rem {
968
869
  font-size: govuk-px-to-rem(16px);
@@ -1,6 +1,25 @@
1
1
  $input-size: 40px;
2
2
  $large-input-size: 50px;
3
3
 
4
+ @mixin large-mode {
5
+ .gem-c-search__label {
6
+ @include govuk-font($size: 19, $line-height: $large-input-size);
7
+ }
8
+
9
+ .gem-c-search__input[type="search"] {
10
+ height: $large-input-size;
11
+ }
12
+
13
+ .gem-c-search__submit {
14
+ width: $large-input-size;
15
+ height: $large-input-size;
16
+
17
+ .gem-c-search__icon {
18
+ @include icon-positioning($large-input-size);
19
+ }
20
+ }
21
+ }
22
+
4
23
  .gem-c-search {
5
24
  position: relative;
6
25
  margin-bottom: 30px;
@@ -220,21 +239,12 @@ $large-input-size: 50px;
220
239
  }
221
240
 
222
241
  .gem-c-search--large {
223
- .gem-c-search__label {
224
- @include govuk-font($size: 19, $line-height: $large-input-size);
225
- }
226
-
227
- .gem-c-search__input[type="search"] {
228
- height: $large-input-size;
229
- }
230
-
231
- .gem-c-search__submit {
232
- width: $large-input-size;
233
- height: $large-input-size;
242
+ @include large-mode;
243
+ }
234
244
 
235
- .gem-c-search__icon {
236
- @include icon-positioning($large-input-size);
237
- }
245
+ .gem-c-search--large-on-mobile {
246
+ @include govuk-media-query($until: "tablet") {
247
+ @include large-mode;
238
248
  }
239
249
  }
240
250
 
@@ -0,0 +1,34 @@
1
+ .gem-c-signup-link__link {
2
+ @include govuk-font($size: 19);
3
+ }
4
+
5
+ .gem-c-signup-link__inner {
6
+ position: relative;
7
+ }
8
+
9
+ .gem-c-signup-link__icon {
10
+ position: absolute;
11
+
12
+ @include govuk-media-query($from: tablet) {
13
+ top: 2px;
14
+ }
15
+ }
16
+
17
+ .gem-c-signup-link__title {
18
+ margin-bottom: govuk-spacing(2);
19
+ margin-left: govuk-spacing(5);
20
+ }
21
+
22
+ .gem-c-signup-link--with-background-and-border {
23
+ padding: govuk-spacing(6);
24
+ background-color: govuk-colour("light-grey");
25
+ border: 1px solid $govuk-border-colour;
26
+ }
27
+
28
+ .gem-c-signup-link--link-only .gem-c-signup-link__link {
29
+ display: inline-block;
30
+ vertical-align: top;
31
+ font-weight: bold;
32
+ margin-left: govuk-spacing(5);
33
+ margin-bottom: 0;
34
+ }
@@ -28,3 +28,11 @@
28
28
  vertical-align: top;
29
29
  margin-right: govuk-spacing(1);
30
30
  }
31
+
32
+ .js-enabled .gem-c-single-page-notification-button.js-personalisation-enhancement {
33
+ opacity: 0;
34
+
35
+ &.gem-c-single-page-notification-button--visible {
36
+ opacity: 1;
37
+ }
38
+ }
@@ -34,4 +34,11 @@
34
34
  margin-left: 1em;
35
35
  }
36
36
  }
37
+
38
+ // Prevent excessive spacing when placed in a call-to-action block
39
+ .call-to-action {
40
+ .help-notice:first-child {
41
+ margin-top: 0;
42
+ }
43
+ }
37
44
  }