govuk_publishing_components 21.51.0 → 21.55.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/action-link--nhs.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +1 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +38 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +0 -38
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +13 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +1 -1
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +23 -3
- data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +5 -36
- data/app/views/govuk_publishing_components/components/_input.html.erb +12 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +28 -8
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +43 -15
- data/app/views/govuk_publishing_components/components/docs/input.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +23 -0
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +107 -0
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +26 -9
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +1 -3
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +40 -19
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +10 -33
- data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +77 -0
- data/lib/govuk_publishing_components/presenters/schema_org.rb +24 -16
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +6 -0
- data/node_modules/axe-core/axe.js +19 -3
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/bower.json +1 -1
- data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +27 -1
- data/node_modules/axe-core/package.json +21 -21
- data/node_modules/axe-core/sri-history.json +4 -0
- data/node_modules/govuk-frontend/README.md +6 -6
- data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/all.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/_all.scss +31 -29
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -208
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +207 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -65
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +112 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -118
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +12 -1
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -284
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +280 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +28 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -308
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +304 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -30
- data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -88
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +84 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -15
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -59
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +55 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -68
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -81
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +77 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -244
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +238 -0
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -318
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +312 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -50
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +46 -0
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +99 -0
- data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -103
- data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -28
- data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -45
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +40 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -44
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -346
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +53 -0
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -57
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +33 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -37
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +153 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -157
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +50 -0
- data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -54
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -142
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +87 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -91
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -55
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +56 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -60
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_links.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +17 -3
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_template.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +1 -1
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +5 -3
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +2 -4
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +5 -3
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
- data/node_modules/govuk-frontend/package.json +21 -21
- metadata +50 -2
@@ -0,0 +1,40 @@
|
|
1
|
+
@include govuk-exports("govuk/component/panel") {
|
2
|
+
|
3
|
+
.govuk-panel {
|
4
|
+
@include govuk-font($size: 19);
|
5
|
+
|
6
|
+
box-sizing: border-box;
|
7
|
+
|
8
|
+
margin-bottom: govuk-spacing(3);
|
9
|
+
padding: govuk-spacing(7) - $govuk-border-width;
|
10
|
+
|
11
|
+
border: $govuk-border-width solid transparent;
|
12
|
+
|
13
|
+
text-align: center;
|
14
|
+
|
15
|
+
@include govuk-media-query($until: tablet) {
|
16
|
+
padding: govuk-spacing(6) - $govuk-border-width;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
.govuk-panel--confirmation {
|
21
|
+
color: govuk-colour("white");
|
22
|
+
background: govuk-colour("green", $legacy: "turquoise");
|
23
|
+
}
|
24
|
+
|
25
|
+
.govuk-panel__title {
|
26
|
+
margin-top: 0;
|
27
|
+
margin-bottom: govuk-spacing(6);
|
28
|
+
|
29
|
+
@include govuk-font($size: 48, $weight: bold);
|
30
|
+
}
|
31
|
+
|
32
|
+
.govuk-panel__title:last-child {
|
33
|
+
margin-bottom: 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
.govuk-panel__body {
|
37
|
+
@include govuk-font($size: 36);
|
38
|
+
}
|
39
|
+
|
40
|
+
}
|
@@ -1,44 +1,2 @@
|
|
1
|
-
@import "../../
|
2
|
-
@import "
|
3
|
-
@import "../../helpers/all";
|
4
|
-
|
5
|
-
@include govuk-exports("govuk/component/panel") {
|
6
|
-
|
7
|
-
.govuk-panel {
|
8
|
-
@include govuk-font($size: 19);
|
9
|
-
|
10
|
-
box-sizing: border-box;
|
11
|
-
|
12
|
-
margin-bottom: govuk-spacing(3);
|
13
|
-
padding: govuk-spacing(7) - $govuk-border-width;
|
14
|
-
|
15
|
-
border: $govuk-border-width solid transparent;
|
16
|
-
|
17
|
-
text-align: center;
|
18
|
-
|
19
|
-
@include govuk-media-query($until: tablet) {
|
20
|
-
padding: govuk-spacing(6) - $govuk-border-width;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
.govuk-panel--confirmation {
|
25
|
-
color: govuk-colour("white");
|
26
|
-
background: govuk-colour("green", $legacy: "turquoise");
|
27
|
-
}
|
28
|
-
|
29
|
-
.govuk-panel__title {
|
30
|
-
margin-top: 0;
|
31
|
-
margin-bottom: govuk-spacing(6);
|
32
|
-
|
33
|
-
@include govuk-font($size: 48, $weight: bold);
|
34
|
-
}
|
35
|
-
|
36
|
-
.govuk-panel__title:last-child {
|
37
|
-
margin-bottom: 0;
|
38
|
-
}
|
39
|
-
|
40
|
-
.govuk-panel__body {
|
41
|
-
@include govuk-font($size: 36);
|
42
|
-
}
|
43
|
-
|
44
|
-
}
|
1
|
+
@import "../../base";
|
2
|
+
@import "./index";
|
@@ -0,0 +1,27 @@
|
|
1
|
+
@import "../tag/index";
|
2
|
+
|
3
|
+
@include govuk-exports("govuk/component/phase-banner") {
|
4
|
+
.govuk-phase-banner {
|
5
|
+
padding-top: govuk-spacing(2);
|
6
|
+
padding-bottom: govuk-spacing(2);
|
7
|
+
|
8
|
+
border-bottom: 1px solid $govuk-border-colour;
|
9
|
+
}
|
10
|
+
|
11
|
+
.govuk-phase-banner__content {
|
12
|
+
@include govuk-font($size: 16);
|
13
|
+
@include govuk-text-colour;
|
14
|
+
|
15
|
+
display: table;
|
16
|
+
margin: 0;
|
17
|
+
}
|
18
|
+
|
19
|
+
.govuk-phase-banner__content__tag {
|
20
|
+
margin-right: govuk-spacing(2);
|
21
|
+
}
|
22
|
+
|
23
|
+
.govuk-phase-banner__text {
|
24
|
+
display: table-cell;
|
25
|
+
vertical-align: baseline;
|
26
|
+
}
|
27
|
+
}
|
@@ -1,31 +1,2 @@
|
|
1
|
-
@import "../../
|
2
|
-
@import "
|
3
|
-
@import "../../helpers/all";
|
4
|
-
|
5
|
-
@import "../tag/tag";
|
6
|
-
|
7
|
-
@include govuk-exports("govuk/component/phase-banner") {
|
8
|
-
.govuk-phase-banner {
|
9
|
-
padding-top: govuk-spacing(2);
|
10
|
-
padding-bottom: govuk-spacing(2);
|
11
|
-
|
12
|
-
border-bottom: 1px solid $govuk-border-colour;
|
13
|
-
}
|
14
|
-
|
15
|
-
.govuk-phase-banner__content {
|
16
|
-
@include govuk-font($size: 16);
|
17
|
-
@include govuk-text-colour;
|
18
|
-
|
19
|
-
display: table;
|
20
|
-
margin: 0;
|
21
|
-
}
|
22
|
-
|
23
|
-
.govuk-phase-banner__content__tag {
|
24
|
-
margin-right: govuk-spacing(2);
|
25
|
-
}
|
26
|
-
|
27
|
-
.govuk-phase-banner__text {
|
28
|
-
display: table-cell;
|
29
|
-
vertical-align: baseline;
|
30
|
-
}
|
31
|
-
}
|
1
|
+
@import "../../base";
|
2
|
+
@import "./index";
|
@@ -0,0 +1,342 @@
|
|
1
|
+
@import "../error-message/index";
|
2
|
+
@import "../fieldset/index";
|
3
|
+
@import "../hint/index";
|
4
|
+
@import "../label/index";
|
5
|
+
|
6
|
+
@include govuk-exports("govuk/component/radios") {
|
7
|
+
|
8
|
+
$govuk-touch-target-size: 44px;
|
9
|
+
$govuk-radios-size: 40px;
|
10
|
+
$govuk-small-radios-size: 24px;
|
11
|
+
$govuk-radios-label-padding-left-right: govuk-spacing(3);
|
12
|
+
// When the default focus width is used on a curved edge it looks visually smaller.
|
13
|
+
// So for the circular radios we bump the default to make it look visually consistent.
|
14
|
+
$govuk-radios-focus-width: $govuk-focus-width + 1px;
|
15
|
+
|
16
|
+
.govuk-radios__item {
|
17
|
+
@include govuk-font($size: 19);
|
18
|
+
|
19
|
+
display: block;
|
20
|
+
position: relative;
|
21
|
+
|
22
|
+
min-height: $govuk-radios-size;
|
23
|
+
|
24
|
+
margin-bottom: govuk-spacing(2);
|
25
|
+
padding-left: $govuk-radios-size;
|
26
|
+
|
27
|
+
clear: left;
|
28
|
+
}
|
29
|
+
|
30
|
+
.govuk-radios__item:last-child,
|
31
|
+
.govuk-radios__item:last-of-type {
|
32
|
+
margin-bottom: 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
.govuk-radios__input {
|
36
|
+
$input-offset: ($govuk-touch-target-size - $govuk-radios-size) / 2;
|
37
|
+
|
38
|
+
cursor: pointer;
|
39
|
+
|
40
|
+
// IE8 doesn’t support pseudo-elements, so we don’t want to hide native
|
41
|
+
// elements there.
|
42
|
+
@include govuk-not-ie8 {
|
43
|
+
position: absolute;
|
44
|
+
|
45
|
+
z-index: 1;
|
46
|
+
top: $input-offset * -1;
|
47
|
+
left: $input-offset * -1;
|
48
|
+
|
49
|
+
width: $govuk-touch-target-size;
|
50
|
+
height: $govuk-touch-target-size;
|
51
|
+
margin: 0;
|
52
|
+
|
53
|
+
opacity: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
@include govuk-if-ie8 {
|
57
|
+
margin-top: 10px;
|
58
|
+
margin-right: $govuk-radios-size / -2;
|
59
|
+
margin-left: $govuk-radios-size / -2;
|
60
|
+
float: left;
|
61
|
+
|
62
|
+
// add focus outline to input
|
63
|
+
&:focus {
|
64
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
.govuk-radios__label {
|
70
|
+
display: inline-block;
|
71
|
+
margin-bottom: 0;
|
72
|
+
padding: 8px $govuk-radios-label-padding-left-right govuk-spacing(1);
|
73
|
+
cursor: pointer;
|
74
|
+
// remove 300ms pause on mobile
|
75
|
+
-ms-touch-action: manipulation;
|
76
|
+
touch-action: manipulation;
|
77
|
+
}
|
78
|
+
|
79
|
+
// ( ) Radio ring
|
80
|
+
.govuk-radios__label::before {
|
81
|
+
content: "";
|
82
|
+
box-sizing: border-box;
|
83
|
+
position: absolute;
|
84
|
+
top: 0;
|
85
|
+
left: 0;
|
86
|
+
|
87
|
+
width: $govuk-radios-size;
|
88
|
+
height: $govuk-radios-size;
|
89
|
+
|
90
|
+
border: $govuk-border-width-form-element solid currentColor;
|
91
|
+
border-radius: 50%;
|
92
|
+
background: transparent;
|
93
|
+
}
|
94
|
+
|
95
|
+
// • Radio button
|
96
|
+
//
|
97
|
+
// We create the 'button' entirely out of 'border' so that they remain
|
98
|
+
// 'filled' even when colours are overridden in the browser.
|
99
|
+
.govuk-radios__label::after {
|
100
|
+
content: "";
|
101
|
+
|
102
|
+
position: absolute;
|
103
|
+
top: govuk-spacing(2);
|
104
|
+
left: govuk-spacing(2);
|
105
|
+
|
106
|
+
width: 0;
|
107
|
+
height: 0;
|
108
|
+
|
109
|
+
border: govuk-spacing(2) solid currentColor;
|
110
|
+
border-radius: 50%;
|
111
|
+
opacity: 0;
|
112
|
+
background: currentColor;
|
113
|
+
}
|
114
|
+
|
115
|
+
.govuk-radios__hint {
|
116
|
+
display: block;
|
117
|
+
padding-right: $govuk-radios-label-padding-left-right;
|
118
|
+
padding-left: $govuk-radios-label-padding-left-right;
|
119
|
+
}
|
120
|
+
|
121
|
+
// Focused state
|
122
|
+
.govuk-radios__input:focus + .govuk-radios__label::before {
|
123
|
+
border-width: 4px;
|
124
|
+
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Selected state
|
128
|
+
.govuk-radios__input:checked + .govuk-radios__label::after {
|
129
|
+
opacity: 1;
|
130
|
+
}
|
131
|
+
|
132
|
+
// Disabled state
|
133
|
+
.govuk-radios__input:disabled,
|
134
|
+
.govuk-radios__input:disabled + .govuk-radios__label {
|
135
|
+
cursor: default;
|
136
|
+
}
|
137
|
+
|
138
|
+
.govuk-radios__input:disabled + .govuk-radios__label {
|
139
|
+
opacity: .5;
|
140
|
+
}
|
141
|
+
|
142
|
+
// =========================================================
|
143
|
+
// Inline radios
|
144
|
+
// =========================================================
|
145
|
+
|
146
|
+
.govuk-radios--inline {
|
147
|
+
@include govuk-media-query ($from: tablet) {
|
148
|
+
@include govuk-clearfix;
|
149
|
+
|
150
|
+
.govuk-radios__item {
|
151
|
+
margin-right: govuk-spacing(4);
|
152
|
+
float: left;
|
153
|
+
clear: none;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
// Prevent inline modifier being used with conditional reveals
|
158
|
+
&.govuk-radios--conditional {
|
159
|
+
.govuk-radios__item {
|
160
|
+
margin-right: 0;
|
161
|
+
float: none;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
// =========================================================
|
167
|
+
// Dividers ('or')
|
168
|
+
// =========================================================
|
169
|
+
|
170
|
+
.govuk-radios__divider {
|
171
|
+
$govuk-divider-size: $govuk-radios-size !default;
|
172
|
+
@include govuk-font($size: 19);
|
173
|
+
@include govuk-text-colour;
|
174
|
+
width: $govuk-divider-size;
|
175
|
+
margin-bottom: govuk-spacing(2);
|
176
|
+
text-align: center;
|
177
|
+
}
|
178
|
+
|
179
|
+
// =========================================================
|
180
|
+
// Conditional reveals
|
181
|
+
// =========================================================
|
182
|
+
|
183
|
+
// The narrow border is used in the conditional reveals because the border has
|
184
|
+
// to be an even number in order to be centred under the 40px checkbox or radio.
|
185
|
+
$conditional-border-width: $govuk-border-width-narrow;
|
186
|
+
// Calculate the amount of padding needed to keep the border centered against the radios.
|
187
|
+
$conditional-border-padding: ($govuk-radios-size / 2) - ($conditional-border-width / 2);
|
188
|
+
// Move the border centered with the radios
|
189
|
+
$conditional-margin-left: $conditional-border-padding;
|
190
|
+
// Move the contents of the conditional inline with the label
|
191
|
+
$conditional-padding-left: $conditional-border-padding + $govuk-radios-label-padding-left-right;
|
192
|
+
|
193
|
+
.govuk-radios__conditional {
|
194
|
+
@include govuk-responsive-margin(4, "bottom");
|
195
|
+
margin-left: $conditional-margin-left;
|
196
|
+
padding-left: $conditional-padding-left;
|
197
|
+
border-left: $conditional-border-width solid $govuk-border-colour;
|
198
|
+
|
199
|
+
.js-enabled &--hidden {
|
200
|
+
display: none;
|
201
|
+
}
|
202
|
+
|
203
|
+
& > :last-child {
|
204
|
+
margin-bottom: 0;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
// =========================================================
|
209
|
+
// Small checkboxes
|
210
|
+
// =========================================================
|
211
|
+
|
212
|
+
.govuk-radios--small {
|
213
|
+
|
214
|
+
$input-offset: ($govuk-touch-target-size - $govuk-small-radios-size) / 2;
|
215
|
+
$label-offset: $govuk-touch-target-size - $input-offset;
|
216
|
+
|
217
|
+
.govuk-radios__item {
|
218
|
+
@include govuk-clearfix;
|
219
|
+
min-height: 0;
|
220
|
+
margin-bottom: 0;
|
221
|
+
padding-left: $label-offset;
|
222
|
+
float: left;
|
223
|
+
}
|
224
|
+
|
225
|
+
// Shift the touch target into the left margin so that the visible edge of
|
226
|
+
// the control is aligned
|
227
|
+
//
|
228
|
+
// ┆Which colour is your favourite?
|
229
|
+
// ┌┆───┐
|
230
|
+
// │┆() │ Purple
|
231
|
+
// └┆▲──┘
|
232
|
+
// ▲┆└─ Radio pseudo element, aligned with margin
|
233
|
+
// └─── Touch target (invisible input), shifted into the margin
|
234
|
+
.govuk-radios__input {
|
235
|
+
@include govuk-not-ie8 {
|
236
|
+
left: $input-offset * -1;
|
237
|
+
}
|
238
|
+
|
239
|
+
@include govuk-if-ie8 {
|
240
|
+
margin-left: $govuk-small-radios-size * -1;
|
241
|
+
}
|
242
|
+
}
|
243
|
+
|
244
|
+
// Adjust the size and position of the label.
|
245
|
+
//
|
246
|
+
// Unlike larger radios, we also have to float the label in order to
|
247
|
+
// 'shrink' it, preventing the hover state from kicking in across the full
|
248
|
+
// width of the parent element.
|
249
|
+
.govuk-radios__label {
|
250
|
+
margin-top: -2px;
|
251
|
+
padding: 13px govuk-spacing(3) 13px 1px;
|
252
|
+
float: left;
|
253
|
+
|
254
|
+
@include govuk-media-query($from: tablet) {
|
255
|
+
padding: 11px govuk-spacing(3) 10px 1px;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
// ( ) Radio ring
|
260
|
+
//
|
261
|
+
// Reduce the size of the control [1], vertically centering it within the
|
262
|
+
// touch target [2]
|
263
|
+
.govuk-radios__label::before {
|
264
|
+
top: $input-offset - $govuk-border-width-form-element; // 2
|
265
|
+
width: $govuk-small-radios-size; // 1
|
266
|
+
height: $govuk-small-radios-size; // 1
|
267
|
+
}
|
268
|
+
|
269
|
+
// • Radio button
|
270
|
+
//
|
271
|
+
// Reduce the size of the 'button' and center it within the ring
|
272
|
+
.govuk-radios__label::after {
|
273
|
+
top: 15px;
|
274
|
+
left: 7px;
|
275
|
+
border-width: 5px;
|
276
|
+
}
|
277
|
+
|
278
|
+
// Fix position of hint with small radios
|
279
|
+
//
|
280
|
+
// Do not use hints with small radios – because they're within the input
|
281
|
+
// wrapper they trigger the hover state, but clicking them doesn't actually
|
282
|
+
// activate the control.
|
283
|
+
//
|
284
|
+
// (If you do use them, they won't look completely broken... but seriously,
|
285
|
+
// don't use them)
|
286
|
+
.govuk-radios__hint {
|
287
|
+
padding: 0;
|
288
|
+
clear: both;
|
289
|
+
pointer-events: none;
|
290
|
+
}
|
291
|
+
|
292
|
+
// Align conditional reveals with small radios
|
293
|
+
.govuk-radios__conditional {
|
294
|
+
$margin-left: ($govuk-small-radios-size / 2) - ($conditional-border-width / 2);
|
295
|
+
margin-left: $margin-left;
|
296
|
+
padding-left: $label-offset - ($margin-left + $conditional-border-width);
|
297
|
+
clear: both;
|
298
|
+
}
|
299
|
+
|
300
|
+
.govuk-radios__divider {
|
301
|
+
width: $govuk-small-radios-size;
|
302
|
+
margin-bottom: govuk-spacing(1);
|
303
|
+
}
|
304
|
+
|
305
|
+
// Hover state for small radios.
|
306
|
+
//
|
307
|
+
// We use a hover state for small radios because the touch target size
|
308
|
+
// is so much larger than their visible size, and so we need to provide
|
309
|
+
// feedback to the user as to which radio they will select when their
|
310
|
+
// cursor is outside of the visible area.
|
311
|
+
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {
|
312
|
+
box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
|
313
|
+
}
|
314
|
+
|
315
|
+
// Because we've overridden the border-shadow provided by the focus state,
|
316
|
+
// we need to redefine that too.
|
317
|
+
//
|
318
|
+
// We use two box shadows, one that restores the original focus state [1]
|
319
|
+
// and another that then applies the hover state [2].
|
320
|
+
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {
|
321
|
+
// sass-lint:disable indentation
|
322
|
+
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour, // 1
|
323
|
+
0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
|
324
|
+
}
|
325
|
+
|
326
|
+
// For devices that explicitly don't support hover, don't provide a hover
|
327
|
+
// state (e.g. on touch devices like iOS).
|
328
|
+
//
|
329
|
+
// We can't use `@media (hover: hover)` because we wouldn't get the hover
|
330
|
+
// state in browsers that don't support `@media (hover)` (like Internet
|
331
|
+
// Explorer) – so we have to 'undo' the hover state instead.
|
332
|
+
@media (hover: none), (pointer: coarse) {
|
333
|
+
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {
|
334
|
+
box-shadow: initial;
|
335
|
+
}
|
336
|
+
|
337
|
+
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {
|
338
|
+
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|