govuk_publishing_components 24.1.0 → 24.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) 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/show-password.js +7 -2
  6. data/app/assets/stylesheets/component_guide/application.scss +0 -8
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +2 -6
  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/_layout-header.scss +21 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +4 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +1 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
  15. data/app/models/govuk_publishing_components/audit_applications.rb +2 -2
  16. data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
  17. data/app/models/govuk_publishing_components/component_example.rb +4 -3
  18. data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
  19. data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
  20. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
  21. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
  22. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
  23. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +50 -39
  24. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
  25. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  26. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  27. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
  30. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  31. data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
  32. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  34. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  35. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
  36. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
  38. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
  39. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
  40. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/docs/accordion.yml +29 -0
  42. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
  43. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
  44. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  45. data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
  46. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
  47. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
  48. data/config/locales/en.yml +7 -5
  49. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
  50. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
  51. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
  52. data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
  53. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
  54. data/lib/govuk_publishing_components/version.rb +1 -1
  55. data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
  56. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93a8bde02a39806e02cc9007a6b503aa3e65af3f1e7768b29f1d82c2c0ae66c4
4
- data.tar.gz: b1e3bf6f8b98f5a4dcf2847fdca19aeed81b140491d43c230a5ea7074961d91b
3
+ metadata.gz: c4d1ec41252338a07ea74058d30230718eeb00761dce65a04735b66f59c75edc
4
+ data.tar.gz: 2a9a849880b9ac590a9c1139d6aff23d4192ab85fd4263c766601ddda3d3ccb8
5
5
  SHA512:
6
- metadata.gz: 64cffb98c5dc002910a32ee736f21500ca921d5c3e5d165f66f87688d4e2a589da8e4aa69deba06b953924cf152aaac39e2f19752e80f7d7184285c9ce43bf8e
7
- data.tar.gz: d1defc316e8d5e7171d903fa874ef1d8c93d416f1ce28e4c860aaed644b088e9621e24b2fb5a955768234a0d8d642193283509819348693b39c121e584aeeb5f
6
+ metadata.gz: d4b9e972b59ff07f4ab7d5b58699ac24518c2420a66785f429a65d997ba546be5cdb8974522dbb7e13d96745e3f1eb54d13c8d6e8a5a04b1ef185f23fbd60e85
7
+ data.tar.gz: 3348baaafb42e9c5e78168a0628c4c1ada2b3087a4e6c990aa890e8ed71597614bf442db7d18fdc95deda650957bdbda339d8c1095947f3ae533d3319b3a874b
@@ -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 () {
@@ -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
 
@@ -1,5 +1,3 @@
1
- @import "govuk_publishing_components/component_support";
2
-
3
1
  $gem-c-accordion-border-width: 3px;
4
2
  $gem-c-accordion-bottom-border-width: 1px;
5
3
 
@@ -16,8 +14,7 @@ $gem-c-accordion-bottom-border-width: 1px;
16
14
  padding-top: govuk-spacing(2) 0;
17
15
  }
18
16
 
19
- .gem-c-accordion__section-heading,
20
- .gem-c-accordion__section-summary {
17
+ .gem-c-accordion__section-heading {
21
18
  margin: govuk-spacing(1) 0;
22
19
  }
23
20
 
@@ -242,7 +239,7 @@ $gem-c-accordion-bottom-border-width: 1px;
242
239
 
243
240
  // Change the summary subheading size.
244
241
  .gem-c-accordion__section-summary {
245
- @include govuk-responsive-margin(2, "top");
242
+ @include govuk-responsive-margin(1, "top");
246
243
  @include govuk-responsive-margin(2, "bottom");
247
244
  @include govuk-typography-common;
248
245
  @include govuk-typography-responsive($size: 19);
@@ -303,7 +300,6 @@ $gem-c-accordion-bottom-border-width: 1px;
303
300
 
304
301
  .gem-c-accordion__section-summary {
305
302
  @include govuk-typography-responsive($size: 16, $important: true);
306
- margin: govuk-spacing(1) 0;
307
303
  }
308
304
 
309
305
  .gem-c-accordion__toggle-link {
@@ -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
  }