govuk_publishing_components 30.4.0 → 30.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +59 -10
- data/app/models/govuk_publishing_components/component_example.rb +2 -3
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +6 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50a87147aabeeeb4c5d2fc38027b8c6e161becb7ac1aff2fe66ea8b6e7c1c9e1
|
4
|
+
data.tar.gz: 8d2bf92bd32628dc06f865ca12f6235b811dbf13f604c31cb0284f20efa34752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b54767f3c3e9d4c1d4796045d508ca619eabca6e576da063f54534a0917211341f771e23710060374432d1783322efd4301b2d296df9c31e9ca7bedc14f87e69
|
7
|
+
data.tar.gz: 6a298a85b7bc0aa909e393759324220a3ba41b4fc45325e2cf59848b82d0a247e8be3129397e5bf23ee7e54f8312c3247c1374314a69802bf88d38a7120fe7c5
|
@@ -8,6 +8,10 @@ $search-width-or-height: $black-bar-height;
|
|
8
8
|
$pseudo-underline-height: 3px;
|
9
9
|
$button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
10
10
|
|
11
|
+
$after-link-padding: govuk-spacing(6);
|
12
|
+
$after-button-padding-right: govuk-spacing(6);
|
13
|
+
$after-button-padding-left: govuk-spacing(5);
|
14
|
+
|
11
15
|
@mixin chevron($colour, $update: false) {
|
12
16
|
@if $update == true {
|
13
17
|
border-bottom-color: $colour;
|
@@ -35,15 +39,17 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
35
39
|
top: 0;
|
36
40
|
}
|
37
41
|
|
38
|
-
@mixin pseudo-underline($left: govuk-spacing(4), $right: govuk-spacing(4)) {
|
42
|
+
@mixin pseudo-underline($left: govuk-spacing(4), $right: govuk-spacing(4), $width: false) {
|
39
43
|
background: none;
|
40
|
-
bottom: 0;
|
41
44
|
content: "";
|
42
45
|
height: $pseudo-underline-height;
|
43
46
|
left: $left;
|
44
47
|
position: absolute;
|
45
48
|
right: $right;
|
46
49
|
top: auto;
|
50
|
+
@if $width {
|
51
|
+
width: $width;
|
52
|
+
}
|
47
53
|
}
|
48
54
|
|
49
55
|
@mixin focus-and-focus-visible {
|
@@ -177,7 +183,8 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
177
183
|
&:first-of-type {
|
178
184
|
margin-right: -1px;
|
179
185
|
|
180
|
-
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner
|
186
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner,
|
187
|
+
.gem-c-layout-super-navigation-header__navigation-item-link-inner {
|
181
188
|
border-left: 1px solid $button-pipe-colour;
|
182
189
|
border-right: 1px solid $button-pipe-colour;
|
183
190
|
}
|
@@ -242,10 +249,8 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
242
249
|
@if $govuk-typography-use-rem {
|
243
250
|
font-size: govuk-px-to-rem(16px);
|
244
251
|
}
|
245
|
-
// stylelint-enable max-nesting-depth
|
246
252
|
|
247
253
|
height: govuk-spacing(4);
|
248
|
-
padding: govuk-spacing(3);
|
249
254
|
position: relative;
|
250
255
|
|
251
256
|
&:before {
|
@@ -260,8 +265,17 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
260
265
|
}
|
261
266
|
}
|
262
267
|
|
263
|
-
|
268
|
+
&:focus:not(:focus-visible) {
|
269
|
+
.gem-c-layout-super-navigation-header__navigation-item-link-inner {
|
270
|
+
border-color: $button-pipe-colour;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
|
264
274
|
@include focus-and-focus-visible {
|
275
|
+
.gem-c-layout-super-navigation-header__navigation-item-link-inner {
|
276
|
+
border-color: $govuk-focus-colour;
|
277
|
+
}
|
278
|
+
|
265
279
|
&,
|
266
280
|
&:hover {
|
267
281
|
box-shadow: none;
|
@@ -295,11 +309,27 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
295
309
|
background: none;
|
296
310
|
}
|
297
311
|
}
|
298
|
-
// stylelint-enable max-nesting-depth
|
299
312
|
|
300
313
|
&:after {
|
301
|
-
@include pseudo-underline($left:
|
314
|
+
@include pseudo-underline($left: $after-link-padding, $right: $after-link-padding, $width: calc(100% - $after-link-padding));
|
302
315
|
}
|
316
|
+
|
317
|
+
.js-module-initialised & {
|
318
|
+
// If js is initialised, we are hiding the links and
|
319
|
+
// making the buttons visible instead. This means we have
|
320
|
+
// to remove the padding added to make the links vertically
|
321
|
+
// aligned, as the buttons are styled vertically aligned by
|
322
|
+
// default.
|
323
|
+
|
324
|
+
padding: 0;
|
325
|
+
margin: 0;
|
326
|
+
|
327
|
+
&:after {
|
328
|
+
@include pseudo-underline($left: $after-button-padding-left, $right: $after-button-padding-right, $width: calc(100% - $after-button-padding-left));
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
// stylelint-enable max-nesting-depth
|
303
333
|
}
|
304
334
|
}
|
305
335
|
|
@@ -308,6 +338,13 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
308
338
|
}
|
309
339
|
}
|
310
340
|
|
341
|
+
.gem-c-layout-super-navigation-header__navigation-item-link,
|
342
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button {
|
343
|
+
@include govuk-media-query($from: "desktop") {
|
344
|
+
padding: govuk-spacing(3) 0;
|
345
|
+
}
|
346
|
+
}
|
347
|
+
|
311
348
|
.gem-c-layout-super-navigation-header__navigation-item-link {
|
312
349
|
.js-module-initialised & {
|
313
350
|
margin-left: govuk-spacing(4);
|
@@ -459,20 +496,31 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
459
496
|
}
|
460
497
|
}
|
461
498
|
|
499
|
+
.gem-c-layout-super-navigation-header__navigation-item-link-inner {
|
500
|
+
@include govuk-media-query($from: "desktop") {
|
501
|
+
// links have different left padding to the button as
|
502
|
+
// they do not have the 5px wide caret pseudo element
|
503
|
+
padding: govuk-spacing(1) $after-link-padding;
|
504
|
+
}
|
505
|
+
}
|
506
|
+
|
462
507
|
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
463
508
|
@include govuk-media-query($from: "desktop") {
|
464
509
|
display: inline-block;
|
465
|
-
padding: govuk-spacing(1)
|
510
|
+
padding: govuk-spacing(1) $after-button-padding-right govuk-spacing(1) $after-button-padding-left;
|
466
511
|
}
|
467
512
|
}
|
468
513
|
|
469
514
|
// Search link and dropdown.
|
470
515
|
.gem-c-layout-super-navigation-header__search-item-link {
|
516
|
+
@include govuk-media-query($from: "desktop") {
|
517
|
+
padding: govuk-spacing(3);
|
518
|
+
}
|
519
|
+
|
471
520
|
&:link,
|
472
521
|
&:visited {
|
473
522
|
@include govuk-media-query($from: "desktop") {
|
474
523
|
background: $govuk-brand-colour;
|
475
|
-
border-bottom: 1px solid govuk-colour("dark-blue");
|
476
524
|
|
477
525
|
&:hover {
|
478
526
|
background: govuk-colour("black");
|
@@ -494,6 +542,7 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
494
542
|
&:after {
|
495
543
|
left: 0;
|
496
544
|
right: 0;
|
545
|
+
width: 100%;
|
497
546
|
}
|
498
547
|
|
499
548
|
@include focus-not-focus-visible {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require "rouge"
|
2
|
-
require "awesome_print"
|
3
2
|
|
4
3
|
module GovukPublishingComponents
|
5
4
|
class ComponentExample
|
@@ -30,8 +29,8 @@ module GovukPublishingComponents
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def pretty_data
|
33
|
-
json_key_regex = /"(\w*)"
|
34
|
-
output =
|
32
|
+
json_key_regex = /"(\w*)":/ # matches quoted keys ending with a colon, i.e. "key":
|
33
|
+
output = JSON.pretty_generate(data).gsub('\\n', "\n ").gsub(json_key_regex, '\1:')
|
35
34
|
|
36
35
|
quoted_string_regex = /"((?:[^"\\]|\\.)*)"/ # matches "some text" - ignores escaped quotes, i.e. \"
|
37
36
|
output.gsub(quoted_string_regex) do |group|
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
%>
|
97
97
|
<%= tag.li class: li_classes do %>
|
98
98
|
<div class="gem-c-layout-super-navigation-header__navigation-toggle-wrapper govuk-clearfix">
|
99
|
-
<%= link_to link[:
|
99
|
+
<%= link_to link[:href], {
|
100
100
|
class: "gem-c-layout-super-navigation-header__navigation-item-link",
|
101
101
|
data: {
|
102
102
|
track_action: "#{tracking_label}Link",
|
@@ -105,7 +105,11 @@
|
|
105
105
|
track_dimension: link[:label],
|
106
106
|
track_dimension_index: "29",
|
107
107
|
}
|
108
|
-
} %>
|
108
|
+
} do %>
|
109
|
+
<span class="gem-c-layout-super-navigation-header__navigation-item-link-inner">
|
110
|
+
<%= link[:label] %>
|
111
|
+
</span>
|
112
|
+
<% end %>
|
109
113
|
<% if has_children %>
|
110
114
|
<%= content_tag(:button, {
|
111
115
|
aria: {
|
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: 30.4.
|
4
|
+
version: 30.4.1
|
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: 2022-09-
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: awesome_print
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: capybara
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|