govuk_publishing_components 27.15.0 → 27.19.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/custom-dimensions.js +52 -26
- data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +25 -25
- 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/components/_big-number.scss +10 -2
- 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/_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 +31 -5
- data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +4 -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 +20 -0
- data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +6 -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 +21 -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/intervention_helper.rb +20 -2
- data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +9 -2
@@ -1,13 +1,21 @@
|
|
1
1
|
.gem-c-big-number {
|
2
2
|
margin-bottom: govuk-spacing(3);
|
3
|
+
@include govuk-typography-common;
|
4
|
+
@include govuk-text-colour;
|
3
5
|
}
|
4
6
|
|
5
7
|
.gem-c-big-number__value {
|
6
|
-
|
8
|
+
font-size: 80px;
|
9
|
+
@include govuk-typography-weight-bold;
|
10
|
+
line-height: 1;
|
11
|
+
|
12
|
+
@if $govuk-typography-use-rem {
|
13
|
+
font-size: govuk-px-to-rem(80px);
|
14
|
+
}
|
7
15
|
}
|
8
16
|
|
9
17
|
.gem-c-big-number__label {
|
10
|
-
@include govuk-font($size:
|
18
|
+
@include govuk-font($size: 19, $weight: bold);
|
11
19
|
|
12
20
|
// This pseudo element is to bypass an issue with NVDA where block level elements are dictated separately.
|
13
21
|
// What's happening here is that the label and the number technically have an inline relationship but appear to have a block relationship thanks to this element
|
@@ -1,31 +1,36 @@
|
|
1
1
|
$transition-campaign-red: #ff003b;
|
2
|
+
$covid-colour: $govuk-link-colour;
|
2
3
|
|
3
|
-
.gem-c-contextual-
|
4
|
+
.gem-c-contextual-sidebar__related-links {
|
4
5
|
border-top: 2px solid $govuk-brand-colour;
|
5
6
|
}
|
6
7
|
|
7
|
-
.gem-c-contextual-
|
8
|
+
.gem-c-contextual-sidebar__heading {
|
8
9
|
margin-top: govuk-spacing(3);
|
9
10
|
margin-bottom: govuk-spacing(2);
|
11
|
+
color: $govuk-text-colour;
|
10
12
|
}
|
11
13
|
|
12
|
-
.gem-c-contextual-
|
14
|
+
.gem-c-contextual-sidebar__text {
|
15
|
+
@include govuk-font(16);
|
16
|
+
margin-bottom: govuk-spacing(1);
|
17
|
+
@include govuk-media-query($from: tablet) {
|
18
|
+
margin-bottom: govuk-spacing(2);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.gem-c-contextual-sidebar__cta {
|
13
23
|
margin-bottom: govuk-spacing(6);
|
14
24
|
background-color: govuk-colour('light-grey', $legacy: 'grey-4');
|
15
|
-
border-top: 2px solid $transition-campaign-red;
|
16
25
|
display: block;
|
17
26
|
padding: 0 govuk-spacing(3) govuk-spacing(3);
|
18
27
|
text-decoration: none;
|
28
|
+
}
|
19
29
|
|
20
|
-
|
21
|
-
|
22
|
-
|
30
|
+
.gem-c-contextual-sidebar__cta--brexit {
|
31
|
+
border-top: 2px solid $transition-campaign-red;
|
32
|
+
}
|
23
33
|
|
24
|
-
|
25
|
-
|
26
|
-
margin-bottom: govuk-spacing(1);
|
27
|
-
@include govuk-media-query($from: tablet) {
|
28
|
-
margin-bottom: govuk-spacing(2);
|
29
|
-
}
|
30
|
-
}
|
34
|
+
.gem-c-contextual-sidebar__cta--covid {
|
35
|
+
border-top: 2px solid $covid-colour;
|
31
36
|
}
|
@@ -45,17 +45,21 @@
|
|
45
45
|
}
|
46
46
|
|
47
47
|
.gem-c-image-card__image-wrapper {
|
48
|
-
@include govuk-grid-column($width: one-
|
48
|
+
@include govuk-grid-column($width: one-half, $at: mobile);
|
49
49
|
}
|
50
50
|
|
51
51
|
.gem-c-image-card__text-wrapper {
|
52
|
-
@include govuk-grid-column($width:
|
52
|
+
@include govuk-grid-column($width: one-half, $at: mobile);
|
53
53
|
}
|
54
54
|
}
|
55
55
|
|
56
56
|
.gem-c-image-card__image {
|
57
57
|
display: block;
|
58
58
|
max-width: 100%;
|
59
|
+
border-top: 1px solid $govuk-border-colour;
|
60
|
+
border-left: none;
|
61
|
+
border-right: none;
|
62
|
+
border-bottom: none;
|
59
63
|
}
|
60
64
|
|
61
65
|
.gem-c-image-card__title {
|
@@ -100,7 +104,13 @@
|
|
100
104
|
|
101
105
|
.gem-c-image-card__context,
|
102
106
|
.gem-c-image-card__metadata {
|
103
|
-
@include govuk-font(
|
107
|
+
@include govuk-font($size: false);
|
108
|
+
font-size: 16px;
|
109
|
+
|
110
|
+
@if $govuk-typography-use-rem {
|
111
|
+
font-size: govuk-px-to-rem(16px);
|
112
|
+
}
|
113
|
+
|
104
114
|
margin: 0 0 (govuk-spacing(3) / 2);
|
105
115
|
color: govuk-colour("dark-grey", $legacy: "grey-1");
|
106
116
|
|
@@ -110,13 +120,13 @@
|
|
110
120
|
}
|
111
121
|
|
112
122
|
.gem-c-image-card__description {
|
113
|
-
@include govuk-font($size:
|
123
|
+
@include govuk-font($size: 19);
|
114
124
|
padding-top: (govuk-spacing(3) / 2);
|
115
125
|
word-wrap: break-word;
|
116
126
|
}
|
117
127
|
|
118
128
|
.gem-c-image-card__list {
|
119
|
-
@include govuk-font($size:
|
129
|
+
@include govuk-font($size: 19);
|
120
130
|
position: relative;
|
121
131
|
z-index: 2;
|
122
132
|
padding: (govuk-spacing(3) / 2) 0 0 0;
|
@@ -160,7 +170,7 @@
|
|
160
170
|
|
161
171
|
.gem-c-image-card--large {
|
162
172
|
.gem-c-image-card__image-wrapper {
|
163
|
-
@include govuk-grid-column($width:
|
173
|
+
@include govuk-grid-column($width: one-half, $at: tablet);
|
164
174
|
|
165
175
|
margin-bottom: govuk-spacing(2);
|
166
176
|
float: none;
|
@@ -175,7 +185,7 @@
|
|
175
185
|
}
|
176
186
|
|
177
187
|
.gem-c-image-card__text-wrapper {
|
178
|
-
@include govuk-grid-column($width: one-
|
188
|
+
@include govuk-grid-column($width: one-half, $at: tablet);
|
179
189
|
|
180
190
|
padding: 0;
|
181
191
|
overflow: hidden;
|
@@ -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
|
|
@@ -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,6 +3,9 @@
|
|
3
3
|
suggestion_link_text ||= false
|
4
4
|
suggestion_link_url ||= false
|
5
5
|
suggestion_text ||= nil
|
6
|
+
hide ||= false
|
7
|
+
new_tab ||= false
|
8
|
+
|
6
9
|
|
7
10
|
data_attributes ||= {}
|
8
11
|
data_attributes[:module] = 'intervention'
|
@@ -13,17 +16,40 @@
|
|
13
16
|
aria_attributes[:label] = 'Intervention'
|
14
17
|
|
15
18
|
local_assigns[:query_string] ||= request.query_string
|
19
|
+
local_assigns[:suggestion_link_text] = suggestion_link_text
|
20
|
+
local_assigns[:suggestion_link_url] = suggestion_link_url
|
16
21
|
|
17
22
|
intervention_helper = GovukPublishingComponents::Presenters::InterventionHelper.new(local_assigns)
|
18
23
|
dismiss_href = intervention_helper.dismiss_link
|
24
|
+
|
25
|
+
suggestion_tag_options = {
|
26
|
+
class: "govuk-link gem-c-intervention__suggestion-link",
|
27
|
+
href: suggestion_link_url,
|
28
|
+
data: suggestion_data_attributes,
|
29
|
+
}
|
30
|
+
|
31
|
+
if new_tab && (suggestion_link_text && suggestion_link_url)
|
32
|
+
target = "_blank"
|
33
|
+
rel = intervention_helper.security_attr
|
34
|
+
|
35
|
+
suggestion_tag_options.merge!({ target: target, rel: rel })
|
36
|
+
|
37
|
+
suggestion_link_text = intervention_helper.accessible_text
|
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
|
19
46
|
%>
|
20
|
-
<% if suggestion_text
|
21
|
-
<%= tag.section
|
47
|
+
<% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
|
48
|
+
<%= tag.section section_options do %>
|
22
49
|
<p class="govuk-body">
|
23
50
|
<%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
|
24
|
-
<% if suggestion_link_text
|
25
|
-
<%= tag.a suggestion_link_text,
|
26
|
-
|
51
|
+
<% if suggestion_link_text && suggestion_link_url %>
|
52
|
+
<%= tag.a suggestion_link_text, suggestion_tag_options %>
|
27
53
|
<% end %>
|
28
54
|
</p>
|
29
55
|
|
@@ -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"
|
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",
|