govuk_publishing_components 24.1.1 → 24.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +52 -8
  4. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -6
  5. data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
  6. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
  7. data/app/assets/stylesheets/component_guide/application.scss +0 -8
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +11 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +11 -84
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
  11. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  12. data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
  13. data/app/models/govuk_publishing_components/component_example.rb +4 -3
  14. data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
  15. data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
  16. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
  17. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
  18. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +50 -39
  19. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
  20. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
  23. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
  25. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  26. data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
  27. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  30. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
  31. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/docs/accordion.yml +29 -0
  34. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
  35. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
  36. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  37. data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
  38. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
  39. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
  40. data/config/locales/en.yml +7 -5
  41. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
  42. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
  43. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
  44. data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
  45. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
  46. data/lib/govuk_publishing_components/version.rb +1 -1
  47. data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
  48. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 664f19b71a4b1ec65f49a7a14fa21d4a2a64465b2f593a3c75e2de132474417a
4
- data.tar.gz: 8e734701d0d66817548de5855938a6cdad1f9b2ce2fa96437075e9058331785a
3
+ metadata.gz: 6b37372eea898cc35257f4c1eb22682eca8b7c52c3a33ad974d68ba708d0c1bb
4
+ data.tar.gz: 84f9e46d8224bc5a3bc1d472c965926a4bea81ce64a7a88b01be4a56c20ae171
5
5
  SHA512:
6
- metadata.gz: 9073c4b0254a544f3a0f6da89889550786a3f0e7cc5611b6c89768be9c8d66ff27b8364d54525e677013c439e73acb7dd618289f2d72787d56b6f833d89df910
7
- data.tar.gz: 2ed858269eee93ae2212110fd2aa4b4cee21106e5028a36508d3242982a8e60be387b1f31e8b7694f1b66b401707049865f4fda1338639d3b9ce5e702db99b05
6
+ metadata.gz: 75ff1497d81807ec11c3f7fd667835204de9db7a1efec78445e82a097d71406874687d6563d91667e5362578484892db688feefcbfa94968975033022c69d82f
7
+ data.tar.gz: 012e764ff160ecfa9527f2a20bc37ec33a956eb1644da5f66c93eb42b706134a8ae8fe722989027545741b36f28cb59afe4339b28a94169de2331b0f05165914
@@ -405,6 +405,34 @@
405
405
  ],
406
406
  '/eubusiness': [
407
407
  ['Heading', 'Additional help and support']
408
+ ],
409
+ '/coronavirus': [
410
+ ['Percent', 20],
411
+ ['Percent', 40],
412
+ ['Percent', 60],
413
+ ['Percent', 80],
414
+ ['Percent', 100]
415
+ ],
416
+ '/coronavirus/education-and-childcare': [
417
+ ['Percent', 20],
418
+ ['Percent', 40],
419
+ ['Percent', 60],
420
+ ['Percent', 80],
421
+ ['Percent', 100]
422
+ ],
423
+ '/coronavirus/worker-support': [
424
+ ['Percent', 20],
425
+ ['Percent', 40],
426
+ ['Percent', 60],
427
+ ['Percent', 80],
428
+ ['Percent', 100]
429
+ ],
430
+ '/coronavirus/business-support': [
431
+ ['Percent', 20],
432
+ ['Percent', 40],
433
+ ['Percent', 60],
434
+ ['Percent', 80],
435
+ ['Percent', 100]
408
436
  ]
409
437
  }
410
438
 
@@ -11,8 +11,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
11
11
 
12
12
  GemAccordion.prototype.start = function ($module) {
13
13
  this.$module = $module[0]
14
+ this.sectionClass = 'gem-c-accordion__section'
14
15
  this.moduleId = this.$module.getAttribute('id')
15
- this.sections = this.$module.querySelectorAll('.gem-c-accordion__section')
16
+ this.sections = this.$module.querySelectorAll('.' + this.sectionClass)
16
17
  this.openAllButton = ''
17
18
  this.browserSupportsSessionStorage = helper.checkForSessionStorage()
18
19
  this.controlsClass = 'gem-c-accordion__controls'
@@ -36,6 +37,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
36
37
  this.initControls()
37
38
  this.initSectionHeaders()
38
39
 
40
+ // Feature flag for anchor tag navigation used on manuals
41
+ if (this.$module.getAttribute('data-anchor-navigation')) {
42
+ this.openByAnchorOnLoad()
43
+ this.addEventListenersForAnchors()
44
+ }
45
+
39
46
  // See if "Show all sections" button text should be updated
40
47
  var areAllSectionsOpen = this.checkIfAllSectionsOpen()
41
48
  this.updateOpenAllButton(areAllSectionsOpen)
@@ -59,7 +66,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
59
66
  accordionControls.appendChild(this.openAllButton)
60
67
  this.$module.insertBefore(accordionControls, this.$module.firstChild)
61
68
 
62
- // Build addtional wrapper for open all toggle text, place icon after wrapped text.
69
+ // Build additional wrapper for open all toggle text, place icon after wrapped text.
63
70
  var wrapperOpenAllText = document.createElement('span')
64
71
  wrapperOpenAllText.classList.add(this.openAllTextClass)
65
72
  this.openAllButton.insertBefore(wrapperOpenAllText, this.openAllButton.childNodes[0] || null)
@@ -74,6 +81,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
74
81
  nodeListForEach(this.sections, function (section, i) {
75
82
  // Set header attributes
76
83
  var header = section.querySelector('.' + this.sectionHeaderClass)
84
+
77
85
  this.initHeaderAttributes(header, i)
78
86
  this.setExpanded(this.isExpanded(section), section)
79
87
 
@@ -106,12 +114,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
106
114
  srPause.classList.add('govuk-visually-hidden')
107
115
  srPause.innerHTML = ', '
108
116
 
109
- // Build addtional copy for assistive technology
110
- var srAddtionalCopy = document.createElement('span')
111
- srAddtionalCopy.classList.add('govuk-visually-hidden')
112
- srAddtionalCopy.innerHTML = ' this section'
117
+ // Build additional copy for assistive technology
118
+ var srAdditionalCopy = document.createElement('span')
119
+ srAdditionalCopy.classList.add('govuk-visually-hidden')
120
+ srAdditionalCopy.innerHTML = ' this section'
113
121
 
114
- // Build addtional wrapper for toggle text, place icon after wrapped text.
122
+ // Build additional wrapper for toggle text, place icon after wrapped text.
115
123
  var wrapperShowHideIcon = document.createElement('span')
116
124
  var icon = document.createElement('span')
117
125
  icon.classList.add(this.upChevonIconClass)
@@ -138,7 +146,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
138
146
  }
139
147
 
140
148
  button.appendChild(showIcons)
141
- button.appendChild(srAddtionalCopy)
149
+ button.appendChild(srAdditionalCopy)
142
150
  }
143
151
 
144
152
  // When section toggled, set and store state
@@ -283,5 +291,41 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
283
291
  }
284
292
  }
285
293
 
294
+ // Navigate to and open accordions with anchored content on page load if a hash is present
295
+ GemAccordion.prototype.openByAnchorOnLoad = function () {
296
+ if (window.location.hash && this.$module.querySelector(window.location.hash)) {
297
+ this.openForAnchor(window.location.hash)
298
+ }
299
+ }
300
+
301
+ // Add event listeners for links to open accordion sections when navigated to using said anchor links on the page
302
+ // Adding an event listener to all anchor link a tags in an accordion is risky but we circumvent this risk partially by only being a layer of accordion behaviour instead of any sort of change to link behaviour
303
+ GemAccordion.prototype.addEventListenersForAnchors = function () {
304
+ var links = this.$module.querySelectorAll('.' + this.sectionInnerContent + ' a[href*="#"]')
305
+
306
+ links.forEach(function (link) {
307
+ if (link.pathname === window.location.pathname) {
308
+ link.addEventListener('click', this.openForAnchor.bind(this, link.hash))
309
+ }
310
+ }.bind(this))
311
+ }
312
+
313
+ // Find the parent accordion section for the given id and open it
314
+ GemAccordion.prototype.openForAnchor = function (hash) {
315
+ var target = document.querySelector(hash)
316
+ var section = this.getContainingSection(target)
317
+
318
+ this.setExpanded(true, section)
319
+ }
320
+
321
+ // Loop through the given ids ancestors until the parent section class is found
322
+ GemAccordion.prototype.getContainingSection = function (target) {
323
+ while (!target.classList.contains(this.sectionClass)) {
324
+ target = target.parentElement
325
+ }
326
+
327
+ return target
328
+ }
329
+
286
330
  Modules.GemAccordion = GemAccordion
287
331
  })(window.GOVUK.Modules)
@@ -9,10 +9,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
9
9
  this.$module.hideCookieMessage = this.hideCookieMessage.bind(this)
10
10
  this.$module.showConfirmationMessage = this.showConfirmationMessage.bind(this)
11
11
  this.$module.setCookieConsent = this.setCookieConsent.bind(this)
12
+ this.$module.rejectCookieConsent = this.rejectCookieConsent.bind(this)
12
13
 
13
14
  this.$module.cookieBanner = document.querySelector('.gem-c-cookie-banner')
14
15
  this.$module.cookieBannerConfirmationMessage = this.$module.querySelector('.gem-c-cookie-banner__confirmation')
15
-
16
+ this.$module.cookieBannerConfirmationMessageText = this.$module.querySelector('.gem-c-cookie-banner__confirmation-message')
16
17
  this.setupCookieMessage()
17
18
  }
18
19
 
@@ -24,9 +25,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
24
25
  }
25
26
  }
26
27
 
27
- this.$acceptCookiesLink = this.$module.querySelector('button[data-accept-cookies]')
28
- if (this.$acceptCookiesLink) {
29
- this.$acceptCookiesLink.addEventListener('click', this.$module.setCookieConsent)
28
+ this.$acceptCookiesButton = this.$module.querySelector('button[data-accept-cookies]')
29
+ if (this.$acceptCookiesButton) {
30
+ this.$acceptCookiesButton.style.display = 'block'
31
+ this.$acceptCookiesButton.addEventListener('click', this.$module.setCookieConsent)
32
+ }
33
+
34
+ this.$rejectCookiesButton = this.$module.querySelector('button[data-reject-cookies]')
35
+ if (this.$rejectCookiesButton) {
36
+ this.$rejectCookiesButton.style.display = 'block'
37
+ this.$rejectCookiesButton.addEventListener('click', this.$module.rejectCookieConsent)
30
38
  }
31
39
 
32
40
  this.showCookieMessage()
@@ -56,6 +64,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
56
64
 
57
65
  CookieBanner.prototype.hideCookieMessage = function (event) {
58
66
  if (this.$module) {
67
+ this.$module.hidden = true
59
68
  this.$module.style.display = 'none'
60
69
  window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
61
70
  }
@@ -66,6 +75,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
66
75
  }
67
76
 
68
77
  CookieBanner.prototype.setCookieConsent = function () {
78
+ if (this.$acceptCookiesButton.getAttribute('data-cookie-types') === 'all') {
79
+ this.$module.cookieBannerConfirmationMessageText.insertAdjacentHTML('afterbegin', 'You have accepted additional cookies. ')
80
+ }
69
81
  window.GOVUK.approveAllCookieTypes()
70
82
  this.$module.showConfirmationMessage()
71
83
  this.$module.cookieBannerConfirmationMessage.focus()
@@ -78,11 +90,19 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
78
90
  }
79
91
  }
80
92
 
93
+ CookieBanner.prototype.rejectCookieConsent = function () {
94
+ this.$module.cookieBannerConfirmationMessageText.insertAdjacentHTML('afterbegin', 'You have rejected additional cookies. ')
95
+ this.$module.showConfirmationMessage()
96
+ this.$module.cookieBannerConfirmationMessage.focus()
97
+ window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
98
+ }
99
+
81
100
  CookieBanner.prototype.showConfirmationMessage = function () {
82
- this.$cookieBannerMainContent = document.querySelector('.gem-c-cookie-banner__wrapper')
101
+ this.$cookieBannerMainContent = document.querySelector('.js-banner-wrapper')
83
102
 
84
- this.$cookieBannerMainContent.style.display = 'none'
103
+ this.$cookieBannerMainContent.hidden = true
85
104
  this.$module.cookieBannerConfirmationMessage.style.display = 'block'
105
+ this.$module.cookieBannerConfirmationMessage.hidden = false
86
106
  }
87
107
 
88
108
  CookieBanner.prototype.isInCookiesPage = function () {
@@ -13,7 +13,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
13
13
 
14
14
  // If a custom label has been provided, we can simply call the tracking module
15
15
  if (customTrackLabel) {
16
- var trackDetails = new window.GOVUK.Modules.TrackClick()
16
+ var trackDetails = new window.GOVUK.Modules.GemTrackClick()
17
17
  trackDetails.start($module)
18
18
  } else {
19
19
  // If no custom label is set, we use the open/close status as the label
@@ -11,8 +11,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
11
11
  this.$module.revertToPasswordOnFormSubmit = this.revertToPasswordOnFormSubmit.bind(this)
12
12
  this.input.classList.add('gem-c-input--with-password')
13
13
 
14
- this.showPasswordText = this.$module.getAttribute('data-show')
15
- this.hidePasswordText = this.$module.getAttribute('data-hide')
14
+ this.showPasswordText = this.$module.getAttribute('data-show-text')
15
+ this.hidePasswordText = this.$module.getAttribute('data-hide-text')
16
+ this.showPasswordFullText = this.$module.getAttribute('data-show-full-text')
17
+ this.hidePasswordFullText = this.$module.getAttribute('data-hide-full-text')
16
18
  this.shownPassword = this.$module.getAttribute('data-announce-show')
17
19
  this.hiddenPassword = this.$module.getAttribute('data-announce-hide')
18
20
 
@@ -27,6 +29,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
27
29
  this.showHide.className = 'gem-c-show-password__toggle'
28
30
  this.showHide.setAttribute('aria-controls', this.input.getAttribute('id'))
29
31
  this.showHide.setAttribute('type', 'button')
32
+ this.showHide.setAttribute('aria-label', this.showPasswordFullText)
30
33
  this.showHide.innerHTML = this.showPasswordText
31
34
  this.wrapper.insertBefore(this.showHide, this.input.nextSibling)
32
35
 
@@ -50,12 +53,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
50
53
  ShowPassword.prototype.togglePassword = function (event) {
51
54
  event.preventDefault()
52
55
  this.showHide.innerHTML = this.showHide.innerHTML === this.showPasswordText ? this.hidePasswordText : this.showPasswordText
56
+ this.showHide.setAttribute('aria-label', this.showHide.getAttribute('aria-label') === this.showPasswordFullText ? this.hidePasswordFullText : this.showPasswordFullText)
53
57
  this.statusText.innerHTML = this.statusText.innerHTML === this.shownPassword ? this.hiddenPassword : this.shownPassword
54
58
  this.input.setAttribute('type', this.input.getAttribute('type') === 'text' ? 'password' : 'text')
55
59
  }
56
60
 
57
61
  ShowPassword.prototype.revertToPasswordOnFormSubmit = function (event) {
58
62
  this.showHide.innerHTML = this.showPasswordText
63
+ this.showHide.setAttribute('aria-label', this.showPasswordFullText)
59
64
  this.statusText.innerHTML = this.hiddenPassword
60
65
  this.input.setAttribute('type', 'password')
61
66
  }
@@ -262,14 +262,6 @@ html {
262
262
  }
263
263
  }
264
264
 
265
- // Hide survey banner
266
- // stylelint-disable selector-max-id
267
- #user-satisfaction-survey-container,
268
- #global-cookie-message {
269
- display: none;
270
- }
271
- // stylelint-enable selector-max-id
272
-
273
265
  // Rouge syntax highlighting
274
266
  // Based on https://github.com/alphagov/tech-docs-template/blob/master/template/source/stylesheets/palette/_syntax-highlighting.scss
275
267
 
@@ -21,6 +21,17 @@
21
21
  border-color: govuk-colour("white");
22
22
  }
23
23
 
24
+ .gem-c-breadcrumbs--border-bottom {
25
+ border-bottom: 1px solid $govuk-border-colour;
26
+ padding-bottom: govuk-spacing(1);
27
+
28
+ &.govuk-breadcrumbs--collapse-on-mobile {
29
+ @include govuk-media-query($until: tablet) {
30
+ padding-bottom: 0;
31
+ }
32
+ }
33
+ }
34
+
24
35
  .govuk-breadcrumbs--collapse-on-mobile {
25
36
  @include govuk-media-query($until: tablet) {
26
37
  .govuk-breadcrumbs__list-item {
@@ -1,3 +1,4 @@
1
+ @import "govuk/components/cookie-banner/cookie-banner";
1
2
  $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
2
3
 
3
4
  .js-enabled {
@@ -7,50 +8,14 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
7
8
  }
8
9
 
9
10
  .gem-c-cookie-banner {
10
- @include govuk-font($size: 16);
11
- padding: govuk-spacing(2) 0;
12
11
  background-color: $govuk-cookie-banner-background;
13
12
  }
14
13
 
15
- .gem-c-cookie-banner--services {
14
+ // can't be used without js so implement there
15
+ .gem-c-cookie-banner .gem-c-button {
16
16
  display: none;
17
17
  }
18
18
 
19
- .gem-c-cookie-banner__message {
20
- display: inline-block;
21
- padding-bottom: govuk-spacing(2);
22
-
23
- @include govuk-font($size: 16);
24
- @include govuk-media-query($from: desktop) {
25
- padding-right: govuk-spacing(4);
26
- }
27
- }
28
-
29
- .gem-c-cookie-banner__button {
30
- &.govuk-grid-column-one-half-from-desktop {
31
- padding: 0;
32
- }
33
-
34
- .govuk-button {
35
- @include govuk-media-query($from: desktop) {
36
- width: 90%;
37
- }
38
-
39
- @include govuk-media-query($until: desktop) {
40
- margin-bottom: govuk-spacing(4);
41
- }
42
- }
43
- }
44
-
45
- // Only show accept button if users have js and can accept
46
- .gem-c-cookie-banner__button-accept {
47
- display: none;
48
- }
49
-
50
- .js-enabled .gem-c-cookie-banner__button-accept {
51
- display: inline-block;
52
- }
53
-
54
19
  .gem-c-cookie-banner__confirmation {
55
20
  display: none;
56
21
  position: relative;
@@ -81,51 +46,18 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
81
46
  }
82
47
  }
83
48
 
84
- .gem-c-cookie-banner__hide-button {
85
- @include govuk-font($size: 19);
86
- outline: 0;
87
- border: 0;
88
- background: none;
89
- text-decoration: underline;
90
- color: $govuk-link-colour;
91
- padding: govuk-spacing(0);
92
- margin-top: govuk-spacing(2);
49
+ // Override style from design system so we can have consistent
50
+ // padding on the the banner and the confirmation
93
51
 
94
- &:hover {
95
- color: $govuk-link-hover-colour;
96
- cursor: pointer;
97
- }
98
-
99
- &:focus {
100
- @include govuk-focused-text;
101
- }
102
-
103
- @include govuk-media-query($from: desktop) {
104
- margin-top: govuk-spacing(0);
105
- position: absolute;
106
- right: govuk-spacing(1);
107
- }
108
- }
109
-
110
- .gem-c-cookie-banner__buttons--flex {
111
- display: flex;
112
- flex-wrap: wrap;
113
- align-items: baseline;
114
-
115
- .govuk-button,
116
- .gem-c-cookie-banner__link {
117
- flex-grow: 1;
118
- flex-basis: 10rem;
119
- margin-right: govuk-spacing(3);
120
- margin-bottom: govuk-spacing(3);
121
- }
52
+ .govuk-cookie-banner {
53
+ padding-top: 0;
122
54
  }
123
55
 
124
56
  // Override the styles from govuk_template
125
57
  // stylelint-disable selector-max-id
126
58
  .gem-c-cookie-banner#global-cookie-message {
127
59
  background-color: $govuk-cookie-banner-background;
128
- padding: govuk-spacing(4) 0;
60
+ padding: govuk-spacing(3) 0 0 0;
129
61
  box-sizing: border-box;
130
62
 
131
63
  .gem-c-cookie-banner__message,
@@ -135,18 +67,13 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
135
67
  @include govuk-font($size: 19);
136
68
  }
137
69
 
138
- .gem-c-cookie-banner__message {
139
- margin-bottom: 0;
140
- }
141
-
142
70
  p {
143
71
  @include govuk-font($size: 19);
144
72
  margin: 0 0 govuk-spacing(2) 0;
145
73
  }
146
74
 
147
- .gem-c-cookie-banner__confirmation-message {
148
- @include govuk-media-query($from: desktop) {
149
- margin-bottom: 0;
150
- }
75
+ .gem-c-cookie-banner__message,
76
+ .gem-c-cookie-banner__confirmation {
77
+ margin-bottom: - govuk-spacing(2);
151
78
  }
152
79
  }
@@ -34,6 +34,21 @@ $large-input-size: 50px;
34
34
  }
35
35
  }
36
36
 
37
+ %gem-c-search-input-focus {
38
+ outline: $govuk-focus-width solid $govuk-focus-colour;
39
+ // Ensure outline appears outside of the element
40
+ outline-offset: 0;
41
+ // Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width`
42
+ // Also, `outline` cannot be utilised here as it is already used for the yellow focus state.
43
+ box-shadow: inset 0 0 0 $govuk-border-width-form-element;
44
+
45
+ @include govuk-if-ie8 {
46
+ // IE8 doesn't support `box-shadow` so double the border with
47
+ // `border-width`.
48
+ border-width: $govuk-border-width-form-element * 2;
49
+ }
50
+ }
51
+
37
52
  .gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
38
53
  @include govuk-font($size: 19, $line-height: (28 / 19));
39
54
  margin: 0;
@@ -59,25 +74,14 @@ $large-input-size: 50px;
59
74
  }
60
75
 
61
76
  &:focus {
62
- outline: $govuk-focus-width solid $govuk-focus-colour;
63
- // Ensure outline appears outside of the element
64
- outline-offset: 0;
65
- // Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width`
66
- // Also, `outline` cannot be utilised here as it is already used for the yellow focus state.
67
- box-shadow: inset 0 0 0 $govuk-border-width-form-element;
68
-
69
- @include govuk-if-ie8 {
70
- // IE8 doesn't support `box-shadow` so double the border with
71
- // `border-width`.
72
- border-width: $govuk-border-width-form-element * 2;
73
- }
77
+ @extend %gem-c-search-input-focus;
74
78
  }
75
79
  }
76
80
 
77
81
  @include govuk-compatibility(govuk_template) {
78
82
  // ultra specific rule overrides focus styling from govuk_template
79
83
  #global-header .gem-c-search__input[type="search"]:focus { // stylelint-disable selector-max-id
80
- @extend .gem-c-search__input[type="search"]:focus; // stylelint-disable scss/at-extend-no-missing-placeholder
84
+ @extend %gem-c-search-input-focus;
81
85
  }
82
86
  }
83
87