govuk_publishing_components 24.12.0 → 24.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +3 -0
  3. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +50 -31
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -35
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -13
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -6
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +0 -4
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -3
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +1 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -2
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +6 -2
  15. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -0
  16. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -1
  17. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -3
  18. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +7 -7
  19. data/app/views/govuk_publishing_components/components/_image_card.html.erb +15 -2
  20. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +13 -13
  21. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +10 -6
  22. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  23. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -7
  24. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +2 -0
  25. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +2 -2
  26. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +18 -15
  27. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
  28. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +0 -3
  29. data/lib/govuk_publishing_components/version.rb +1 -1
  30. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bf26b097c1773c4126687d518e698357b3c57425cc63f3b55788ed58e211019
4
- data.tar.gz: 8a016b8a8d05b0805600eb6770fd401e8af63a8086bc077ed1cdc9c2816a64f2
3
+ metadata.gz: 1a7412745cae4dbe87f20efe5c2b982af372122cae8564c4f7279f17ea16f82a
4
+ data.tar.gz: 8f52c319afd75c6744c17b39719624bdda2888908d481291fc7fe34e51fb604d
5
5
  SHA512:
6
- metadata.gz: e32f62161f041f1614788acb40837ac1d535a90721de924bd1d86ce8e4abff8be1051fe10742042347fcb22982f45b35cba12e8f8eb2f3e07690cd57c5f78644
7
- data.tar.gz: 57329b331cd9939c9f00c08b216c30b8b7ae1349ba1a2aa881ff488b14a49c795a7fcf2dc287243aa80f50159899bdfa1e9aa69677a39f3fe46cc8144ae2f91f
6
+ metadata.gz: ee916cc182125dc67fab048c61b9647434141a8a28832015d1d2f2159cf329506375fe136e8f46b8989a00f8c7f7ae7c7fabeec0e6195eae9b6eb0c9114ea644
7
+ data.tar.gz: a0bdb49b4a265e2054a05121d0d1f6c0cf0c79d5aaa3c0d0d390e90712b9935cd484cbe3cb0cc62ab2b5c2ac43ce9784b24ea4475791e32ed6b9aa2d322b6e34
@@ -1,6 +1,9 @@
1
1
  // This is the file that the application needs to include in order to use
2
2
  // the components.
3
3
 
4
+ // feature flag for accessible link styles
5
+ $govuk-new-link-styles: true;
6
+
4
7
  @import "govuk_publishing_components/govuk_frontend_support";
5
8
  @import "govuk_publishing_components/component_support";
6
9
 
@@ -40,6 +40,7 @@ $gem-c-accordion-bottom-border-width: 1px;
40
40
  @include govuk-font($size: 16);
41
41
  @include govuk-link-common;
42
42
  @include govuk-link-style-default;
43
+
43
44
  // Remove default button focus outline in Firefox
44
45
  &::-moz-focus-inner {
45
46
  padding: 0;
@@ -47,21 +48,6 @@ $gem-c-accordion-bottom-border-width: 1px;
47
48
  }
48
49
  }
49
50
 
50
- .gem-c-accordion__open-all:hover,
51
- .gem-c-accordion__open-all-text:hover {
52
- text-decoration: underline;
53
- color: $govuk-link-colour;
54
- }
55
-
56
- // Focus state, also to change chervon icon to black
57
- .gem-c-accordion__open-all:focus {
58
- .gem-c-accordion__open-all-text,
59
- .gem-c-accordion-nav__chevron {
60
- color: $govuk-focus-text-colour;
61
- text-decoration: none;
62
- }
63
- }
64
-
65
51
  // Create Chervon icon align with text
66
52
  .gem-c-accordion-nav__chevron {
67
53
  vertical-align: text-top;
@@ -73,6 +59,7 @@ $gem-c-accordion-bottom-border-width: 1px;
73
59
  margin-left: govuk-em(5, 14);
74
60
  border: govuk-em(1, 14) solid;
75
61
  border-radius: govuk-em(100, 14);
62
+
76
63
  // Main icon size across views, yet keep responsive for zoom
77
64
  @include govuk-media-query($from: tablet) {
78
65
  width: govuk-em(20, 16);
@@ -94,6 +81,7 @@ $gem-c-accordion-bottom-border-width: 1px;
94
81
  transform: rotate(-45deg);
95
82
  left: govuk-em(6, 14);
96
83
  bottom: govuk-em(5, 14);
84
+
97
85
  @include govuk-media-query($from: tablet) {
98
86
  width: govuk-em(6, 16);
99
87
  height: govuk-em(6, 16);
@@ -105,6 +93,22 @@ $gem-c-accordion-bottom-border-width: 1px;
105
93
  }
106
94
  }
107
95
 
96
+ .gem-c-accordion__open-all:hover,
97
+ .gem-c-accordion__section-button:hover {
98
+ .gem-c-accordion-nav__chevron {
99
+ color: $govuk-link-hover-colour;
100
+ text-decoration: none;
101
+ }
102
+ }
103
+
104
+ // Focus state, also to change chervon icon to black
105
+ .gem-c-accordion__open-all:focus {
106
+ .gem-c-accordion-nav__chevron {
107
+ color: $govuk-focus-text-colour;
108
+ text-decoration: none;
109
+ }
110
+ }
111
+
108
112
  // Rotate icon to create "Down" version
109
113
  .gem-c-accordion-nav__chevron--down {
110
114
  transform: rotate(180deg);
@@ -150,6 +154,10 @@ $gem-c-accordion-bottom-border-width: 1px;
150
154
  @include govuk-typography-common;
151
155
  width: 100%;
152
156
 
157
+ &:hover {
158
+ color: $govuk-link-hover-colour;
159
+ }
160
+
153
161
  &:active {
154
162
  z-index: 1;
155
163
  color: $govuk-link-active-colour;
@@ -163,26 +171,12 @@ $gem-c-accordion-bottom-border-width: 1px;
163
171
  }
164
172
  }
165
173
 
166
- .gem-c-accordion__section-button:hover {
167
- color: $govuk-link-colour;
168
- // On hover, add underline to toggle link
169
- .gem-c-accordion__toggle-text {
170
- text-decoration: underline;
171
- color: $govuk-link-colour;
172
- }
173
- }
174
-
175
174
  .gem-c-accordion__section-button:focus {
176
175
  @include govuk-focused-text;
177
176
  // Overwrite focus border to top
178
177
  box-shadow: 0 0, 0 -4px;
179
178
  border-top: 1px solid transparent;
180
179
 
181
- // Focus state to change the toggle link within individual sections
182
- .gem-c-accordion__toggle-text {
183
- color: $govuk-focus-text-colour;
184
- text-decoration: none;
185
- }
186
180
  // Focus state to change chervon icon colour within individual sections
187
181
  .gem-c-accordion-nav__chevron {
188
182
  color: $govuk-text-colour;
@@ -225,10 +219,24 @@ $gem-c-accordion-bottom-border-width: 1px;
225
219
  }
226
220
  }
227
221
 
228
- // Setting width of the text, so the icon doesn't shift (left / right) when toggled
229
222
  .gem-c-accordion__toggle-text {
230
- min-width: govuk-em(40, 16);
231
223
  display: inline-block;
224
+ // Setting width of the text so the icon doesn't shift left or right when
225
+ // toggled:
226
+ min-width: govuk-em(40, 16);
227
+ }
228
+
229
+ // On hover add underline to toggle link only:
230
+ .gem-c-accordion__section-button:hover .gem-c-accordion__toggle-text {
231
+ color: $govuk-link-hover-colour;
232
+ @include govuk-link-decoration;
233
+ @include govuk-link-hover-decoration;
234
+ }
235
+
236
+ // Ensure the correct focus sstate text colour and no underline:
237
+ .gem-c-accordion__section-button:focus .gem-c-accordion__toggle-text {
238
+ color: $govuk-focus-text-colour;
239
+ text-decoration: none;
232
240
  }
233
241
 
234
242
  .gem-c-accordion__open-all-text {
@@ -237,6 +245,17 @@ $gem-c-accordion-bottom-border-width: 1px;
237
245
  text-align: left;
238
246
  }
239
247
 
248
+ .gem-c-accordion__open-all:hover {
249
+ .gem-c-accordion__open-all-text {
250
+ @include govuk-link-decoration;
251
+ @include govuk-link-hover-decoration;
252
+ }
253
+ }
254
+
255
+ .gem-c-accordion__open-all:focus .gem-c-accordion__open-all-text {
256
+ text-decoration: none;
257
+ }
258
+
240
259
  // Change the summary subheading size.
241
260
  .gem-c-accordion__section-summary {
242
261
  @include govuk-responsive-margin(1, "top");
@@ -32,10 +32,6 @@
32
32
  .gem-c-action-link__link {
33
33
  color: inherit;
34
34
 
35
- &:hover {
36
- text-decoration: underline;
37
- }
38
-
39
35
  &:focus {
40
36
  text-decoration: none;
41
37
  color: $govuk-focus-text-colour;
@@ -106,10 +102,6 @@
106
102
  background-size: 25px auto;
107
103
  background-position: 0 2px;
108
104
  }
109
-
110
- .gem-c-action-link__link {
111
- text-decoration: none;
112
- }
113
105
  }
114
106
 
115
107
  .gem-c-action-link--simple-light {
@@ -122,10 +114,6 @@
122
114
  background-size: 25px auto;
123
115
  background-position: 0 2px;
124
116
  }
125
-
126
- .gem-c-action-link__link {
127
- text-decoration: none;
128
- }
129
117
  }
130
118
 
131
119
  .gem-c-action-link--dark-icon {
@@ -150,10 +138,6 @@
150
138
  background-size: 25px auto;
151
139
  background-position: 0 2px;
152
140
  }
153
-
154
- .gem-c-action-link__link {
155
- text-decoration: none;
156
- }
157
141
  }
158
142
 
159
143
  .gem-c-action-link--transparent-icon {
@@ -177,25 +161,6 @@
177
161
  .gem-c-action-link--light-text {
178
162
  color: govuk-colour("white");
179
163
 
180
- .gem-c-action-link__link,
181
- .gem-c-action-link__subtext-link {
182
- text-decoration: underline;
183
-
184
- &:link,
185
- &:visited {
186
- color: govuk-colour("white");
187
- }
188
-
189
- &:hover {
190
- color: $gem-hover-dark-background;
191
- }
192
-
193
- &:focus {
194
- text-decoration: none;
195
- color: $govuk-focus-text-colour;
196
- }
197
- }
198
-
199
164
  .gem-c-action-link__subtext {
200
165
  &:before {
201
166
  border-color: govuk-colour("white");
@@ -25,19 +25,6 @@
25
25
  list-style-type: none;
26
26
  }
27
27
 
28
- .gem-c-contents-list--no-underline {
29
- .gem-c-contents-list__link {
30
- text-decoration: none;
31
-
32
- &:hover,
33
- &:active {
34
- text-decoration: underline;
35
- }
36
-
37
- @include govuk-template-link-focus-override;
38
- }
39
- }
40
-
41
28
  .gem-c-contents-list__link {
42
29
  .gem-c-contents-list__list-item--parent > & {
43
30
  font-weight: bold;
@@ -63,12 +63,6 @@
63
63
  }
64
64
 
65
65
  .gem-c-image-card__title-link {
66
- text-decoration: none;
67
-
68
- &:hover {
69
- text-decoration: underline;
70
- }
71
-
72
66
  &:focus {
73
67
  text-decoration: none;
74
68
  }
@@ -7,10 +7,6 @@
7
7
  box-sizing: border-box;
8
8
  }
9
9
 
10
- .gem-c-inverse-header a {
11
- color: govuk-colour("white");
12
- }
13
-
14
10
  .gem-c-inverse-header .gem-c-inverse-header__supplement,
15
11
  .gem-c-inverse-header .publication-header__last-changed {
16
12
  // This publication-header class is injected on publication pages, really
@@ -1,12 +1,14 @@
1
1
  // Default logo corresponds with the "medium stacked" Whitehall equivalent
2
2
  .gem-c-organisation-logo {
3
3
  font-size: 13px;
4
- line-height: (15 / 13);
5
4
  font-weight: 400;
5
+ line-height: 1.35;
6
+ // When this is a heading the margin needs to be set to stop it from
7
+ // inheriting the browser's default margin:
8
+ margin: 0;
6
9
 
7
10
  @include govuk-media-query($from: tablet) {
8
11
  font-size: 18px;
9
- line-height: 20px;
10
12
  }
11
13
  }
12
14
 
@@ -62,7 +64,12 @@
62
64
  font-family: "HelveticaNeue", "Helvetica Neue", "Arial", "Helvetica", sans-serif;
63
65
 
64
66
  &:hover {
65
- text-decoration: underline;
67
+ color: $govuk-link-hover-colour;
68
+ }
69
+
70
+ &:active {
71
+ color: govuk-colour("black");
72
+ @include govuk-link-hover-decoration;
66
73
  }
67
74
 
68
75
  &:focus {
@@ -31,6 +31,16 @@
31
31
  &:hover,
32
32
  &:active {
33
33
  background-color: govuk-colour("light-grey", $legacy: "grey-4");
34
+
35
+ // Add govuk-link hover decoration to title if no label present
36
+ .gem-c-pagination__link-text--decorated {
37
+ @include govuk-link-decoration;
38
+ }
39
+
40
+ .gem-c-pagination__link-label,
41
+ .gem-c-pagination__link-text--decorated {
42
+ @include govuk-link-hover-decoration;
43
+ }
34
44
  }
35
45
 
36
46
  &:focus {
@@ -73,8 +83,8 @@
73
83
  .gem-c-pagination__link-label {
74
84
  display: inline-block;
75
85
  margin-top: .1em;
76
- text-decoration: underline;
77
86
  margin-left: govuk-spacing(5);
87
+ @include govuk-link-decoration;
78
88
 
79
89
  @include govuk-media-query($from: tablet) {
80
90
  margin-left: govuk-spacing(6);
@@ -20,6 +20,7 @@ $gem-c-print-link-background-height: 18px;
20
20
  background: image-url("govuk_publishing_components/icon-print.png") no-repeat govuk-spacing(2) 50%;
21
21
  background-size: $gem-c-print-link-background-width $gem-c-print-link-background-height;
22
22
  padding: govuk-spacing(2) govuk-spacing(2) govuk-spacing(2) (govuk-spacing(4) + $gem-c-print-link-background-width);
23
+ text-decoration: none;
23
24
 
24
25
  @include govuk-device-pixel-ratio($ratio: 2) {
25
26
  background-image: image-url("govuk_publishing_components/icon-print-2x.png");
@@ -32,7 +33,6 @@ $gem-c-print-link-background-height: 18px;
32
33
 
33
34
  .gem-c-print-link__link {
34
35
  box-shadow: inset 0 0 0 1px $govuk-border-colour;
35
- text-decoration: none;
36
36
 
37
37
  &:focus {
38
38
  border: 0;
@@ -22,7 +22,6 @@ $share-button-height: 32px;
22
22
  .gem-c-share-links__link {
23
23
  @include govuk-font(16, $weight: bold);
24
24
  margin-right: govuk-spacing(6);
25
- text-decoration: none;
26
25
 
27
26
  @include govuk-template-link-focus-override;
28
27
  }
@@ -49,6 +49,7 @@
49
49
 
50
50
  &:hover {
51
51
  color: $govuk-link-hover-colour;
52
+ @include govuk-link-hover-decoration;
52
53
  }
53
54
 
54
55
  &:focus {
@@ -116,7 +116,8 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
116
116
  padding: 0 0 govuk-spacing(1);
117
117
 
118
118
  &:hover .gem-c-step-nav__button-text {
119
- text-decoration: underline;
119
+ @include govuk-link-decoration;
120
+ @include govuk-link-hover-decoration;
120
121
  }
121
122
 
122
123
  .gem-c-step-nav--large & {
@@ -125,6 +126,10 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
125
126
 
126
127
  &:focus {
127
128
  @include step-nav-chevron-focus-state;
129
+
130
+ .gem-c-step-nav__button-text {
131
+ text-decoration: none;
132
+ }
128
133
  }
129
134
  }
130
135
 
@@ -338,7 +343,8 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
338
343
  }
339
344
 
340
345
  .gem-c-step-nav__button-text {
341
- text-decoration: underline;
346
+ @include govuk-link-decoration;
347
+ @include govuk-link-hover-decoration;
342
348
  }
343
349
  }
344
350
  }
@@ -45,7 +45,6 @@
45
45
 
46
46
  .gem-c-subscription-links__item {
47
47
  display: inline-block;
48
- text-decoration: none;
49
48
  background-repeat: no-repeat;
50
49
  background-position: 0 20%;
51
50
 
@@ -55,6 +54,7 @@
55
54
  }
56
55
 
57
56
  .gem-c-subscription-links__item--button {
57
+ cursor: pointer;
58
58
  display: none;
59
59
  font-size: inherit;
60
60
  font-weight: inherit;
@@ -71,6 +71,10 @@
71
71
  color: $govuk-link-colour;
72
72
  }
73
73
 
74
+ &:hover {
75
+ color: $govuk-link-hover-colour;
76
+ }
77
+
74
78
  &:visited,
75
79
  &:active,
76
80
  &:focus {
@@ -106,7 +110,7 @@
106
110
  }
107
111
 
108
112
  .gem-c-subscription-links__icon {
109
- margin-right: .1em;
113
+ margin-right: govuk-spacing(1);
110
114
  color: govuk-colour("black");
111
115
  }
112
116
 
@@ -75,6 +75,7 @@
75
75
  // Links
76
76
 
77
77
  a {
78
+ @include govuk-link-common;
78
79
  @include govuk-link-style-default;
79
80
 
80
81
  &:focus {
@@ -32,6 +32,7 @@
32
32
 
33
33
  link_classes = %w(govuk-link gem-c-action-link__link)
34
34
  link_classes << shared_helper.classes if classes
35
+ link_classes << "govuk-link--inverse" if light_text
35
36
  %>
36
37
  <% if text.present? %>
37
38
  <div class="<%= css_classes.join(' ') %>">
@@ -55,7 +56,7 @@
55
56
  <span class="gem-c-action-link__subtext-wrapper">
56
57
  <% if subtext_href %>
57
58
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
58
- <%= link_to subtext, subtext_href, class: "gem-c-action-link__subtext-link govuk-link", data: data %>
59
+ <%= link_to subtext, subtext_href, class: link_classes, data: data %>
59
60
  <% end %>
60
61
  <% else %>
61
62
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
@@ -1,12 +1,19 @@
1
1
  <%-
2
2
  cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
3
+ underline_links ||= false
3
4
  aria_label ||= t("components.contents_list.contents")
4
5
  format_numbers ||= false
5
6
  brand ||= false
6
7
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
7
8
  title_fallback = t("components.contents_list.contents", locale: I18n.locale, fallback: false, default: "en")
8
- classes = cl_helper.classes
9
+ classes = %w[gem-c-contents-list]
9
10
  classes << brand_helper.brand_class
11
+ link_classes = %w[
12
+ gem-c-contents-list__link
13
+ govuk-link
14
+ ]
15
+ link_classes << brand_helper.color_class
16
+ link_classes << "govuk-link--no-underline" unless underline_links
10
17
  -%>
11
18
  <% if cl_helper.contents.any? %>
12
19
  <%= content_tag(
@@ -31,7 +38,7 @@
31
38
  <li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
32
39
  <% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : contents_item[:text] %>
33
40
  <%= link_to_if !contents_item[:active], link_text, contents_item[:href],
34
- class: "gem-c-contents-list__link govuk-link #{brand_helper.color_class}",
41
+ class: link_classes,
35
42
  data: {
36
43
  track_category: 'contentsClicked',
37
44
  track_action: "content_item #{position}",
@@ -47,7 +54,7 @@
47
54
  <% contents_item[:items].each.with_index(1) do |nested_contents_item, nested_position| %>
48
55
  <li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
49
56
  <%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
50
- class: "gem-c-contents-list__link govuk-link #{brand_helper.color_class}",
57
+ class: link_classes,
51
58
  data: {
52
59
  track_category: 'contentsClicked',
53
60
  track_action: "nested_content_item #{position}:#{nested_position}",
@@ -5,37 +5,37 @@
5
5
  <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation" aria-label="Departments and policy navigation">
6
6
  <ul id="proposition-links">
7
7
  <li>
8
- <a class="<%= 'active' if active == 'departments' %>" href="/government/organisations">
8
+ <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/organisations">
9
9
  <%= t("components.government_navigation.departments") %>
10
10
  </a>
11
11
  </li>
12
12
  <li>
13
- <a class="<%= 'active' if active == 'worldwide' %>" href="/government/world">
13
+ <a class="<%= 'active' if active == 'worldwide' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/world">
14
14
  <%= t("components.government_navigation.worldwide") %>
15
15
  </a>
16
16
  </li>
17
17
  <li>
18
- <a class="<%= 'active' if active == 'how-government-works' %>" href="/government/how-government-works">
18
+ <a class="<%= 'active' if active == 'how-government-works' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/how-government-works">
19
19
  <%= t("components.government_navigation.how-government-works") %>
20
20
  </a>
21
21
  </li>
22
22
  <li>
23
- <a class="<%= 'active' if active == 'get-involved' %>" href="/government/get-involved">
23
+ <a class="<%= 'active' if active == 'get-involved' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/get-involved">
24
24
  <%= t("components.government_navigation.get-involved") %>
25
25
  </a>
26
26
  </li>
27
27
  <li class="clear-child">
28
- <a class="<%= 'active' if active == 'consultations' %>" href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
28
+ <a class="<%= 'active' if active == 'consultations' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
29
29
  <%= t("components.government_navigation.consultations") %>
30
30
  </a>
31
31
  </li>
32
32
  <li>
33
- <a class="<%= 'active' if active == 'statistics' %>" href="/search/research-and-statistics">
33
+ <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/search/research-and-statistics">
34
34
  <%= t("components.government_navigation.statistics") %>
35
35
  </a>
36
36
  </li>
37
37
  <li>
38
- <a class="<%= 'active' if active == 'announcements' %>" href="/news-and-communications">
38
+ <a class="<%= 'active' if active == 'announcements' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/news-and-communications">
39
39
  <%= t("components.government_navigation.news_and_communications") %>
40
40
  </a>
41
41
  </li>
@@ -10,6 +10,19 @@
10
10
  font_size ||= card_helper.large ? 'm' : 's'
11
11
  heading_class = %w[gem-c-image-card__title]
12
12
  heading_class << shared_helper.get_heading_size(font_size, 's')
13
+
14
+ heading_link_classes = %w[
15
+ gem-c-image-card__title-link
16
+ govuk-link
17
+ govuk-link--no-underline
18
+ ]
19
+ heading_link_classes << brand_helper.color_class
20
+ extra_link_classes = %w[
21
+ gem-c-image-card__list-item-link
22
+ govuk-link
23
+ ]
24
+ extra_link_classes << brand_helper.color_class
25
+
13
26
  %>
14
27
  <% if card_helper.href || card_helper.extra_links.any? %>
15
28
  <div class="<%= classes %> <%= brand_helper.brand_class %>"
@@ -21,7 +34,7 @@
21
34
  <%= content_tag(shared_helper.get_heading_level, class: heading_class) do %>
22
35
  <% if card_helper.href %>
23
36
  <%= link_to card_helper.heading_text, card_helper.href,
24
- class: "gem-c-image-card__title-link govuk-link #{brand_helper.color_class}",
37
+ class: heading_link_classes,
25
38
  data: card_helper.href_data_attributes
26
39
  %>
27
40
  <% else %>
@@ -37,7 +50,7 @@
37
50
  <% card_helper.extra_links.each do |link| %>
38
51
  <li class="gem-c-image-card__list-item">
39
52
  <%= link_to link[:text], link[:href],
40
- class: "gem-c-image-card__list-item-link govuk-link #{brand_helper.color_class}",
53
+ class: extra_link_classes,
41
54
  data: link[:data_attributes]
42
55
  %>
43
56
  </li>
@@ -6,16 +6,13 @@
6
6
  heading_level ||= false
7
7
  inline ||= false
8
8
 
9
- # Check if `heading_level` is a number; if so, check if it's an appropriate
10
- # number.
11
- use_heading = heading_level.is_a?(Integer) ?
12
- (heading_level >= 1 && heading_level <= 6) :
13
- false
9
+ # Check if `heading_level` is an appropriate number:
10
+ use_heading = [*1..6].include?(heading_level)
14
11
 
15
- # Set the wrapping element to be a heading or a `div`
16
- wrapping_element = use_heading ? "h#{heading_level}" : "div"
12
+ # Set the wrapping element to be a heading or a `div`:
13
+ wrapping_element = (use_heading ? "h#{heading_level}" : "div").to_sym
17
14
 
18
- wrapper_classes = %w(gem-c-organisation-logo)
15
+ wrapper_classes = %w[gem-c-organisation-logo]
19
16
  wrapper_classes << brand_helper.brand_class
20
17
 
21
18
  container_classes = [
@@ -24,10 +21,13 @@
24
21
  ]
25
22
  container_classes << "gem-c-organisation-logo__container--inline" if inline
26
23
  %>
27
- <<%= wrapping_element %>
28
- class="<%= wrapper_classes.join(" ") %>"
29
- <%= "data-module=gem-track-click" if organisation[:data_attributes] %>
30
- >
24
+
25
+ <%= content_tag(wrapping_element, {
26
+ class: wrapper_classes,
27
+ data: {
28
+ module: ("gem-track-click" if organisation[:data_attributes])
29
+ }
30
+ }) do %>
31
31
  <% if organisation[:url] %>
32
32
  <%= link_to organisation[:url],
33
33
  class: container_classes.join(" "),
@@ -39,4 +39,4 @@
39
39
  <%= logo_helper.logo_content %>
40
40
  </div>
41
41
  <% end %>
42
- </<%= wrapping_element %>>
42
+ <% end %>
@@ -6,6 +6,10 @@
6
6
  >
7
7
  <ul class="gem-c-pagination__list" data-module="gem-track-click">
8
8
  <% if local_assigns.include?(:previous_page) %>
9
+ <%
10
+ link_text_classes = %w[gem-c-pagination__link-text]
11
+ link_text_classes << "gem-c-pagination__link-text--decorated" unless previous_page[:label].present?
12
+ %>
9
13
  <li class="gem-c-pagination__item gem-c-pagination__item--previous">
10
14
  <a href="<%= previous_page[:url] %>"
11
15
  class="govuk-link gem-c-pagination__link"
@@ -20,9 +24,7 @@
20
24
  <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
21
25
  <path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"/>
22
26
  </svg>
23
- <span class="gem-c-pagination__link-text">
24
- <%= previous_page[:title] %>
25
- </span>
27
+ <%= tag.span(previous_page[:title], class: link_text_classes) %>
26
28
  </span>
27
29
  <% if previous_page[:label].present? %>
28
30
  <span class="gem-c-pagination__link-divider visually-hidden">:</span>
@@ -32,6 +34,10 @@
32
34
  </li>
33
35
  <% end %>
34
36
  <% if local_assigns.include?(:next_page) %>
37
+ <%
38
+ link_text_classes = %w[gem-c-pagination__link-text]
39
+ link_text_classes << "gem-c-pagination__link-text--decorated" unless next_page[:label].present?
40
+ %>
35
41
  <li class="gem-c-pagination__item gem-c-pagination__item--next">
36
42
  <a href="<%= next_page[:url] %>"
37
43
  class="govuk-link gem-c-pagination__link"
@@ -46,9 +52,7 @@
46
52
  <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
47
53
  <path d="m10.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"/>
48
54
  </svg>
49
- <span class="gem-c-pagination__link-text">
50
- <%= next_page[:title] %>
51
- </span>
55
+ <%= tag.span(next_page[:title], class: link_text_classes) %>
52
56
  </span>
53
57
  <% if next_page[:label].present? %>
54
58
  <span class="gem-c-pagination__link-divider visually-hidden">:</span>
@@ -52,7 +52,7 @@
52
52
  'track-action': link[:icon],
53
53
  'track-options': track_options
54
54
  },
55
- class: "govuk-link gem-c-share-links__link #{brand_helper.color_class}" do %>
55
+ class: "govuk-link govuk-link--no-underline gem-c-share-links__link #{brand_helper.color_class}" do %>
56
56
  <span class="gem-c-share-links__link-icon">
57
57
  <% if link[:icon] == 'facebook' %>
58
58
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" aria-hidden="true">
@@ -32,11 +32,11 @@
32
32
  <% if sl_helper.email_signup_link.present? %>
33
33
  <li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
34
34
  <% email_link_text = capture do %>
35
- <svg xmlns="http://www.w3.org/2000/svg" width="21" height="15.75" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M19.687 0H1.312C.589 0 0 .587 0 1.313v13.124c0 .726.588 1.313 1.313 1.313h18.374c.725 0 1.313-.587 1.313-1.313V1.313C21 .587 20.412 0 19.687 0zm-2.625 2.625L10.5 7.875l-6.563-5.25h13.126zm1.313 10.5H2.625V3.937L10.5 10.5l7.875-6.563v9.188z"/></svg>
36
- <%= sl_helper.email_signup_link_text %>
35
+ <svg xmlns="http://www.w3.org/2000/svg" width="21" height="15.75" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M19.687 0H1.312C.589 0 0 .587 0 1.313v13.124c0 .726.588 1.313 1.313 1.313h18.374c.725 0 1.313-.587 1.313-1.313V1.313C21 .587 20.412 0 19.687 0zm-2.625 2.625L10.5 7.875l-6.563-5.25h13.126zm1.313 10.5H2.625V3.937L10.5 10.5l7.875-6.563v9.188z"/>
36
+ </svg><%= sl_helper.email_signup_link_text %>
37
37
  <% end %>
38
38
  <%= link_to email_link_text, sl_helper.email_signup_link, {
39
- class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
39
+ class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
40
40
  data: sl_helper.email_signup_link_data_attributes,
41
41
  lang: email_signup_link_text_locale
42
42
  } %>
@@ -46,17 +46,17 @@
46
46
  <% if sl_helper.feed_link_box_value || sl_helper.feed_link %>
47
47
  <li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>">
48
48
  <% feed_link_text = capture do %>
49
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M1.996 11A2 2 0 0 0 0 12.993c0 1.101.895 1.99 1.996 1.99 1.106 0 2-.889 2-1.99a2 2 0 0 0-2-1.993zM.002 5.097V7.97c1.872 0 3.632.733 4.958 2.059A6.984 6.984 0 0 1 7.015 15h2.888c0-5.461-4.443-9.903-9.9-9.903zM.006 0v2.876c6.676 0 12.11 5.44 12.11 12.124H15C15 6.731 8.273 0 .006 0z"/></svg>
50
- <%= sl_helper.feed_link_text %>
49
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M1.996 11A2 2 0 0 0 0 12.993c0 1.101.895 1.99 1.996 1.99 1.106 0 2-.889 2-1.99a2 2 0 0 0-2-1.993zM.002 5.097V7.97c1.872 0 3.632.733 4.958 2.059A6.984 6.984 0 0 1 7.015 15h2.888c0-5.461-4.443-9.903-9.9-9.903zM.006 0v2.876c6.676 0 12.11 5.44 12.11 12.124H15C15 6.731 8.273 0 .006 0z"/>
50
+ </svg><%= sl_helper.feed_link_text %>
51
51
  <% end %>
52
52
  <%= tag.button feed_link_text, {
53
- class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
53
+ class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
54
54
  data: sl_helper.feed_link_data_attributes,
55
55
  lang: feed_link_text_locale
56
56
  } if sl_helper.feed_link_box_value %>
57
57
  <%= link_to feed_link_text, sl_helper.feed_link,
58
58
  {
59
- class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
59
+ class: "govuk-link govuk-link--no-underline gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
60
60
  data: sl_helper.feed_link_data_attributes,
61
61
  lang: feed_link_text_locale
62
62
  } unless sl_helper.feed_link_box_value %>
@@ -2,6 +2,8 @@ name: Government navigation
2
2
  description: Navigation placed in the header by Slimmer and used by pages which sit
3
3
  under the /government path. This is a markup only component and is not available
4
4
  for preview here. It can be passed a string to mark a link as being active.
5
+ body: |
6
+ Please note: because the markup on this component is currently tied to styles that aren't present in the components gem, they will appear "broken". This is because they are intended to be used in the [header component](/component-guide/layout_header/with_left_search_and_navigation) as white links against a black background. You can see a styled example of this component in use on the ['Counter-Fraud Standards and Profession' page](https://www.gov.uk/government/groups/counter-fraud-standards-and-profession).
5
7
  accessibility_criteria: |
6
8
  The government navigation component must:
7
9
 
@@ -15,6 +15,6 @@ examples:
15
15
  data:
16
16
  block: |
17
17
  <div>
18
- <h2 id='heading'>To publish this step by step you need to</h2>
19
- <a href='/foo'>Check for broken links</a>
18
+ <h2 class="govuk-heading-m" id='heading'>To publish this step by step you need to</h2>
19
+ <a class="govuk-link" href='/foo'>Check for broken links</a>
20
20
  </div>
@@ -3,6 +3,8 @@ description: A wrapper to contain header content in white text
3
3
  body: |
4
4
  This component can be passed a block of template code and will wrap it in a blue header. This is as light-touch as possible and doesn't attempt to deal with the margins and paddings of its content. White text is enforced on content and would need to be overriden where unwanted. Implemented to accomodate topic and list page headings and breadcrumbs but unopinionated about its contents.
5
5
 
6
+ If passing links to the block make sure to add [the inverse modifier](https://design-system.service.gov.uk/styles/typography/#links-on-dark-backgrounds).
7
+
6
8
  accessibility_criteria: |
7
9
  The component must:
8
10
 
@@ -16,7 +18,7 @@ examples:
16
18
  data:
17
19
  block: |
18
20
  <div class="gem-c-title gem-c-title--inverse">
19
- <h1 class="gem-c-title__text ">
21
+ <h1 class="gem-c-title__text govuk-heading-l">
20
22
  Education, Training and Skills
21
23
  </h1>
22
24
  </div>
@@ -26,7 +28,7 @@ examples:
26
28
  full_width: true
27
29
  block: |
28
30
  <div class="gem-c-title gem-c-title--inverse">
29
- <h1 class="gem-c-title__text ">
31
+ <h1 class="gem-c-title__text govuk-heading-l">
30
32
  Education, Training and Skills
31
33
  </h1>
32
34
  </div>
@@ -35,8 +37,8 @@ examples:
35
37
  data:
36
38
  block: |
37
39
  <div class="gem-c-title gem-c-title--inverse gem-c-title--bottom-margin">
38
- <p class="gem-c-title__context">Notice</p>
39
- <h1 class="gem-c-title__text">
40
+ <p class="gem-c-title__context govuk-caption-m">Notice</p>
41
+ <h1 class="gem-c-title__text govuk-heading-l">
40
42
  LN5 0AT, Jackson Homes (Scopwick) Ltd: environmental permit application
41
43
  </h1>
42
44
  </div>
@@ -45,21 +47,22 @@ examples:
45
47
  data:
46
48
  padding_top: false
47
49
  block: |
48
- <div class="gem-c-breadcrumbs " data-module="gem-track-click">
49
- <ol>
50
- <li class="">
51
- <a data-track-category="breadcrumbClicked" data-track-action="1" data-track-label="/section" data-track-options="{&quot;dimension28&quot;:&quot;2&quot;,&quot;dimension29&quot;:&quot;Section&quot;}" class="gem-c-breadcrumbs--inverse" aria-current="false" href="/section">Section</a>
50
+ <div class="gem-c-breadcrumbs govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile gem-c-breadcrumbs--inverse">
51
+ <ol class="govuk-breadcrumbs__list">
52
+ <li class="govuk-breadcrumbs__list-item">
53
+ <a href="/section" class="govuk-breadcrumbs__link">Section</a>
52
54
  </li>
53
- <li class="">
54
- <a data-track-category="breadcrumbClicked" data-track-action="2" data-track-label="#content" data-track-options="{&quot;dimension28&quot;:&quot;2&quot;,&quot;dimension29&quot;:&quot;Education of disadvantaged children&quot;}" class="gem-c-breadcrumbs--inverse gem-c-breadcrumbs--current " aria-current="page" href="#content">Education of disadvantaged children</a>
55
+ <li class="govuk-breadcrumbs__list-item">
56
+ <a href="/section/sub-section" class="govuk-breadcrumbs__link">Education of disadvantaged children</a>
55
57
  </li>
56
58
  </ol>
57
59
  </div>
58
- <div class="gem-c-title gem-c-title--inverse">
59
- <h1 class="gem-c-title__text ">
60
- Education, Training and Skills
61
- </h1>
62
- </div>
63
60
  <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
64
61
  Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.
65
62
  </p>
63
+ with_link:
64
+ data:
65
+ block: |
66
+ <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
67
+ Schools and academies, further and higher education, apprenticeships and <a href="#other-skills" class="govuk-link govuk-link--inverse">other skills</a> training, student funding, early years.
68
+ </p>
@@ -26,11 +26,9 @@ module GovukPublishingComponents
26
26
  end
27
27
 
28
28
  def parent_taxons
29
- @parent_taxons ||= begin
30
- taxon_links
29
+ @parent_taxons ||= taxon_links
31
30
  .select { |t| phase_is_live?(t) }
32
31
  .map { |taxon| ContentItem.new(taxon) }.sort_by(&:title)
33
- end
34
32
  end
35
33
 
36
34
  def phase_is_live?(taxon)
@@ -11,9 +11,6 @@ module GovukPublishingComponents
11
11
  @contents = options[:contents] || []
12
12
  @nested = @contents.any? { |c| c[:items] && c[:items].any? }
13
13
  @format_numbers = options[:format_numbers]
14
-
15
- @classes = %w[gem-c-contents-list]
16
- @classes << " gem-c-contents-list--no-underline" unless options[:underline_links]
17
14
  end
18
15
 
19
16
  def list_item_classes(list_item, nested)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.12.0".freeze
2
+ VERSION = "24.13.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.12.0
4
+ version: 24.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-01 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -272,16 +272,16 @@ dependencies:
272
272
  name: rubocop-govuk
273
273
  requirement: !ruby/object:Gem::Requirement
274
274
  requirements:
275
- - - '='
275
+ - - ">="
276
276
  - !ruby/object:Gem::Version
277
- version: 4.0.0.pre.1
277
+ version: '0'
278
278
  type: :development
279
279
  prerelease: false
280
280
  version_requirements: !ruby/object:Gem::Requirement
281
281
  requirements:
282
- - - '='
282
+ - - ">="
283
283
  - !ruby/object:Gem::Version
284
- version: 4.0.0.pre.1
284
+ version: '0'
285
285
  - !ruby/object:Gem::Dependency
286
286
  name: sassc-rails
287
287
  requirement: !ruby/object:Gem::Requirement