govuk_publishing_components 21.53.0 → 21.55.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link--nhs.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +1 -0
  4. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
  5. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
  6. data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +5 -4
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +38 -7
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +0 -38
  10. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +34 -22
  11. data/app/views/govuk_publishing_components/components/_action_link.html.erb +23 -3
  12. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +28 -8
  13. data/app/views/govuk_publishing_components/components/docs/action_link.yml +43 -15
  14. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +23 -0
  15. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +11 -9
  16. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +8 -1
  17. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -1
  18. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +7 -6
  19. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +77 -0
  20. data/lib/govuk_publishing_components/presenters/schema_org.rb +24 -16
  21. data/lib/govuk_publishing_components/version.rb +1 -1
  22. data/node_modules/axe-core/CHANGELOG.md +6 -0
  23. data/node_modules/axe-core/axe.js +19 -3
  24. data/node_modules/axe-core/axe.min.js +2 -2
  25. data/node_modules/axe-core/bower.json +1 -1
  26. data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +27 -1
  27. data/node_modules/axe-core/package.json +21 -21
  28. data/node_modules/axe-core/sri-history.json +4 -0
  29. data/node_modules/govuk-frontend/README.md +6 -6
  30. data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
  31. data/node_modules/govuk-frontend/govuk/all.js +1 -1
  32. data/node_modules/govuk-frontend/govuk/all.scss +1 -3
  33. data/node_modules/govuk-frontend/govuk/components/_all.scss +31 -29
  34. data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -208
  35. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +207 -0
  36. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1 -1
  37. data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -65
  38. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +112 -0
  39. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -118
  40. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
  41. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +6 -0
  42. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +12 -1
  43. data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -284
  44. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +280 -0
  45. data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -31
  46. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +28 -0
  47. data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -308
  48. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +304 -0
  49. data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -30
  50. data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
  51. data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -88
  52. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +84 -0
  53. data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -15
  54. data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
  55. data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -59
  56. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +55 -0
  57. data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -68
  58. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
  59. data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -81
  60. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +77 -0
  61. data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -244
  62. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +238 -0
  63. data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -318
  64. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +312 -0
  65. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +7 -1
  66. data/node_modules/govuk-frontend/govuk/components/header/template.njk +2 -2
  67. data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -50
  68. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +46 -0
  69. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +99 -0
  70. data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -103
  71. data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
  72. data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -28
  73. data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
  74. data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -45
  75. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +40 -0
  76. data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -44
  77. data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
  78. data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -31
  79. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
  80. data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -346
  81. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +53 -0
  82. data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -57
  83. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +33 -0
  84. data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -37
  85. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +153 -0
  86. data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -157
  87. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +50 -0
  88. data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -54
  89. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +138 -0
  90. data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -142
  91. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +87 -0
  92. data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -91
  93. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +51 -0
  94. data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -55
  95. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +56 -0
  96. data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -60
  97. data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +5 -3
  98. data/node_modules/govuk-frontend/govuk/core/_links.scss +5 -3
  99. data/node_modules/govuk-frontend/govuk/core/_lists.scss +17 -3
  100. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +5 -3
  101. data/node_modules/govuk-frontend/govuk/core/_template.scss +5 -3
  102. data/node_modules/govuk-frontend/govuk/core/_typography.scss +5 -3
  103. data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +1 -1
  104. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
  105. data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +2 -1
  106. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -1
  107. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -1
  108. data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
  109. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +1 -1
  110. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +1 -1
  111. data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +1 -1
  112. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +1 -3
  113. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +1 -3
  114. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +5 -3
  115. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +2 -4
  116. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +5 -3
  117. data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +5 -3
  118. data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +5 -3
  119. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +5 -3
  120. data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +1 -1
  121. data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +1 -1
  122. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
  123. data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +1 -1
  124. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
  125. data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +1 -1
  126. data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
  127. data/node_modules/govuk-frontend/package.json +21 -21
  128. metadata +49 -2
@@ -1,103 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @import "../error-message/error-message";
6
- @import "../hint/hint";
7
- @import "../label/label";
8
-
9
- @include govuk-exports("govuk/component/input") {
10
- .govuk-input {
11
- @include govuk-font($size: 19);
12
-
13
- box-sizing: border-box;
14
- width: 100%;
15
- height: 40px;
16
- @if $govuk-typography-use-rem {
17
- height: govuk-px-to-rem(40px);
18
- }
19
- margin-top: 0;
20
-
21
- padding: govuk-spacing(1);
22
- // setting any background-color makes text invisible when changing colours to dark backgrounds in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1335476)
23
- // as background-color and color need to always be set together, color should not be set either
24
- border: $govuk-border-width-form-element solid $govuk-input-border-colour;
25
- border-radius: 0;
26
-
27
- // Disable inner shadow and remove rounded corners
28
- -webkit-appearance: none;
29
- -moz-appearance: none;
30
- appearance: none;
31
-
32
- &:focus {
33
- outline: $govuk-focus-width solid $govuk-focus-colour;
34
- // Ensure outline appears outside of the element
35
- outline-offset: 0;
36
- // Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width` - this is for consistency with
37
- // components such as textarea where we avoid changing `border-width` as
38
- // it will change the element size. Also, `outline` cannot be utilised
39
- // here as it is already used for the yellow focus state.
40
- box-shadow: inset 0 0 0 $govuk-border-width-form-element;
41
-
42
- @include govuk-if-ie8 {
43
- // IE8 doesn't support `box-shadow` so double the border with
44
- // `border-width`.
45
- border-width: $govuk-border-width-form-element * 2;
46
- }
47
- }
48
- }
49
-
50
- .govuk-input::-webkit-outer-spin-button,
51
- .govuk-input::-webkit-inner-spin-button {
52
- margin: 0;
53
- -webkit-appearance: none;
54
- }
55
-
56
- .govuk-input[type="number"] {
57
- -moz-appearance: textfield;
58
- }
59
-
60
- .govuk-input--error {
61
- border: $govuk-border-width-form-element-error solid $govuk-error-colour;
62
-
63
- &:focus {
64
- border-color: $govuk-input-border-colour;
65
- // Remove `box-shadow` inherited from `:focus` as `input--error`
66
- // already has the thicker border.
67
- box-shadow: none;
68
- }
69
- }
70
-
71
- // The ex measurements are based on the number of W's that can fit inside the input
72
- // Extra space is left on the right hand side to allow for the Safari prefill icon
73
- // Linear regression estimation based on visual tests: y = 1.76 + 1.81x
74
-
75
- .govuk-input--width-30 {
76
- max-width: 56ex + 3ex;
77
- }
78
-
79
- .govuk-input--width-20 {
80
- max-width: 38ex + 3ex;
81
- }
82
-
83
- .govuk-input--width-10 {
84
- max-width: 20ex + 3ex;
85
- }
86
-
87
- .govuk-input--width-5 {
88
- max-width: 10.8ex;
89
- }
90
-
91
- .govuk-input--width-4 {
92
- max-width: 9ex;
93
- }
94
-
95
- .govuk-input--width-3 {
96
- max-width: 7.2ex;
97
- }
98
-
99
- .govuk-input--width-2 {
100
- max-width: 5.4ex;
101
- }
102
-
103
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,24 @@
1
+ @include govuk-exports("govuk/component/inset-text") {
2
+ .govuk-inset-text {
3
+ @include govuk-font($size: 19);
4
+ @include govuk-text-colour;
5
+ padding: govuk-spacing(3);
6
+ // Margin top intended to collapse
7
+ // This adds an additional 10px to the paragraph above
8
+ @include govuk-responsive-margin(6, "top");
9
+ @include govuk-responsive-margin(6, "bottom");
10
+
11
+ clear: both;
12
+
13
+ border-left: $govuk-border-width-wide solid $govuk-border-colour;
14
+
15
+ > :first-child {
16
+ margin-top: 0;
17
+ }
18
+
19
+ > :only-child,
20
+ > :last-child {
21
+ margin-bottom: 0;
22
+ }
23
+ }
24
+ }
@@ -1,28 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/inset-text") {
6
- .govuk-inset-text {
7
- @include govuk-font($size: 19);
8
- @include govuk-text-colour;
9
- padding: govuk-spacing(3);
10
- // Margin top intended to collapse
11
- // This adds an additional 10px to the paragraph above
12
- @include govuk-responsive-margin(6, "top");
13
- @include govuk-responsive-margin(6, "bottom");
14
-
15
- clear: both;
16
-
17
- border-left: $govuk-border-width-wide solid $govuk-border-colour;
18
-
19
- > :first-child {
20
- margin-top: 0;
21
- }
22
-
23
- > :only-child,
24
- > :last-child {
25
- margin-bottom: 0;
26
- }
27
- }
28
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,41 @@
1
+ @include govuk-exports("govuk/component/label") {
2
+ .govuk-label {
3
+ @include govuk-font($size: 19);
4
+ @include govuk-text-colour;
5
+
6
+ display: block;
7
+
8
+ margin-bottom: govuk-spacing(1);
9
+ }
10
+
11
+ // Modifiers that make labels look more like their equivalent headings
12
+
13
+ .govuk-label--xl {
14
+ @include govuk-font($size: 48, $weight: bold);
15
+ margin-bottom: govuk-spacing(3);
16
+ }
17
+
18
+ .govuk-label--l {
19
+ @include govuk-font($size: 36, $weight: bold);
20
+ margin-bottom: govuk-spacing(3);
21
+ }
22
+
23
+ .govuk-label--m {
24
+ @include govuk-font($size: 24, $weight: bold);
25
+ margin-bottom: govuk-spacing(2);
26
+ }
27
+
28
+ .govuk-label--s {
29
+ @include govuk-font($size: 19, $weight: bold);
30
+ }
31
+
32
+ // When the label is nested inside a heading, override the heading so that it
33
+ // does not have a margin. Effectively we want to be able to treat the heading
34
+ // as if it is not there.
35
+ //
36
+ // This breaks BEM conventions because it exists as a parent of the 'block',
37
+ // so we can't really consider an element.
38
+ .govuk-label-wrapper {
39
+ margin: 0;
40
+ }
41
+ }
@@ -1,45 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/label") {
6
- .govuk-label {
7
- @include govuk-font($size: 19);
8
- @include govuk-text-colour;
9
-
10
- display: block;
11
-
12
- margin-bottom: govuk-spacing(1);
13
- }
14
-
15
- // Modifiers that make labels look more like their equivalent headings
16
-
17
- .govuk-label--xl {
18
- @include govuk-font($size: 48, $weight: bold);
19
- margin-bottom: govuk-spacing(3);
20
- }
21
-
22
- .govuk-label--l {
23
- @include govuk-font($size: 36, $weight: bold);
24
- margin-bottom: govuk-spacing(3);
25
- }
26
-
27
- .govuk-label--m {
28
- @include govuk-font($size: 24, $weight: bold);
29
- margin-bottom: govuk-spacing(2);
30
- }
31
-
32
- .govuk-label--s {
33
- @include govuk-font($size: 19, $weight: bold);
34
- }
35
-
36
- // When the label is nested inside a heading, override the heading so that it
37
- // does not have a margin. Effectively we want to be able to treat the heading
38
- // as if it is not there.
39
- //
40
- // This breaks BEM conventions because it exists as a parent of the 'block',
41
- // so we can't really consider an element.
42
- .govuk-label-wrapper {
43
- margin: 0;
44
- }
45
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -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 "../../settings/all";
2
- @import "../../tools/all";
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 "../../settings/all";
2
- @import "../../tools/all";
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
+ }