govuk_publishing_components 27.16.0 → 27.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +49 -48
- data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +74 -65
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +25 -11
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +10 -109
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +8 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +8 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +141 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/config/i18n-tasks.yml +8 -0
- data/config/locales/ar.yml +134 -131
- data/config/locales/az.yml +131 -131
- data/config/locales/be.yml +136 -130
- data/config/locales/bg.yml +135 -131
- data/config/locales/bn.yml +132 -131
- data/config/locales/cs.yml +136 -131
- data/config/locales/cy.yml +129 -125
- data/config/locales/da.yml +132 -131
- data/config/locales/de.yml +135 -131
- data/config/locales/dr.yml +133 -131
- data/config/locales/el.yml +131 -131
- data/config/locales/en.yml +19 -14
- data/config/locales/es-419.yml +131 -131
- data/config/locales/es.yml +131 -131
- data/config/locales/et.yml +134 -131
- data/config/locales/fa.yml +130 -131
- data/config/locales/fi.yml +133 -131
- data/config/locales/fr.yml +130 -130
- data/config/locales/gd.yml +133 -131
- data/config/locales/gu.yml +131 -131
- data/config/locales/he.yml +131 -131
- data/config/locales/hi.yml +131 -131
- data/config/locales/hr.yml +133 -131
- data/config/locales/hu.yml +134 -131
- data/config/locales/hy.yml +135 -131
- data/config/locales/id.yml +132 -131
- data/config/locales/is.yml +131 -131
- data/config/locales/it.yml +131 -131
- data/config/locales/ja.yml +128 -131
- data/config/locales/ka.yml +134 -131
- data/config/locales/kk.yml +131 -131
- data/config/locales/ko.yml +13 -17
- data/config/locales/lt.yml +136 -131
- data/config/locales/lv.yml +135 -131
- data/config/locales/ms.yml +131 -131
- data/config/locales/mt.yml +133 -131
- data/config/locales/nl.yml +131 -131
- data/config/locales/no.yml +131 -131
- data/config/locales/pa-pk.yml +128 -132
- data/config/locales/pa.yml +131 -131
- data/config/locales/pl.yml +135 -131
- data/config/locales/ps.yml +128 -131
- data/config/locales/pt.yml +131 -131
- data/config/locales/ro.yml +132 -131
- data/config/locales/ru.yml +135 -131
- data/config/locales/si.yml +131 -131
- data/config/locales/sk.yml +136 -131
- data/config/locales/sl.yml +138 -131
- data/config/locales/so.yml +131 -131
- data/config/locales/sq.yml +131 -131
- data/config/locales/sr.yml +133 -131
- data/config/locales/sv.yml +131 -131
- data/config/locales/sw.yml +131 -131
- data/config/locales/ta.yml +132 -131
- data/config/locales/th.yml +130 -131
- data/config/locales/tk.yml +132 -131
- data/config/locales/tr.yml +132 -131
- data/config/locales/uk.yml +138 -131
- data/config/locales/ur.yml +128 -131
- data/config/locales/uz.yml +133 -131
- data/config/locales/vi.yml +131 -131
- data/config/locales/zh-hk.yml +130 -131
- data/config/locales/zh-tw.yml +130 -131
- data/config/locales/zh.yml +130 -131
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
- data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +12 -2
@@ -1,102 +1,5 @@
|
|
1
1
|
@import "mixins/prefixed-transform";
|
2
|
-
|
3
|
-
/// Set grid row or column value using the fraction unit.
|
4
|
-
///
|
5
|
-
/// @param {Integer} $number - number of fractions that the grid row or column
|
6
|
-
/// needs to be divided into.
|
7
|
-
/// @returns {String} - the value
|
8
|
-
///
|
9
|
-
/// @example scss - Five fractions will return `1fr 1fr 1fr 1fr 1fr`.
|
10
|
-
/// .container {
|
11
|
-
/// grid-template-rows: fractions(5);
|
12
|
-
/// }
|
13
|
-
///
|
14
|
-
@function fractions($number) {
|
15
|
-
$fractions: "1fr";
|
16
|
-
|
17
|
-
@for $i from 1 to $number {
|
18
|
-
$fractions: $fractions + " 1fr";
|
19
|
-
}
|
20
|
-
|
21
|
-
@return unquote($fractions);
|
22
|
-
}
|
23
|
-
|
24
|
-
/// Arrange items into vertical columns
|
25
|
-
///
|
26
|
-
/// @param {Integer} $items - number of items that need to be arranged
|
27
|
-
/// @param {Integer} $columns - number of columns required
|
28
|
-
/// @param {String} $selector - (optional) the inner element to be targeted.
|
29
|
-
///
|
30
|
-
/// @example scss - A 7 item 2 column layout.
|
31
|
-
/// .container {
|
32
|
-
/// @include columns(7, 2);
|
33
|
-
/// }
|
34
|
-
|
35
|
-
/// @example scss - A 9 item 3 column layout that has `div`s as the inner
|
36
|
-
/// elements.
|
37
|
-
/// .container {
|
38
|
-
/// @include columns(9, 3, "div");
|
39
|
-
/// }
|
40
|
-
///
|
41
|
-
@mixin columns($items, $columns, $selector: "*") {
|
42
|
-
$rows: ceil($items / $columns);
|
43
|
-
|
44
|
-
display: -ms-grid;
|
45
|
-
display: grid;
|
46
|
-
grid-auto-flow: column;
|
47
|
-
-ms-grid-columns: fractions($columns);
|
48
|
-
grid-template-columns: fractions($columns);
|
49
|
-
-ms-grid-rows: fractions($rows);
|
50
|
-
grid-template-rows: fractions($rows);
|
51
|
-
}
|
52
|
-
|
53
|
-
@mixin columns-children($items, $columns, $selector: "*") {
|
54
|
-
$rows: ceil($items / $columns);
|
55
|
-
|
56
|
-
// Internet Explorer 10-11 require each element to be placed in the grid -
|
57
|
-
// the `grid-auto-flow` property isn't supported. This means that both the
|
58
|
-
// column and row needs to be set for every element.
|
59
|
-
|
60
|
-
// This creates a list of lists to represent the columns and rows; for
|
61
|
-
// example, a 7 item 2 column list would create this:
|
62
|
-
// [
|
63
|
-
// [1, 2, 3, 4 ] // column one
|
64
|
-
// [5, 6, 7] // column two
|
65
|
-
// ]
|
66
|
-
$grid: ();
|
67
|
-
$counter: 0;
|
68
|
-
|
69
|
-
@for $column from 1 through $columns {
|
70
|
-
$this-row: ();
|
71
|
-
|
72
|
-
@for $row from 1 through $rows {
|
73
|
-
$counter: $counter + 1;
|
74
|
-
|
75
|
-
@if $counter <= $items {
|
76
|
-
$this-row: append($this-row, $counter);
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
$grid: append($grid, $this-row, "comma");
|
81
|
-
}
|
82
|
-
|
83
|
-
// Now we can loop through the list of lists to create the rules needed for
|
84
|
-
// the older grid syntax; fist looping through the list to get the number
|
85
|
-
// needed for the column, then looping again to get the number for the grid
|
86
|
-
// row:
|
87
|
-
@for $column_index from 1 through length($grid) {
|
88
|
-
$this-row: nth($grid, $column_index);
|
89
|
-
|
90
|
-
@for $item-index from 1 through length($this-row) {
|
91
|
-
$this-item: nth($this-row, $item-index);
|
92
|
-
|
93
|
-
& > #{$selector}:nth-child(#{$this-item}) {
|
94
|
-
-ms-grid-column: $column_index;
|
95
|
-
-ms-grid-row: $item-index;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
2
|
+
@import "mixins/grid-helper";
|
100
3
|
|
101
4
|
$icon-size: 20px;
|
102
5
|
$chevron-indent-spacing: 7px;
|
@@ -131,14 +34,14 @@ $pseudo-underline-height: 3px;
|
|
131
34
|
top: 0;
|
132
35
|
}
|
133
36
|
|
134
|
-
@mixin pseudo-underline {
|
37
|
+
@mixin pseudo-underline($left: govuk-spacing(4), $right: govuk-spacing(4)) {
|
135
38
|
background: none;
|
136
39
|
bottom: 0;
|
137
40
|
content: "";
|
138
41
|
height: $pseudo-underline-height;
|
139
|
-
left:
|
42
|
+
left: $left;
|
140
43
|
position: absolute;
|
141
|
-
right:
|
44
|
+
right: $right;
|
142
45
|
top: auto;
|
143
46
|
}
|
144
47
|
|
@@ -385,7 +288,7 @@ $pseudo-underline-height: 3px;
|
|
385
288
|
// stylelint-enable max-nesting-depth
|
386
289
|
|
387
290
|
&:after {
|
388
|
-
@include pseudo-underline;
|
291
|
+
@include pseudo-underline($left: govuk-spacing(5), $right: govuk-spacing(6));
|
389
292
|
}
|
390
293
|
}
|
391
294
|
}
|
@@ -431,7 +334,7 @@ $pseudo-underline-height: 3px;
|
|
431
334
|
|
432
335
|
@include govuk-media-query($from: "desktop") {
|
433
336
|
&:after {
|
434
|
-
@include pseudo-underline;
|
337
|
+
@include pseudo-underline($left: govuk-spacing(5), $right: govuk-spacing(6));
|
435
338
|
}
|
436
339
|
|
437
340
|
@include focus-not-focus-visible {
|
@@ -866,15 +769,13 @@ $pseudo-underline-height: 3px;
|
|
866
769
|
|
867
770
|
.gem-c-layout-super-navigation-header__navigation-second-items--topics {
|
868
771
|
@include govuk-media-query($from: "desktop") {
|
869
|
-
@include columns(17, 2, "li");
|
870
|
-
@include columns-children(17, 2, "li");
|
772
|
+
@include columns($items: 17, $columns: 2, $selector: "li", $flow: column);
|
871
773
|
}
|
872
774
|
}
|
873
775
|
|
874
776
|
.gem-c-layout-super-navigation-header__navigation-second-items--government-activity {
|
875
777
|
@include govuk-media-query($from: "desktop") {
|
876
|
-
@include columns(6, 2, "li");
|
877
|
-
@include columns-children(6, 2, "li");
|
778
|
+
@include columns($items: 6, $columns: 2, $selector: "li", $flow: column);
|
878
779
|
padding-bottom: 0;
|
879
780
|
|
880
781
|
& > li {
|
@@ -924,8 +825,7 @@ $pseudo-underline-height: 3px;
|
|
924
825
|
padding: 0 0 govuk-spacing(8) govuk-spacing(4);
|
925
826
|
|
926
827
|
@include govuk-media-query($from: "desktop") {
|
927
|
-
@include columns(2, 2, "li");
|
928
|
-
@include columns-children(2, 2, "li");
|
828
|
+
@include columns($items: 2, $columns: 2, $selector: "li");
|
929
829
|
margin: 0 (0 - govuk-spacing(3));
|
930
830
|
padding: govuk-spacing(6) 0 govuk-spacing(7) 0;
|
931
831
|
}
|
@@ -963,6 +863,7 @@ $pseudo-underline-height: 3px;
|
|
963
863
|
}
|
964
864
|
|
965
865
|
.gem-c-layout-super-navigation-header__navigation-second-item-description {
|
866
|
+
@include govuk-typography-common;
|
966
867
|
font-size: 16px;
|
967
868
|
@if $govuk-typography-use-rem {
|
968
869
|
font-size: govuk-px-to-rem(16px);
|
@@ -1,6 +1,25 @@
|
|
1
1
|
$input-size: 40px;
|
2
2
|
$large-input-size: 50px;
|
3
3
|
|
4
|
+
@mixin large-mode {
|
5
|
+
.gem-c-search__label {
|
6
|
+
@include govuk-font($size: 19, $line-height: $large-input-size);
|
7
|
+
}
|
8
|
+
|
9
|
+
.gem-c-search__input[type="search"] {
|
10
|
+
height: $large-input-size;
|
11
|
+
}
|
12
|
+
|
13
|
+
.gem-c-search__submit {
|
14
|
+
width: $large-input-size;
|
15
|
+
height: $large-input-size;
|
16
|
+
|
17
|
+
.gem-c-search__icon {
|
18
|
+
@include icon-positioning($large-input-size);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
4
23
|
.gem-c-search {
|
5
24
|
position: relative;
|
6
25
|
margin-bottom: 30px;
|
@@ -220,21 +239,12 @@ $large-input-size: 50px;
|
|
220
239
|
}
|
221
240
|
|
222
241
|
.gem-c-search--large {
|
223
|
-
|
224
|
-
|
225
|
-
}
|
226
|
-
|
227
|
-
.gem-c-search__input[type="search"] {
|
228
|
-
height: $large-input-size;
|
229
|
-
}
|
230
|
-
|
231
|
-
.gem-c-search__submit {
|
232
|
-
width: $large-input-size;
|
233
|
-
height: $large-input-size;
|
242
|
+
@include large-mode;
|
243
|
+
}
|
234
244
|
|
235
|
-
|
236
|
-
|
237
|
-
|
245
|
+
.gem-c-search--large-on-mobile {
|
246
|
+
@include govuk-media-query($until: "tablet") {
|
247
|
+
@include large-mode;
|
238
248
|
}
|
239
249
|
}
|
240
250
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.gem-c-signup-link__link {
|
2
|
+
@include govuk-font($size: 19);
|
3
|
+
}
|
4
|
+
|
5
|
+
.gem-c-signup-link__inner {
|
6
|
+
position: relative;
|
7
|
+
}
|
8
|
+
|
9
|
+
.gem-c-signup-link__icon {
|
10
|
+
position: absolute;
|
11
|
+
|
12
|
+
@include govuk-media-query($from: tablet) {
|
13
|
+
top: 2px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.gem-c-signup-link__title {
|
18
|
+
margin-bottom: govuk-spacing(2);
|
19
|
+
margin-left: govuk-spacing(5);
|
20
|
+
}
|
21
|
+
|
22
|
+
.gem-c-signup-link--with-background-and-border {
|
23
|
+
padding: govuk-spacing(6);
|
24
|
+
background-color: govuk-colour("light-grey");
|
25
|
+
border: 1px solid $govuk-border-colour;
|
26
|
+
}
|
27
|
+
|
28
|
+
.gem-c-signup-link--link-only .gem-c-signup-link__link {
|
29
|
+
display: inline-block;
|
30
|
+
vertical-align: top;
|
31
|
+
font-weight: bold;
|
32
|
+
margin-left: govuk-spacing(5);
|
33
|
+
margin-bottom: 0;
|
34
|
+
}
|
@@ -14,7 +14,7 @@
|
|
14
14
|
margin: govuk-spacing(6) 0;
|
15
15
|
overflow-x: auto;
|
16
16
|
width: 100%;
|
17
|
-
@include govuk-font($size:
|
17
|
+
@include govuk-font($size: 19);
|
18
18
|
|
19
19
|
caption {
|
20
20
|
text-align: left;
|
@@ -24,12 +24,16 @@
|
|
24
24
|
th,
|
25
25
|
td {
|
26
26
|
vertical-align: top;
|
27
|
-
padding: govuk-spacing(2) govuk-spacing(
|
28
|
-
border-bottom: solid
|
27
|
+
padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
|
28
|
+
border-bottom: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");
|
29
|
+
|
30
|
+
&:last-child {
|
31
|
+
padding: govuk-spacing(2) 0 govuk-spacing(2) 0;
|
32
|
+
}
|
29
33
|
}
|
30
34
|
|
31
35
|
th {
|
32
|
-
@include govuk-font($size:
|
36
|
+
@include govuk-font($size: 19, $weight: bold);
|
33
37
|
text-align: left;
|
34
38
|
color: $govuk-text-colour;
|
35
39
|
}
|
@@ -0,0 +1,141 @@
|
|
1
|
+
/// Set grid row or column value using the fraction unit.
|
2
|
+
///
|
3
|
+
/// @param {Integer} $number - number of fractions that the grid row or column
|
4
|
+
/// needs to be divided into.
|
5
|
+
/// @returns {String} - the value
|
6
|
+
///
|
7
|
+
/// @example scss - Five fractions will return `1fr 1fr 1fr 1fr 1fr`.
|
8
|
+
/// .container {
|
9
|
+
/// grid-template-rows: fractions(5);
|
10
|
+
/// }
|
11
|
+
///
|
12
|
+
@function fractions($number) {
|
13
|
+
$fractions: "1fr";
|
14
|
+
|
15
|
+
@for $i from 1 to $number {
|
16
|
+
$fractions: $fractions + " 1fr";
|
17
|
+
}
|
18
|
+
|
19
|
+
@return unquote($fractions);
|
20
|
+
}
|
21
|
+
|
22
|
+
/// Arrange items into columns
|
23
|
+
///
|
24
|
+
/// The items can flow from horizontally or vertically.
|
25
|
+
///
|
26
|
+
/// @param {Integer} $items - number of items that need to be arranged
|
27
|
+
/// @param {Integer} $columns - number of columns required
|
28
|
+
/// @param {String} $selector - (optional) the inner element to be targeted.
|
29
|
+
/// @param {String} $direction - (optional) the flow of the items in the grid:
|
30
|
+
/// * `row` goes from the left to right, top to bottom one row at a time
|
31
|
+
/// * `column` goes from the top to bottom, left to right one column at a time
|
32
|
+
///
|
33
|
+
/// @example scss - A 7 item 2 column layout going left to right, top to bottom.
|
34
|
+
/// .container {
|
35
|
+
/// @include columns($items: 7, $columns: 2);
|
36
|
+
/// }
|
37
|
+
///
|
38
|
+
/// @example scss - A 9 item 3 column layout that has `div`s as the inner
|
39
|
+
/// elements.
|
40
|
+
/// .container {
|
41
|
+
/// @include columns($items: 9, $columns: 3, $selector:"div");
|
42
|
+
/// }
|
43
|
+
///
|
44
|
+
/// @example scss - A 16 item 2 column layout going from top to bottom
|
45
|
+
/// elements.
|
46
|
+
/// .container {
|
47
|
+
/// @include columns($items: 9, $columns: 3, $flow:"column");
|
48
|
+
/// }
|
49
|
+
///
|
50
|
+
@mixin columns($items, $columns, $selector: "*", $flow: row) {
|
51
|
+
$rows: ceil($items / $columns);
|
52
|
+
|
53
|
+
display: -ms-grid;
|
54
|
+
display: grid;
|
55
|
+
grid-auto-flow: $flow;
|
56
|
+
-ms-grid-columns: fractions($columns);
|
57
|
+
grid-template-columns: fractions($columns);
|
58
|
+
-ms-grid-rows: fractions($rows);
|
59
|
+
grid-template-rows: fractions($rows);
|
60
|
+
|
61
|
+
// Internet Explorer 10-11 require each element to be placed in the grid -
|
62
|
+
// the `grid-auto-flow` property isn't supported. This means that both the
|
63
|
+
// column and row needs to be set for every child element.
|
64
|
+
@if $flow == "row" {
|
65
|
+
$grid: ();
|
66
|
+
$counter: 0;
|
67
|
+
|
68
|
+
@for $row from 1 through $rows {
|
69
|
+
$this-row: ();
|
70
|
+
|
71
|
+
@for $column from 1 through $columns {
|
72
|
+
$counter: $counter + 1;
|
73
|
+
|
74
|
+
// stylelint-disable max-nesting-depth
|
75
|
+
@if $counter <= $items {
|
76
|
+
$this-row: append($this-row, $counter);
|
77
|
+
}
|
78
|
+
// stylelint-enable max-nesting-depth
|
79
|
+
}
|
80
|
+
|
81
|
+
$grid: append($grid, $this-row, "comma");
|
82
|
+
}
|
83
|
+
|
84
|
+
@for $row-count from 1 through length($grid) {
|
85
|
+
$this-column: nth($grid, $row-count);
|
86
|
+
|
87
|
+
@for $item-index from 1 through length($this-column) {
|
88
|
+
$this-item: nth($this-column, $item-index);
|
89
|
+
|
90
|
+
& > #{$selector}:nth-child(#{$this-item}) {
|
91
|
+
-ms-grid-column: $item-index;
|
92
|
+
-ms-grid-row: $row-count;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
@if $flow == "column" {
|
99
|
+
// This creates a list of lists to represent the columns and rows; for
|
100
|
+
// example, a 7 item 2 column list would create this:
|
101
|
+
// [
|
102
|
+
// [1, 2, 3, 4 ] // column one
|
103
|
+
// [5, 6, 7] // column two
|
104
|
+
// ]
|
105
|
+
$grid: ();
|
106
|
+
$counter: 0;
|
107
|
+
|
108
|
+
@for $column from 1 through $columns {
|
109
|
+
$this-row: ();
|
110
|
+
|
111
|
+
@for $row from 1 through $rows {
|
112
|
+
$counter: $counter + 1;
|
113
|
+
|
114
|
+
// stylelint-disable max-nesting-depth
|
115
|
+
@if $counter <= $items {
|
116
|
+
$this-row: append($this-row, $counter);
|
117
|
+
}
|
118
|
+
// stylelint-enable max-nesting-depth
|
119
|
+
}
|
120
|
+
|
121
|
+
$grid: append($grid, $this-row, "comma");
|
122
|
+
}
|
123
|
+
|
124
|
+
// Now we can loop through the list of lists to create the rules needed for
|
125
|
+
// the older grid syntax; fist looping through the list to get the number
|
126
|
+
// needed for the column, then looping again to get the number for the grid
|
127
|
+
// row:
|
128
|
+
@for $column_index from 1 through length($grid) {
|
129
|
+
$this-row: nth($grid, $column_index);
|
130
|
+
|
131
|
+
@for $item-index from 1 through length($this-row) {
|
132
|
+
$this-item: nth($this-row, $item-index);
|
133
|
+
|
134
|
+
& > #{$selector}:nth-child(#{$this-item}) {
|
135
|
+
-ms-grid-column: $column_index;
|
136
|
+
-ms-grid-row: $item-index;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
@@ -24,7 +24,11 @@
|
|
24
24
|
} %>
|
25
25
|
<% end %>
|
26
26
|
|
27
|
-
<% if navigation.show_brexit_cta?
|
27
|
+
<% if navigation.show_brexit_cta? %>
|
28
28
|
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
|
29
29
|
<% end %>
|
30
|
+
|
31
|
+
<% if navigation.show_covid_booster_cta? %>
|
32
|
+
<%= render 'govuk_publishing_components/components/contextual_sidebar/covid_cta', content_item: content_item %>
|
33
|
+
<% end %>
|
30
34
|
</div>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
text = raw(text)
|
15
15
|
|
16
16
|
cookie_preferences_href ||= "/help/cookies"
|
17
|
-
confirmation_message ||= raw(t("components.cookie_banner.
|
17
|
+
confirmation_message ||= raw(t("components.cookie_banner.confirmation_message_html",
|
18
18
|
link: link_to(
|
19
19
|
t("components.cookie_banner.confirmation_message_link"),
|
20
20
|
cookie_preferences_href,
|
@@ -3,8 +3,10 @@
|
|
3
3
|
suggestion_link_text ||= false
|
4
4
|
suggestion_link_url ||= false
|
5
5
|
suggestion_text ||= nil
|
6
|
+
hide ||= false
|
6
7
|
new_tab ||= false
|
7
8
|
|
9
|
+
|
8
10
|
data_attributes ||= {}
|
9
11
|
data_attributes[:module] = 'intervention'
|
10
12
|
suggestion_data_attributes ||= {}
|
@@ -34,9 +36,16 @@
|
|
34
36
|
|
35
37
|
suggestion_link_text = intervention_helper.accessible_text
|
36
38
|
end
|
39
|
+
|
40
|
+
section_options = {
|
41
|
+
class: "gem-c-intervention",
|
42
|
+
role: "region", aria: aria_attributes,
|
43
|
+
data: data_attributes,
|
44
|
+
}
|
45
|
+
section_options.merge!({ hidden: true }) if hide
|
37
46
|
%>
|
38
47
|
<% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
|
39
|
-
<%= tag.section
|
48
|
+
<%= tag.section section_options do %>
|
40
49
|
<p class="govuk-body">
|
41
50
|
<%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
|
42
51
|
<% if suggestion_link_text && suggestion_link_url %>
|
@@ -21,6 +21,7 @@
|
|
21
21
|
classes << (shared_helper.get_margin_top)
|
22
22
|
classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
|
23
23
|
classes << "gem-c-search--large" if size == "large"
|
24
|
+
classes << "gem-c-search--large-on-mobile" if size == "large-mobile"
|
24
25
|
classes << "gem-c-search--no-border" if no_border
|
25
26
|
if local_assigns[:on_govuk_blue].eql?(true)
|
26
27
|
classes << "gem-c-search--on-govuk-blue"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
local_assigns[:heading_level] ||= 3
|
3
|
+
local_assigns[:margin_bottom] ||= 0
|
4
|
+
link_text ||= false
|
5
|
+
link_href ||= false
|
6
|
+
heading ||= false
|
7
|
+
background ||= false
|
8
|
+
data ||= false
|
9
|
+
|
10
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
11
|
+
|
12
|
+
classes = %w(gem-c-signup-link govuk-!-display-none-print)
|
13
|
+
classes << shared_helper.get_margin_bottom
|
14
|
+
classes << "gem-c-signup-link--link-only" unless heading
|
15
|
+
classes << "gem-c-signup-link--with-background-and-border" if background
|
16
|
+
%>
|
17
|
+
<% if link_text && link_href %>
|
18
|
+
<div class="<%= classes.join(' ') %>">
|
19
|
+
<div class="gem-c-signup-link__inner govuk-width-container">
|
20
|
+
<svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
|
21
|
+
<path fill="black" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/>
|
22
|
+
</svg>
|
23
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-heading-s gem-c-signup-link__title") if heading %>
|
24
|
+
<%= link_to( link_text, link_href, {
|
25
|
+
class: "govuk-link gem-c-signup-link__link",
|
26
|
+
data: data
|
27
|
+
}) %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
<svg class="gem-c-single-page-notification-button__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334"><path fill="currentColor" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/></svg><%= component_helper.button_text %>
|
10
10
|
<% end %>
|
11
11
|
<%= tag.div class: wrapper_classes, data: { module: "gem-track-click"} do %>
|
12
|
-
<%= tag.form class:
|
12
|
+
<%= tag.form class: component_helper.classes, action: "/email/subscriptions/single-page/new", method: "POST", data: component_helper.data do %>
|
13
13
|
<input type="hidden" name="base_path" value="<%= component_helper.base_path %>">
|
14
14
|
<%= content_tag(:button, button_text, {
|
15
15
|
class: "govuk-body-s gem-c-single-page-notification-button__submit",
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
@@ -15,9 +15,9 @@
|
|
15
15
|
"track-dimension-index": "29",
|
16
16
|
} %>
|
17
17
|
|
18
|
-
<%= tag.div class: "gem-c-contextual-
|
19
|
-
<%= tag.h2 title, class: "gem-c-contextual-
|
20
|
-
<%= tag.p class: "gem-c-contextual-
|
18
|
+
<%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--brexit" do %>
|
19
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
|
20
|
+
<%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
|
21
21
|
<%= link_to link_text,
|
22
22
|
link_path,
|
23
23
|
class: "govuk-link",
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
|
2
|
+
<%
|
3
|
+
title = t("components.related_navigation.covid_booster.title")
|
4
|
+
link_text = t("components.related_navigation.covid_booster.link_text")
|
5
|
+
link_path = t("components.related_navigation.covid_booster.link_path")
|
6
|
+
lang = shared_helper.t_locale("components.related_navigation.covid_booster.title")
|
7
|
+
%>
|
8
|
+
|
9
|
+
<% data_attributes = {
|
10
|
+
"module": "gem-track-click",
|
11
|
+
"track-category": "relatedLinkClicked",
|
12
|
+
"track-action": "1.0 Coronavirus",
|
13
|
+
"track-label": link_path,
|
14
|
+
"track-dimension": link_text,
|
15
|
+
"track-dimension-index": "29",
|
16
|
+
} %>
|
17
|
+
|
18
|
+
<%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--covid" do %>
|
19
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
|
20
|
+
<%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
|
21
|
+
<%= link_to link_text,
|
22
|
+
link_path,
|
23
|
+
class: "govuk-link",
|
24
|
+
data: data_attributes,
|
25
|
+
lang: lang %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|