govuk_publishing_components 23.15.0 → 24.3.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/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +330 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -10
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
- data/app/assets/stylesheets/component_guide/application.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +298 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +7 -87
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +21 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +105 -48
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +17 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
- data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
- data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +15 -22
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +47 -36
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +37 -3
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/config/initializers/assets.rb +0 -1
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +61 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +13 -20
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
- data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
- data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
- data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -40,13 +40,13 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
40
40
|
this.$module.sessionStoreLink = this.$module.sessionStoreLink + '_' + this.$module.uniqueId
|
41
41
|
}
|
42
42
|
|
43
|
-
this.$module.upChevronSvg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"
|
44
|
-
'<path d="M19.5 10C19.5 15.2467 15.2467 19.5 10 19.5C4.75329 19.5 0.499997 15.2467 0.499998 10C0.499999 4.7533 4.7533 0.500001 10 0.500002C15.2467 0.500003 19.5 4.7533 19.5 10Z" stroke="#1D70B8"/>' +
|
45
|
-
'<path d="M6.32617 12.3262L10 8.65234L13.6738 12.3262" stroke="#1D70B8" stroke-width="2"/>' +
|
43
|
+
this.$module.upChevronSvg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
44
|
+
'<path class="gem-c-step-nav__chevron-stroke" d="M19.5 10C19.5 15.2467 15.2467 19.5 10 19.5C4.75329 19.5 0.499997 15.2467 0.499998 10C0.499999 4.7533 4.7533 0.500001 10 0.500002C15.2467 0.500003 19.5 4.7533 19.5 10Z" stroke="#1D70B8"/>' +
|
45
|
+
'<path class="gem-c-step-nav__chevron-stroke" d="M6.32617 12.3262L10 8.65234L13.6738 12.3262" stroke="#1D70B8" stroke-width="2"/>' +
|
46
46
|
'</svg>'
|
47
|
-
this.$module.downChevronSvg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"
|
48
|
-
'<path d="M0.499997 10C0.499998 4.75329 4.75329 0.499999 10 0.499999C15.2467 0.5 19.5 4.75329 19.5 10C19.5 15.2467 15.2467 19.5 10 19.5C4.75329 19.5 0.499997 15.2467 0.499997 10Z" stroke="#1D70B8"/>' +
|
49
|
-
'<path d="M13.6738 8.67383L10 12.3477L6.32617 8.67383" stroke="#1D70B8" stroke-width="2"/>' +
|
47
|
+
this.$module.downChevronSvg = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
48
|
+
'<path class="gem-c-step-nav__chevron-stroke" d="M0.499997 10C0.499998 4.75329 4.75329 0.499999 10 0.499999C15.2467 0.5 19.5 4.75329 19.5 10C19.5 15.2467 15.2467 19.5 10 19.5C4.75329 19.5 0.499997 15.2467 0.499997 10Z" stroke="#1D70B8"/>' +
|
49
|
+
'<path class="gem-c-step-nav__chevron-stroke" d="M13.6738 8.67383L10 12.3477L6.32617 8.67383" stroke="#1D70B8" stroke-width="2"/>' +
|
50
50
|
'</svg>'
|
51
51
|
|
52
52
|
var stepNavTracker = new this.StepNavTracker(this.$module.uniqueId, this.$module.totalSteps, this.$module.totalLinks)
|
@@ -76,8 +76,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
76
76
|
var showall = document.createElement('div')
|
77
77
|
showall.className = 'gem-c-step-nav__controls'
|
78
78
|
showall.innerHTML = '<button aria-expanded="false" class="gem-c-step-nav__button gem-c-step-nav__button--controls js-step-controls-button">' +
|
79
|
-
this.$module.
|
80
|
-
this.$module.
|
79
|
+
'<span class="gem-c-step-nav__button-text gem-c-step-nav__button-text--all js-step-controls-button-text">' + this.$module.actions.showAllText + '</span>' +
|
80
|
+
'<span class="gem-c-step-nav__chevron js-step-controls-button-icon">' + this.$module.downChevronSvg + '</span>' +
|
81
81
|
'</button>'
|
82
82
|
|
83
83
|
var steps = this.$module.querySelectorAll('.gem-c-step-nav__steps')[0]
|
@@ -93,13 +93,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
93
93
|
if (!thisel.querySelectorAll('.js-toggle-link').length) {
|
94
94
|
var span = document.createElement('span')
|
95
95
|
var showHideSpan = document.createElement('span')
|
96
|
+
var showHideSpanText = document.createElement('span')
|
97
|
+
var showHideSpanIcon = document.createElement('span')
|
96
98
|
var commaSpan = document.createElement('span')
|
97
99
|
var thisSectionSpan = document.createElement('span')
|
98
100
|
|
99
101
|
showHideSpan.className = 'gem-c-step-nav__toggle-link js-toggle-link'
|
102
|
+
showHideSpanText.className = 'gem-c-step-nav__button-text js-toggle-link-text'
|
103
|
+
showHideSpanIcon.className = 'gem-c-step-nav__chevron js-toggle-link-icon'
|
100
104
|
commaSpan.className = 'govuk-visually-hidden'
|
101
105
|
thisSectionSpan.className = 'govuk-visually-hidden'
|
102
106
|
|
107
|
+
showHideSpan.appendChild(showHideSpanText)
|
108
|
+
showHideSpan.appendChild(showHideSpanIcon)
|
109
|
+
|
103
110
|
commaSpan.innerHTML = ', '
|
104
111
|
thisSectionSpan.innerHTML = ' this section'
|
105
112
|
|
@@ -351,12 +358,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
351
358
|
|
352
359
|
Gemstepnav.prototype.setShowHideAllText = function () {
|
353
360
|
var shownSteps = this.$module.querySelectorAll('.step-is-shown').length
|
361
|
+
|
354
362
|
// Find out if the number of is-opens == total number of steps
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
}
|
363
|
+
var shownStepsIsTotalSteps = shownSteps === this.$module.totalSteps
|
364
|
+
|
365
|
+
this.$module.showOrHideAllButton.querySelector('.js-step-controls-button-text').innerHTML = shownStepsIsTotalSteps ? this.$module.actions.hideAllText : this.$module.actions.showAllText
|
366
|
+
this.$module.showOrHideAllButton.querySelector('.js-step-controls-button-icon').innerHTML = shownStepsIsTotalSteps ? this.$module.upChevronSvg : this.$module.downChevronSvg
|
360
367
|
}
|
361
368
|
|
362
369
|
Gemstepnav.prototype.StepView = function (stepElement, $module) {
|
@@ -394,7 +401,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
394
401
|
|
395
402
|
this.titleButton.setAttribute('aria-expanded', isShown)
|
396
403
|
var showHideText = this.stepElement.querySelectorAll('.js-toggle-link')[0]
|
397
|
-
|
404
|
+
|
405
|
+
showHideText.querySelector('.js-toggle-link-text').innerHTML = isShown ? this.hideText : this.showText
|
406
|
+
showHideText.querySelector('.js-toggle-link-icon').innerHTML = isShown ? this.upChevronSvg : this.downChevronSvg
|
398
407
|
}
|
399
408
|
|
400
409
|
this.isShown = function () {
|
@@ -262,14 +262,6 @@ html {
|
|
262
262
|
}
|
263
263
|
}
|
264
264
|
|
265
|
-
// Hide survey banner
|
266
|
-
// stylelint-disable selector-max-id
|
267
|
-
#user-satisfaction-survey-container,
|
268
|
-
#global-cookie-message {
|
269
|
-
display: none;
|
270
|
-
}
|
271
|
-
// stylelint-enable selector-max-id
|
272
|
-
|
273
265
|
// Rouge syntax highlighting
|
274
266
|
// Based on https://github.com/alphagov/tech-docs-template/blob/master/template/source/stylesheets/palette/_syntax-highlighting.scss
|
275
267
|
|
@@ -17,7 +17,6 @@
|
|
17
17
|
@import "components/button";
|
18
18
|
@import "components/character-count";
|
19
19
|
@import "components/checkboxes";
|
20
|
-
@import "components/chevron-banner";
|
21
20
|
@import "components/contents-list";
|
22
21
|
@import "components/contextual-guidance";
|
23
22
|
@import "components/contextual-sidebar";
|
@@ -6,12 +6,10 @@
|
|
6
6
|
@import "govuk/utilities/all";
|
7
7
|
@import "govuk/overrides/all";
|
8
8
|
|
9
|
-
@import "govuk_publishing_components/components/helpers/variables";
|
10
9
|
@import "govuk_publishing_components/components/helpers/brand-colours";
|
11
10
|
@import "govuk_publishing_components/components/helpers/link";
|
12
11
|
@import "govuk_publishing_components/components/helpers/px-to-em";
|
13
12
|
@import "govuk_publishing_components/components/mixins/govuk-template-link-focus-override";
|
14
13
|
@import "govuk_publishing_components/components/mixins/media-down";
|
15
14
|
@import "govuk_publishing_components/components/mixins/margins";
|
16
|
-
@import "govuk_publishing_components/components/mixins/clearfix";
|
17
15
|
@import "govuk_publishing_components/components/mixins/css3";
|
@@ -1,25 +1,309 @@
|
|
1
|
-
|
1
|
+
$gem-c-accordion-border-width: 3px;
|
2
|
+
$gem-c-accordion-bottom-border-width: 1px;
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
// Buttons within the sections don’t need default styling
|
5
|
+
.gem-c-accordion__section-button {
|
6
|
+
display: inline-block;
|
7
|
+
margin-bottom: 0;
|
8
|
+
padding-top: govuk-spacing(3);
|
9
|
+
font-weight: bold;
|
10
|
+
@include govuk-font($size: 24, $weight: bold);
|
11
|
+
}
|
12
|
+
|
13
|
+
.gem-c-accordion__section-header {
|
14
|
+
padding-top: govuk-spacing(2) 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
.gem-c-accordion__section-heading {
|
18
|
+
margin: govuk-spacing(1) 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.js-enabled {
|
22
|
+
.gem-c-accordion {
|
23
|
+
border-bottom: $gem-c-accordion-bottom-border-width solid $govuk-border-colour;
|
24
|
+
}
|
25
|
+
|
26
|
+
.gem-c-accordion__controls {
|
27
|
+
text-align: left;
|
28
|
+
}
|
29
|
+
|
30
|
+
.gem-c-accordion__open-all {
|
31
|
+
position: relative;
|
32
|
+
z-index: 1;
|
33
|
+
border-width: 0;
|
34
|
+
color: $govuk-link-colour;
|
35
|
+
background: none;
|
36
|
+
-webkit-appearance: none;
|
37
|
+
cursor: pointer;
|
38
|
+
margin-bottom: govuk-spacing(4);
|
39
|
+
padding: 0 govuk-spacing(1) govuk-spacing(1) 0;
|
40
|
+
@include govuk-font($size: 16);
|
41
|
+
@include govuk-link-common;
|
42
|
+
@include govuk-link-style-default;
|
43
|
+
// Remove default button focus outline in Firefox
|
44
|
+
&::-moz-focus-inner {
|
45
|
+
padding: 0;
|
46
|
+
border: 0;
|
9
47
|
}
|
10
48
|
}
|
11
|
-
}
|
12
49
|
|
13
|
-
.
|
14
|
-
.
|
15
|
-
|
16
|
-
|
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;
|
17
62
|
}
|
18
63
|
}
|
19
64
|
|
20
|
-
|
65
|
+
// Create Chervon icon align with text
|
66
|
+
.gem-c-accordion-nav__chevron {
|
67
|
+
vertical-align: text-top;
|
68
|
+
display: inline-block;
|
69
|
+
box-sizing: border-box;
|
70
|
+
position: relative;
|
71
|
+
width: em(20, 14);
|
72
|
+
height: em(20, 14);
|
73
|
+
margin-left: em(5, 14);
|
74
|
+
border: em(1, 14) solid;
|
75
|
+
border-radius: em(100, 14);
|
76
|
+
// Main icon size across views, yet keep responsive for zoom
|
21
77
|
@include govuk-media-query($from: tablet) {
|
22
|
-
|
78
|
+
width: em(20, 16);
|
79
|
+
height: em(20, 16);
|
80
|
+
margin-left: em(5, 16);
|
81
|
+
border: em(1, 16) solid;
|
82
|
+
}
|
83
|
+
|
84
|
+
&:after {
|
85
|
+
content: "";
|
86
|
+
display: block;
|
87
|
+
box-sizing: border-box;
|
88
|
+
position: absolute;
|
89
|
+
overflow: visible;
|
90
|
+
width: em(6, 14);
|
91
|
+
height: em(6, 14);
|
92
|
+
border-top: em(2, 14) solid;
|
93
|
+
border-right: em(2, 14) solid;
|
94
|
+
transform: rotate(-45deg);
|
95
|
+
left: em(6, 14);
|
96
|
+
bottom: em(5, 14);
|
97
|
+
@include govuk-media-query($from: tablet) {
|
98
|
+
width: em(6, 16);
|
99
|
+
height: em(6, 16);
|
100
|
+
border-top: em(2, 16) solid;
|
101
|
+
border-right: em(2, 16) solid;
|
102
|
+
left: em(6, 16);
|
103
|
+
bottom: em(5, 16);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
// Rotate icon to create "Down" version
|
109
|
+
.gem-c-accordion-nav__chevron--down {
|
110
|
+
transform: rotate(180deg);
|
111
|
+
}
|
112
|
+
|
113
|
+
.gem-c-accordion__section-heading {
|
114
|
+
// Override browser defaults to ensure consistent element height
|
115
|
+
margin-top: 0; // Override browser default
|
116
|
+
margin-bottom: 0; // Override browser default
|
117
|
+
@include govuk-font(24);
|
118
|
+
}
|
119
|
+
|
120
|
+
// Section headers have a pointer cursor as an additional affordance
|
121
|
+
.gem-c-accordion__section-header {
|
122
|
+
position: relative;
|
123
|
+
}
|
124
|
+
|
125
|
+
// For devices that can't hover such as touch devices,
|
126
|
+
// remove hover state as it can be stuck in that state (iOS).
|
127
|
+
@media (hover: none) {
|
128
|
+
.gem-c-accordion__section-header:hover {
|
129
|
+
border-top-color: $govuk-link-colour;
|
130
|
+
box-shadow: inset 0 $gem-c-accordion-border-width 0 0 $govuk-link-colour;
|
131
|
+
|
132
|
+
.gem-c-accordion__section-button {
|
133
|
+
border-top-color: $govuk-link-colour;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
// Buttons within the headers don’t need default styling
|
139
|
+
.gem-c-accordion__section-button {
|
140
|
+
padding: govuk-spacing(2) 0 govuk-spacing(5);
|
141
|
+
position: relative;
|
142
|
+
margin: 0;
|
143
|
+
border-width: $gem-c-accordion-bottom-border-width 0 0 0;
|
144
|
+
border-top: $gem-c-accordion-bottom-border-width solid $govuk-border-colour;
|
145
|
+
color: $govuk-text-colour;
|
146
|
+
background: none;
|
147
|
+
text-align: left;
|
148
|
+
cursor: pointer;
|
149
|
+
-webkit-appearance: none;
|
150
|
+
@include govuk-typography-common;
|
151
|
+
width: 100%;
|
152
|
+
|
153
|
+
&:active {
|
154
|
+
z-index: 1;
|
155
|
+
color: $govuk-link-active-colour;
|
156
|
+
background: none;
|
157
|
+
}
|
158
|
+
|
159
|
+
// Remove default button focus outline in Firefox
|
160
|
+
&::-moz-focus-inner {
|
161
|
+
padding: 0;
|
162
|
+
border: 0;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
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
|
+
.gem-c-accordion__section-button:focus {
|
176
|
+
@include govuk-focused-text;
|
177
|
+
// Overwrite focus border to top
|
178
|
+
box-shadow: 0 0, 0 -4px;
|
179
|
+
border-top: 1px solid transparent;
|
180
|
+
|
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
|
+
// Focus state to change chervon icon colour within individual sections
|
187
|
+
.gem-c-accordion-nav__chevron {
|
188
|
+
color: $govuk-text-colour;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
// Extend the touch area of the button to span the section header
|
193
|
+
.gem-c-accordion__section-button:after {
|
194
|
+
content: "";
|
195
|
+
position: absolute;
|
196
|
+
top: 0;
|
197
|
+
right: 0;
|
198
|
+
bottom: 0;
|
199
|
+
left: 0;
|
200
|
+
}
|
201
|
+
|
202
|
+
.gem-c-accordion__section-button:hover:not(:focus) {
|
203
|
+
text-decoration: none;
|
204
|
+
}
|
205
|
+
|
206
|
+
// For devices that can't hover such as touch devices,
|
207
|
+
// remove hover state as it can be stuck in that state (iOS).
|
208
|
+
@media (hover: none) {
|
209
|
+
.gem-c-accordion__section-button:hover {
|
210
|
+
text-decoration: none;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
// Add toggle link with Chevron icon on right.
|
215
|
+
.gem-c-accordion__toggle-link {
|
216
|
+
display: block;
|
217
|
+
color: $govuk-link-colour;
|
218
|
+
text-transform: capitalize;
|
219
|
+
margin-top: govuk-spacing(1);
|
220
|
+
margin-bottom: govuk-spacing(1);
|
221
|
+
@include govuk-font($size: 16, $line-height: 1);
|
222
|
+
|
223
|
+
&:active {
|
224
|
+
background: $govuk-link-active-colour;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
// Setting width of the text, so the icon doesn't shift (left / right) when toggled
|
229
|
+
.gem-c-accordion__toggle-text {
|
230
|
+
min-width: em(40, 16);
|
231
|
+
display: inline-block;
|
232
|
+
}
|
233
|
+
|
234
|
+
.gem-c-accordion__open-all-text {
|
235
|
+
min-width: em(120, 16);
|
236
|
+
display: inline-block;
|
237
|
+
text-align: left;
|
238
|
+
}
|
239
|
+
|
240
|
+
// Change the summary subheading size.
|
241
|
+
.gem-c-accordion__section-summary {
|
242
|
+
@include govuk-responsive-margin(1, "top");
|
243
|
+
@include govuk-responsive-margin(2, "bottom");
|
244
|
+
@include govuk-typography-common;
|
245
|
+
@include govuk-typography-responsive($size: 19);
|
246
|
+
}
|
247
|
+
|
248
|
+
// Hide body of expanded sections
|
249
|
+
.gem-c-accordion__section-content {
|
250
|
+
display: none;
|
251
|
+
@include govuk-responsive-padding(0, "top");
|
252
|
+
@include govuk-responsive-padding(8, "bottom");
|
253
|
+
}
|
254
|
+
|
255
|
+
// Show the body of expanded sections
|
256
|
+
.gem-c-accordion__section--expanded .gem-c-accordion__section-content {
|
257
|
+
display: block;
|
258
|
+
}
|
259
|
+
|
260
|
+
// Remove the bottom margin from the last item inside the content
|
261
|
+
.gem-c-accordion__section-content > :last-child {
|
262
|
+
margin-bottom: 0;
|
263
|
+
}
|
264
|
+
|
265
|
+
// Condensed layout
|
266
|
+
.gem-c-accordion--condensed {
|
267
|
+
.gem-c-accordion__open-all {
|
268
|
+
margin-bottom: govuk-spacing(5);
|
269
|
+
@include govuk-font($size: 14, $line-height: 1);
|
270
|
+
}
|
271
|
+
|
272
|
+
.gem-c-accordion__section-button {
|
273
|
+
@include govuk-typography-responsive($size: 19, $important: true);
|
274
|
+
padding-top: govuk-spacing(1);
|
275
|
+
padding-bottom: govuk-spacing(5);
|
276
|
+
}
|
277
|
+
|
278
|
+
// Reduce Chevron size
|
279
|
+
.gem-c-accordion-nav__chevron {
|
280
|
+
width: em(20, 14);
|
281
|
+
height: em(20, 14);
|
282
|
+
margin-left: em(5, 14);
|
283
|
+
border: em(1, 14) solid;
|
284
|
+
border-radius: em(100, 14);
|
285
|
+
transform: scale(.875);
|
286
|
+
|
287
|
+
&:after {
|
288
|
+
width: em(6, 14);
|
289
|
+
height: em(6, 14);
|
290
|
+
border-top: em(2, 14) solid;
|
291
|
+
border-right: em(2, 14) solid;
|
292
|
+
left: em(6, 14);
|
293
|
+
bottom: em(5, 14);
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
.gem-c-accordion-nav__chevron--down {
|
298
|
+
transform: scale(.875) rotate(180deg);
|
299
|
+
}
|
300
|
+
|
301
|
+
.gem-c-accordion__section-summary {
|
302
|
+
@include govuk-typography-responsive($size: 16, $important: true);
|
303
|
+
}
|
304
|
+
|
305
|
+
.gem-c-accordion__toggle-link {
|
306
|
+
@include govuk-font($size: 14, $line-height: 1);
|
23
307
|
}
|
24
308
|
}
|
25
309
|
}
|