govuk_publishing_components 53.0.0 → 54.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +25 -9
  3. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +5 -14
  4. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -18
  5. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +3 -12
  6. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +2 -9
  8. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -11
  9. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +1 -5
  10. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +1 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -2
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +2 -9
  13. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -9
  14. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -2
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -5
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -8
  17. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +0 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -9
  21. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +15 -55
  22. data/app/controllers/govuk_publishing_components/audit_controller.rb +1 -0
  23. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -1
  24. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  25. data/app/models/govuk_publishing_components/audit_comparer.rb +1 -1
  26. data/app/models/govuk_publishing_components/audit_components.rb +1 -1
  27. data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -0
  28. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +2 -1
  29. data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -6
  30. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +3 -0
  31. data/app/views/govuk_publishing_components/components/_heading.html.erb +0 -1
  32. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +6 -21
  33. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -1
  34. data/app/views/govuk_publishing_components/components/_metadata.html.erb +0 -3
  35. data/app/views/govuk_publishing_components/components/_radio.html.erb +0 -1
  36. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -4
  37. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +0 -2
  38. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -4
  39. data/config/locales/ar.yml +0 -1
  40. data/config/locales/az.yml +0 -1
  41. data/config/locales/be.yml +0 -1
  42. data/config/locales/bg.yml +0 -1
  43. data/config/locales/bn.yml +0 -1
  44. data/config/locales/cs.yml +0 -1
  45. data/config/locales/cy.yml +0 -1
  46. data/config/locales/da.yml +0 -1
  47. data/config/locales/de.yml +0 -1
  48. data/config/locales/dr.yml +0 -1
  49. data/config/locales/el.yml +0 -1
  50. data/config/locales/en.yml +6 -7
  51. data/config/locales/es-419.yml +1 -2
  52. data/config/locales/es.yml +1 -2
  53. data/config/locales/et.yml +0 -1
  54. data/config/locales/fa.yml +0 -1
  55. data/config/locales/fi.yml +0 -1
  56. data/config/locales/fr.yml +0 -1
  57. data/config/locales/gd.yml +0 -1
  58. data/config/locales/gu.yml +0 -1
  59. data/config/locales/he.yml +0 -1
  60. data/config/locales/hi.yml +0 -1
  61. data/config/locales/hr.yml +0 -1
  62. data/config/locales/hu.yml +0 -1
  63. data/config/locales/hy.yml +0 -1
  64. data/config/locales/id.yml +0 -1
  65. data/config/locales/is.yml +0 -1
  66. data/config/locales/it.yml +0 -1
  67. data/config/locales/ja.yml +0 -1
  68. data/config/locales/ka.yml +0 -1
  69. data/config/locales/kk.yml +0 -1
  70. data/config/locales/ko.yml +0 -1
  71. data/config/locales/lt.yml +0 -1
  72. data/config/locales/lv.yml +0 -1
  73. data/config/locales/ms.yml +0 -1
  74. data/config/locales/mt.yml +0 -1
  75. data/config/locales/nl.yml +0 -1
  76. data/config/locales/no.yml +0 -1
  77. data/config/locales/pa-pk.yml +0 -1
  78. data/config/locales/pa.yml +0 -1
  79. data/config/locales/pl.yml +0 -1
  80. data/config/locales/ps.yml +0 -1
  81. data/config/locales/pt.yml +0 -1
  82. data/config/locales/ro.yml +0 -1
  83. data/config/locales/ru.yml +0 -1
  84. data/config/locales/si.yml +0 -1
  85. data/config/locales/sk.yml +0 -1
  86. data/config/locales/sl.yml +0 -1
  87. data/config/locales/so.yml +0 -1
  88. data/config/locales/sq.yml +0 -1
  89. data/config/locales/sr.yml +0 -1
  90. data/config/locales/sv.yml +0 -1
  91. data/config/locales/sw.yml +0 -1
  92. data/config/locales/ta.yml +0 -1
  93. data/config/locales/th.yml +0 -1
  94. data/config/locales/tk.yml +0 -1
  95. data/config/locales/tr.yml +0 -1
  96. data/config/locales/uk.yml +0 -1
  97. data/config/locales/ur.yml +0 -1
  98. data/config/locales/uz.yml +0 -1
  99. data/config/locales/vi.yml +0 -1
  100. data/config/locales/zh-hk.yml +0 -1
  101. data/config/locales/zh-tw.yml +0 -1
  102. data/config/locales/zh.yml +0 -1
  103. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +35 -26
  104. data/lib/govuk_publishing_components/config.rb +3 -0
  105. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +2 -6
  106. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +2 -2
  107. data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +14 -14
  108. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb +1 -1
  109. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +1 -1
  110. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
  111. data/lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb +1 -1
  112. data/lib/govuk_publishing_components/presenters/machine_readable/government_service_schema.rb +2 -2
  113. data/lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb +3 -3
  114. data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -2
  115. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  116. data/lib/govuk_publishing_components/version.rb +1 -1
  117. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30fda3ff179316f100982d0cfba8cfde4b1c66b1774ffb3c58f0f4fba2718349
4
- data.tar.gz: 718923c362bc6cb9006796a01c4a9ac56eacb1a44cb454db59489cbb3fc71364
3
+ metadata.gz: 86dda672f3ba9aab6652fe7a61262828fcbf325846d677dac46bf3acbee0288d
4
+ data.tar.gz: c6fdf3be956c6c65886324672be78cd312f3a2b89f8cc3707410dfa1404e7c8d
5
5
  SHA512:
6
- metadata.gz: fed49a157451bdea9c8fbfaacbdcf52847abe0bdeafdf9c06d227e9dacc3450fd5cc92fb8df4ec07bf5b25ed93e2ee7fd5d07d10f0408bbb0273f8c5d8cd72c5
7
- data.tar.gz: f3e4c027b49b5a4e39e68020ff1761dd6c7ca9306e1b0a8350312c8a7db316aa2412c67ef41039a8fbb52439440654905ef3f68042044802e597dad009c234b8
6
+ metadata.gz: 4e72340ed40f1523cda2b245a131fb54c042af7d1f2968a5202e8416aef9cc7fa936582df26d4fbb6fa9f9bb422c46cf215cbc9078627a6f3b199f5b6d12d7e7
7
+ data.tar.gz: ecbe763dc4259ff481dccfedba4a08827b131f070cacddeab8bd429d3d5af40348906645c23f1a0ff7c6bb51d62f1e5dfeac67ea149375a7f3ee797382d0f171
@@ -13,17 +13,11 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey");
13
13
  position: relative;
14
14
  @include govuk-font(19);
15
15
  @include govuk-clearfix;
16
-
17
- .govuk-details {
18
- margin: govuk-spacing(3) 0;
19
- }
20
16
  }
21
17
 
22
18
  .gem-c-attachment__thumbnail {
23
19
  position: relative;
24
20
  width: auto;
25
- margin-right: govuk-spacing(5);
26
- margin-bottom: govuk-spacing(3);
27
21
  padding: $thumbnail-border-width;
28
22
  float: left;
29
23
  }
@@ -31,20 +25,30 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey");
31
25
  .gem-c-attachment__thumbnail-image {
32
26
  display: block;
33
27
  width: auto; // for IE8
34
- max-width: $thumbnail-width;
35
- height: $thumbnail-height;
28
+ max-width: calc($thumbnail-width / 1.5);
29
+ height: calc($thumbnail-height / 1.5);
36
30
  border: $thumbnail-border-colour; // for IE9 & IE10
37
31
  outline: $thumbnail-border-width solid $thumbnail-border-colour;
38
32
  background: $thumbnail-background;
39
33
  box-shadow: $thumbnail-shadow-width $thumbnail-shadow-colour;
40
34
  fill: $thumbnail-icon-border-colour;
41
35
  stroke: $thumbnail-icon-border-colour;
36
+
37
+ @include govuk-media-query($from: tablet) {
38
+ max-width: $thumbnail-width;
39
+ height: $thumbnail-height;
40
+ }
42
41
  }
43
42
 
44
43
  .gem-c-attachment__details {
45
- padding-left: $thumbnail-width + $thumbnail-border-width * 2 + govuk-spacing(5);
44
+ padding-left: calc(($thumbnail-width + $thumbnail-border-width * 2 + govuk-spacing(5)) / 1.5);
45
+
46
+ @include govuk-media-query($from: tablet) {
47
+ padding-left: $thumbnail-width + $thumbnail-border-width * 2 + govuk-spacing(5);
48
+ }
46
49
 
47
50
  .gem-c-details {
51
+ margin-top: govuk-spacing(3);
48
52
  word-break: break-word;
49
53
  word-wrap: break-word;
50
54
  }
@@ -76,6 +80,18 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey");
76
80
  }
77
81
  }
78
82
 
83
+ .govspeak,
84
+ .gem-c-govspeak {
85
+ .gem-c-attachment__title {
86
+ @include govuk-font($size: 27, $weight: regular);
87
+ margin: 0 0 govuk-spacing(3) 0;
88
+ }
89
+
90
+ .gem-c-attachment__metadata {
91
+ margin: 0 0 govuk-spacing(3) 0;
92
+ }
93
+ }
94
+
79
95
  .gem-c-attachment__metadata--compact {
80
96
  margin-bottom: 0;
81
97
  }
@@ -25,16 +25,16 @@
25
25
  @include govuk-font($size: 27, $weight: bold);
26
26
  }
27
27
 
28
- .stat-headline:first-child {
29
- margin-top: govuk-spacing(6);
28
+ * + h2,
29
+ * + h3 {
30
+ padding-top: govuk-spacing(3);
30
31
 
31
32
  @include govuk-media-query($from: tablet) {
32
- margin-top: govuk-spacing(9) + govuk-spacing(4);
33
+ padding-top: govuk-spacing(9);
33
34
  }
34
35
  }
35
36
 
36
- h2,
37
- h3 {
37
+ .stat-headline:first-child {
38
38
  margin-top: govuk-spacing(6);
39
39
 
40
40
  @include govuk-media-query($from: tablet) {
@@ -42,15 +42,6 @@
42
42
  }
43
43
  }
44
44
 
45
- h2:first-child,
46
- h3:first-child {
47
- margin-top: govuk-spacing(4);
48
-
49
- @include govuk-media-query($from: tablet) {
50
- margin-top: 0;
51
- }
52
- }
53
-
54
45
  h3 .number,
55
46
  h4 .number,
56
47
  h5 .number,
@@ -9,28 +9,14 @@
9
9
 
10
10
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
11
11
  .gem-c-govspeak {
12
- // Scope attachment and attachment-link component styles to gem-c-govspeak
13
- @import "../attachment-link";
14
- @import "../attachment";
15
- @import "../details";
16
-
17
- // This block is duplicated from Whitehall as a transitional step, see the
18
- // commit message for 2d893c10ee3f2cab27162b9aba38b12379a71d07 before making
19
- // changes, original version:
20
- // https://github.com/alphagov/whitehall/blob/main/app/assets/stylesheets/frontend/helpers/_attachment.scss
21
12
  $thumbnail-width: 99px;
22
13
 
23
14
  .attachment {
24
15
  position: relative;
25
- margin: govuk-spacing(6) 0;
26
- padding: govuk-spacing(3) 0 0 ($thumbnail-width + govuk-spacing(6));
16
+ margin: 0 0 govuk-spacing(6) 0;
17
+ padding: 0 0 0 ($thumbnail-width + govuk-spacing(6));
27
18
  @include govuk-clearfix;
28
19
 
29
- &:first-child {
30
- margin-top: 0;
31
- padding-top: 0;
32
- }
33
-
34
20
  @include govuk-media-query($media-type: print) {
35
21
  padding-left: 0;
36
22
  }
@@ -64,12 +50,12 @@
64
50
 
65
51
  .attachment-details {
66
52
  h2 {
67
- margin: 0;
53
+ margin: 0 0 govuk-spacing(2) 0;
68
54
  @include govuk-font($size: 27);
69
55
  }
70
56
 
71
57
  p {
72
- margin: govuk-spacing(2) 0;
58
+ margin: 0 0 govuk-spacing(2) 0;
73
59
  }
74
60
 
75
61
  .metadata {
@@ -9,18 +9,9 @@
9
9
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
10
10
  .gem-c-govspeak {
11
11
  .call-to-action {
12
- margin: 2em 0;
12
+ margin: 0 0 govuk-spacing(4) 0;
13
13
  background-color: govuk-colour("light-grey");
14
- padding: 2em;
15
-
16
- &:first-child {
17
- margin-top: 0;
18
- }
19
-
20
- p:last-child,
21
- ul:last-child,
22
- ol:last-child {
23
- margin-bottom: 0;
24
- }
14
+ padding: govuk-spacing(6);
15
+ padding-bottom: govuk-spacing(2);
25
16
  }
26
17
  }
@@ -14,8 +14,7 @@
14
14
  .contact {
15
15
  border-left: 1px solid govuk-colour("mid-grey");
16
16
  padding-left: govuk-spacing(3);
17
- margin-bottom: govuk-spacing(6);
18
- margin-top: govuk-spacing(6);
17
+ margin: 0 0 govuk-spacing(6) 0;
19
18
  }
20
19
 
21
20
  .contact {
@@ -9,15 +9,8 @@
9
9
  .gem-c-govspeak {
10
10
  .example {
11
11
  border-left: 10px solid govuk-colour("mid-grey");
12
- padding: 1em 0 1em 1em;
13
- margin: 2em 0;
14
-
15
- // Remove margin from the last element
16
- p:last-child,
17
- ul:last-child,
18
- ol:last-child {
19
- margin-bottom: 0;
20
- }
12
+ padding: govuk-spacing(4) 0 0.1234px govuk-spacing(4); // non-zero padding on bottom keeps margin of last element inside parent, simulating padding
13
+ margin: 0 0 govuk-spacing(4) 0;
21
14
 
22
15
  strong {
23
16
  display: block;
@@ -15,20 +15,11 @@
15
15
  .gem-c-govspeak {
16
16
  .footnotes {
17
17
  border-top: 1px solid govuk-colour("mid-grey");
18
- margin-top: govuk-spacing(6);
19
- padding-top: govuk-spacing(2);
18
+ margin: 0 0 govuk-spacing(4) 0;
19
+ padding-top: govuk-spacing(4);
20
20
 
21
21
  a {
22
22
  overflow-wrap: break-word;
23
23
  }
24
-
25
- ol {
26
- margin-top: 0;
27
- padding-top: 0;
28
-
29
- li p {
30
- margin: 10px 0;
31
- }
32
- }
33
24
  }
34
25
  }
@@ -1,11 +1,7 @@
1
1
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
2
2
  .gem-c-govspeak {
3
3
  .form-download {
4
- padding: .25em 0;
5
-
6
- @include govuk-media-query($until: tablet) {
7
- margin: 1em 0 1.5em;
8
- }
4
+ margin: 0 0 govuk-spacing(4) 0;
9
5
 
10
6
  p {
11
7
  padding-right: 3em;
@@ -10,7 +10,7 @@ $highlight-answer-color: govuk-colour("white");
10
10
  color: $highlight-answer-color;
11
11
  text-align: center;
12
12
  padding: govuk-spacing(5) govuk-spacing(2) govuk-spacing(4);
13
- margin: 0 0 govuk-spacing(2);
13
+ margin: 0 0 govuk-spacing(4);
14
14
 
15
15
  p {
16
16
  color: $highlight-answer-color;
@@ -29,7 +29,6 @@ $highlight-answer-color: govuk-colour("white");
29
29
  }
30
30
 
31
31
  @include govuk-media-query($until: tablet) {
32
- margin: 0 0 govuk-spacing(2);
33
32
  @include govuk-font($size: 48);
34
33
 
35
34
  p {
@@ -16,8 +16,7 @@
16
16
  width: 100%;
17
17
  clear: both;
18
18
  overflow: hidden;
19
- padding: govuk-spacing(2) 0 0;
20
- margin: 0;
19
+ margin: 0 0 govuk-spacing(4) 0;
21
20
 
22
21
  img {
23
22
  display: inline;
@@ -10,14 +10,7 @@
10
10
  .gem-c-govspeak {
11
11
  .info-notice {
12
12
  border-left: 10px solid govuk-colour("mid-grey");
13
- padding: 1em 0 1em 1em;
14
- margin: 2em 0;
15
-
16
- // Remove margin from the last element
17
- p:last-child,
18
- ul:last-child,
19
- ol:last-child {
20
- margin-bottom: 0;
21
- }
13
+ padding: govuk-spacing(4) 0 0.1234px govuk-spacing(4); // non-zero padding on bottom keeps margin of last element inside parent, simulating padding
14
+ margin: 0 0 govuk-spacing(4) 0;
22
15
  }
23
16
  }
@@ -9,15 +9,7 @@
9
9
  .gem-c-govspeak {
10
10
  .legislative-list {
11
11
  list-style: none;
12
- margin: 5px 0;
13
-
14
- li {
15
- margin: 5px 0;
16
- }
17
-
18
- p {
19
- margin: 20px 0;
20
- }
12
+ margin: 0 0 govuk-spacing(4) 0;
21
13
 
22
14
  ol {
23
15
  margin: govuk-spacing(2) 0 govuk-spacing(2) govuk-spacing(6);
@@ -9,8 +9,7 @@
9
9
  position: relative;
10
10
  height: 0;
11
11
  overflow: hidden;
12
- margin-top: govuk-spacing(2);
13
- margin-bottom: govuk-spacing(2);
12
+ margin: 0 0 govuk-spacing(4) 0;
14
13
  padding-top: 0;
15
14
  padding-left: 0;
16
15
  padding-right: 0;
@@ -2,7 +2,7 @@
2
2
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
3
3
  .gem-c-govspeak {
4
4
  .place {
5
- margin: 1.5em 0;
5
+ margin: 0 0 govuk-spacing(4) 0;
6
6
  border-bottom: solid 1px govuk-colour("mid-grey");
7
7
  padding-bottom: 1.5em;
8
8
 
@@ -25,10 +25,6 @@
25
25
  margin: .25em 0;
26
26
  }
27
27
  }
28
-
29
- @include govuk-media-query($until: tablet) {
30
- margin: .75em 0;
31
- }
32
28
  }
33
29
  }
34
30
  // stylelint-enable max-nesting-depth
@@ -8,13 +8,7 @@
8
8
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
9
9
  .gem-c-govspeak {
10
10
  .stat-headline {
11
- margin-bottom: govuk-spacing(3);
12
- margin-top: govuk-spacing(3);
13
-
14
- @include govuk-media-query($from: tablet) {
15
- margin-bottom: govuk-spacing(4);
16
- margin-top: govuk-spacing(4);
17
- }
11
+ margin: 0 0 govuk-spacing(4) 0;
18
12
 
19
13
  p {
20
14
  margin: 0;
@@ -23,7 +17,6 @@
23
17
 
24
18
  em {
25
19
  display: block;
26
- margin: 3px 0 -5px;
27
20
  @include govuk-font($size: 80, $weight: bold);
28
21
  }
29
22
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  > li {
8
8
  list-style-type: none;
9
- margin-left: 0;
9
+ margin: 0;
10
10
  padding: .75em 0 .75em 2.5em;
11
11
  position: relative;
12
12
 
@@ -11,7 +11,7 @@
11
11
  border-collapse: collapse;
12
12
  border-spacing: 0;
13
13
  display: block;
14
- margin: govuk-spacing(6) 0;
14
+ margin: 0 0 govuk-spacing(6) 0;
15
15
  overflow-x: auto;
16
16
  width: 100%;
17
17
  @include govuk-font($size: 19);
@@ -26,7 +26,6 @@
26
26
 
27
27
  ul,
28
28
  ol {
29
- margin-top: 0;
30
29
  margin-bottom: 0;
31
30
  }
32
31
  }
@@ -14,8 +14,8 @@
14
14
  $icon-size: 35px;
15
15
  $icon-spacing: 10px;
16
16
 
17
- margin: 2em 0;
18
- padding-left: calc($icon-size + $icon-spacing);
17
+ padding: govuk-spacing(3) 0 0 calc($icon-size + $icon-spacing);
18
+ margin: 0 0 govuk-spacing(6) 0;
19
19
  position: relative;
20
20
 
21
21
  &::before {
@@ -28,11 +28,4 @@
28
28
  @include govuk-font($size: 19, $weight: bold);
29
29
  }
30
30
  }
31
-
32
- // Prevent excessive spacing when placed in a call-to-action block
33
- .call-to-action {
34
- .help-notice:first-child {
35
- margin-top: 0;
36
- }
37
- }
38
31
  }
@@ -1,23 +1,24 @@
1
1
  @mixin markdown-typography {
2
2
  @include govuk-text-colour;
3
-
4
3
  @include govuk-font($size: 16);
5
4
 
6
5
  ol,
7
6
  ul,
8
7
  p {
9
- margin-top: govuk-spacing(3);
10
- margin-bottom: govuk-spacing(3);
8
+ margin: 0 0 govuk-spacing(4) 0;
11
9
  @include govuk-font($size: 19);
12
-
13
- @include govuk-media-query($from: tablet) {
14
- margin-top: govuk-spacing(4);
15
- margin-bottom: govuk-spacing(4);
16
- }
17
10
  }
18
11
 
19
12
  // Headings
20
13
 
14
+ // put some spacing between any element followed by a heading
15
+ // has to be padding on the heading otherwise margins would overlap
16
+
17
+ * + h2,
18
+ * + h3 {
19
+ padding-top: govuk-spacing(4);
20
+ }
21
+
21
22
  // Markdown is expected to be styled within a document with a H1 title
22
23
  // thus H1's are not expected and are discouraged by bare styling
23
24
 
@@ -28,45 +29,22 @@
28
29
  }
29
30
 
30
31
  h2 {
31
- margin-top: govuk-spacing(6);
32
- margin-bottom: govuk-spacing(4);
32
+ margin: 0 0 govuk-spacing(4) 0;
33
33
  @include govuk-font($size: 27, $weight: bold);
34
-
35
- @include govuk-media-query($from: desktop) {
36
- margin-top: govuk-spacing(6) * 1.5;
37
- }
38
34
  }
39
35
 
40
36
  h3 {
41
- margin-top: govuk-spacing(6) + 5px;
42
- margin-bottom: 0;
37
+ margin: 0 0 govuk-spacing(4) 0;
43
38
  @include govuk-font($size: 19, $weight: bold);
44
39
  }
45
40
 
46
41
  // H4, H5 and H6 are discouraged and thus styled the same
47
42
 
48
43
  h4,
49
- h5,
50
- h6 {
51
- margin-top: govuk-spacing(6) + 5px;
52
- margin-bottom: 0;
53
- @include govuk-font($size: 19, $weight: bold);
54
-
55
- + p {
56
- margin-top: 5px;
57
- }
58
- }
59
-
60
44
  h5,
61
45
  h6 {
62
46
  margin: 0;
63
- }
64
-
65
- h2:first-child,
66
- h3:first-child,
67
- h4:first-child,
68
- p:first-child {
69
- margin-top: 0;
47
+ @include govuk-font($size: 19, $weight: bold);
70
48
  }
71
49
 
72
50
  // Links
@@ -89,15 +67,8 @@
89
67
  // utilise the type attribute for the formatting. Browsers default to a
90
68
  // style of decimal.
91
69
  list-style-position: outside;
92
- margin-left: govuk-spacing(4);
70
+ margin: 0 0 govuk-spacing(4) govuk-spacing(4);
93
71
  padding: 0;
94
-
95
- ul,
96
- ol {
97
- margin-top: 0;
98
- margin-bottom: 0;
99
- padding: 0;
100
- }
101
72
  }
102
73
 
103
74
  ul {
@@ -105,22 +76,11 @@
105
76
  }
106
77
 
107
78
  li {
108
- margin: 0 0 5px;
79
+ margin: 0 0 govuk-spacing(2);
109
80
  padding: 0;
110
81
 
111
82
  p {
112
- margin: 0;
113
- padding: 0;
114
- }
115
-
116
- p + p,
117
- p + ul,
118
- p + ol,
119
- ul + p,
120
- ul + ol,
121
- ol + p,
122
- ol + ul {
123
- margin-top: 5px;
83
+ margin: 0 0 govuk-spacing(2);
124
84
  }
125
85
  }
126
86
 
@@ -17,6 +17,7 @@ module GovukPublishingComponents
17
17
  government-frontend
18
18
  govspeak
19
19
  govspeak-preview
20
+ govuk-chat
20
21
  govuk-developer-docs
21
22
  local-links-manager
22
23
  manuals-publisher
@@ -1,6 +1,6 @@
1
1
  module GovukPublishingComponents
2
2
  class ComponentGuideController < GovukPublishingComponents::ApplicationController
3
- append_view_path File.join(Rails.root, "app", "views", GovukPublishingComponents::Config.component_directory_name)
3
+ append_view_path Rails.root.join("app", "views", GovukPublishingComponents::Config.component_directory_name).to_s
4
4
 
5
5
  MATCH_COMPONENTS = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/
6
6
 
@@ -118,7 +118,7 @@ module GovukPublishingComponents
118
118
  @gem_style_references << gem_style_references if gem_style_references
119
119
  end
120
120
  rescue StandardError => e
121
- puts e.message
121
+ Rails.logger.debug e.message
122
122
  end
123
123
 
124
124
  components_found.flatten.uniq.sort
@@ -290,7 +290,7 @@ module GovukPublishingComponents
290
290
  results = []
291
291
 
292
292
  @applications_data.each do |application|
293
- next unless application[:application_found] && !application[:helper_references].blank?
293
+ next unless application[:application_found] && application[:helper_references].present?
294
294
 
295
295
  application[:helper_references].each do |key, value|
296
296
  location = {
@@ -275,7 +275,7 @@ module GovukPublishingComponents
275
275
  next unless File.file?(file)
276
276
 
277
277
  helpers.each do |helper|
278
- next unless File.foreach(file).grep(helper[:match]).present?
278
+ next if File.foreach(file).grep(helper[:match]).blank?
279
279
 
280
280
  helper[:used_by] << {
281
281
  name: component[:name],
@@ -8,6 +8,7 @@
8
8
  attributes = []
9
9
  url_data_attributes ||= {}
10
10
  details_ga4_attributes ||= {}
11
+ local_assigns[:margin_bottom] ||= 6
11
12
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
12
13
 
13
14
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
@@ -126,6 +127,7 @@
126
127
  <%= render "govuk_publishing_components/components/details", {
127
128
  title: t("components.attachment.request_format_cta"),
128
129
  ga4_attributes: details_ga4_attributes,
130
+ margin_bottom: 0,
129
131
  } do %>
130
132
  <%= t("components.attachment.request_format_details_html", alternative_format_contact_email: attachment.alternative_format_contact_email) %>
131
133
  <% end %>
@@ -15,7 +15,8 @@
15
15
  end
16
16
  text = raw(text)
17
17
 
18
- cookie_preferences_href ||= "/help/cookies"
18
+ absolute_links_helper = GovukPublishingComponents::Presenters::AbsoluteLinksHelper.new()
19
+ cookie_preferences_href ||= absolute_links_helper.make_url_absolute("/help/cookies")
19
20
  confirmation_message ||= raw(t("components.cookie_banner.confirmation_message.html",
20
21
  link: link_to(
21
22
  t("components.cookie_banner.confirmation_message.link"),
@@ -2,13 +2,9 @@
2
2
  add_gem_component_stylesheet("button")
3
3
  add_gem_component_stylesheet("feedback")
4
4
 
5
- def utf_encode(element)
6
- element.is_a?(String) ? element.encode : element
7
- end
8
-
9
5
  email_regex = /[^\s=\/?&]+(?:@|%40)[^\s=\/?&]+/
10
- url_without_pii = utf_encode(request.original_url.gsub(email_regex, '[email]'))
11
- path_without_pii = utf_encode(request.fullpath.gsub(email_regex, '[email]'))
6
+ url_without_pii = request.original_url.gsub(email_regex, '[email]').encode
7
+ path_without_pii = request.fullpath.gsub(email_regex, '[email]').encode
12
8
 
13
9
  disable_ga4 ||= false
14
10
 
@@ -1,5 +1,8 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("govspeak")
3
+ add_gem_component_stylesheet("attachment-link")
4
+ add_gem_component_stylesheet("attachment")
5
+ add_gem_component_stylesheet("details")
3
6
 
4
7
  inverse ||= false
5
8
  local_assigns[:margin_bottom] ||= 0
@@ -2,7 +2,6 @@
2
2
  add_gem_component_stylesheet("heading")
3
3
 
4
4
  brand ||= false
5
- lang = local_assigns[:lang].presence
6
5
  context ||= false
7
6
  context_locale ||= false
8
7
  context_inside ||= false