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
@@ -0,0 +1,312 @@
1
+ @include govuk-exports("govuk/component/header") {
2
+
3
+ $govuk-header-background: govuk-colour("black");
4
+ $govuk-header-border-color: $govuk-brand-colour;
5
+ $govuk-header-border-width: govuk-spacing(2);
6
+ $govuk-header-text: govuk-colour("white");
7
+ $govuk-header-link: govuk-colour("white");
8
+ $govuk-header-link-hover: govuk-colour("white");
9
+ $govuk-header-link-active: #1d8feb;
10
+ $govuk-header-nav-item-border-color: #2e3133;
11
+
12
+ .govuk-header {
13
+ @include govuk-font($size: 16);
14
+
15
+ border-bottom: govuk-spacing(2) solid govuk-colour("white");
16
+ color: $govuk-header-text;
17
+ background: $govuk-header-background;
18
+
19
+ }
20
+
21
+ .govuk-header__container--full-width {
22
+ padding: 0 govuk-spacing(3);
23
+ border-color: $govuk-header-border-color;
24
+
25
+ .govuk-header__menu-button {
26
+ right: govuk-spacing(3);
27
+ }
28
+ }
29
+
30
+ .govuk-header__container {
31
+ @include govuk-clearfix;
32
+ position: relative;
33
+ margin-bottom: -$govuk-header-border-width;
34
+ padding-top: govuk-spacing(2);
35
+ border-bottom: $govuk-header-border-width solid $govuk-header-border-color;
36
+ }
37
+
38
+ .govuk-header__logotype {
39
+ display: inline-block;
40
+ margin-right: govuk-spacing(1);
41
+ }
42
+
43
+ .govuk-header__logotype-crown {
44
+ position: relative;
45
+ top: -1px;
46
+ margin-right: 1px;
47
+ fill: currentColor;
48
+ vertical-align: top;
49
+ }
50
+
51
+ .govuk-header__logotype-crown-fallback-image {
52
+ width: 36px;
53
+ height: 32px;
54
+ border: 0;
55
+ vertical-align: middle;
56
+ }
57
+
58
+ .govuk-header__product-name {
59
+ @include govuk-font($size: 24, $line-height: 1);
60
+ display: inline-table;
61
+ padding-right: govuk-spacing(2);
62
+ }
63
+
64
+ .govuk-header__link {
65
+ text-decoration: none;
66
+
67
+ &:link,
68
+ &:visited {
69
+ color: $govuk-header-link;
70
+ }
71
+
72
+ &:hover {
73
+ text-decoration: underline;
74
+ }
75
+
76
+ &:focus {
77
+ @include govuk-focused-text;
78
+ }
79
+
80
+ // alphagov/govuk_template includes a specific a:link:focus selector
81
+ // designed to make unvisited links a slightly darker blue when focussed, so
82
+ // we need to override the text colour for that combination of selectors.
83
+ @include govuk-compatibility(govuk_template) {
84
+ &:link:focus {
85
+ @include govuk-text-colour;
86
+ }
87
+ }
88
+ }
89
+
90
+ .govuk-header__link--homepage {
91
+ // Font size needs to be set on the link so that the box sizing is correct
92
+ // in Firefox
93
+ @include govuk-font($size: false, $weight: bold);
94
+
95
+ display: inline-block;
96
+ font-size: 30px; // We don't have a mixin that produces 30px font size
97
+ line-height: 1;
98
+
99
+ &:link,
100
+ &:visited {
101
+ text-decoration: none;
102
+ }
103
+
104
+ &:hover,
105
+ &:active {
106
+ // Negate the added border
107
+ margin-bottom: -1px;
108
+ // Omitting colour will use default value of currentColor – if we
109
+ // specified currentColor explicitly IE8 would ignore this rule.
110
+ border-bottom: 1px solid;
111
+ }
112
+
113
+ // Remove any borders that show when focused and hovered.
114
+ &:focus {
115
+ margin-bottom: 0;
116
+ border-bottom: 0;
117
+ }
118
+ }
119
+
120
+ .govuk-header__link--service-name {
121
+ display: inline-block;
122
+ margin-bottom: govuk-spacing(2);
123
+ @include govuk-font($size: 24, $weight: bold);
124
+ }
125
+
126
+ .govuk-header__logo,
127
+ .govuk-header__content {
128
+ box-sizing: border-box;
129
+ }
130
+
131
+ .govuk-header__logo {
132
+ @include govuk-responsive-margin(2, "bottom");
133
+ padding-right: govuk-spacing(8);
134
+
135
+ @include govuk-media-query ($from: desktop) {
136
+ width: 33.33%;
137
+ padding-right: $govuk-gutter-half;
138
+ float: left;
139
+ vertical-align: top;
140
+ }
141
+ }
142
+
143
+ .govuk-header__content {
144
+ @include govuk-media-query ($from: desktop) {
145
+ width: 66.66%;
146
+ padding-left: $govuk-gutter-half;
147
+ float: left;
148
+ }
149
+ }
150
+
151
+ .govuk-header__menu-button {
152
+ @include govuk-font($size: 16);
153
+ display: none;
154
+ position: absolute;
155
+ top: govuk-spacing(4);
156
+ right: 0;
157
+ margin: 0;
158
+ padding: 0;
159
+ border: 0;
160
+ color: $govuk-header-link;
161
+ background: none;
162
+
163
+ &:hover {
164
+ text-decoration: underline;
165
+ }
166
+
167
+ &:focus {
168
+ @include govuk-focused-text;
169
+ }
170
+
171
+ &::after {
172
+ @include govuk-shape-arrow($direction: down, $base: 10px, $display: inline-block);
173
+ content: "";
174
+ margin-left: govuk-spacing(1);
175
+ }
176
+
177
+ @include govuk-media-query ($from: tablet) {
178
+ top: govuk-spacing(3);
179
+ }
180
+ }
181
+
182
+ .govuk-header__menu-button--open {
183
+ &::after {
184
+ @include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
185
+ }
186
+ }
187
+
188
+ .govuk-header__navigation {
189
+ @include govuk-responsive-margin(2, "bottom");
190
+ display: block;
191
+ margin: 0;
192
+ padding: 0;
193
+ list-style: none;
194
+ }
195
+
196
+ .js-enabled {
197
+ .govuk-header__menu-button {
198
+ display: block;
199
+ @include govuk-media-query ($from: desktop) {
200
+ display: none;
201
+ }
202
+ }
203
+
204
+ .govuk-header__navigation {
205
+ display: none;
206
+ @include govuk-media-query ($from: desktop) {
207
+ display: block;
208
+ }
209
+ }
210
+
211
+ .govuk-header__navigation--open {
212
+ display: block;
213
+ }
214
+ }
215
+
216
+
217
+ .govuk-header__navigation--end {
218
+ @include govuk-media-query ($from: desktop) {
219
+ margin: 0;
220
+ padding: govuk-spacing(1) 0;
221
+ text-align: right;
222
+ }
223
+ }
224
+
225
+ .govuk-header__navigation--no-service-name {
226
+ padding-top: govuk-spacing(7);
227
+ }
228
+
229
+ .govuk-header__navigation-item {
230
+ padding: govuk-spacing(2) 0;
231
+ border-bottom: 1px solid $govuk-header-nav-item-border-color;
232
+
233
+ @include govuk-media-query ($from: desktop) {
234
+ display: inline-block;
235
+ margin-right: govuk-spacing(3);
236
+ padding: govuk-spacing(1) 0;
237
+ border: 0;
238
+ }
239
+
240
+ a {
241
+ @include govuk-font($size: 16, $weight: bold);
242
+ white-space: nowrap;
243
+ }
244
+ }
245
+
246
+ .govuk-header__navigation-item--active {
247
+ a {
248
+ &:link,
249
+ &:hover,
250
+ &:visited {
251
+ color: $govuk-header-link-active;
252
+ }
253
+
254
+ // When focussed, the text colour needs to be darker to ensure that colour
255
+ // contrast is still acceptable
256
+ &:focus {
257
+ color: $govuk-focus-text-colour;
258
+ }
259
+ }
260
+ }
261
+
262
+ .govuk-header__navigation-item:last-child {
263
+ margin-right: 0;
264
+ }
265
+
266
+ @include govuk-media-query($media-type: print) {
267
+ .govuk-header {
268
+ border-bottom-width: 0;
269
+ color: govuk-colour("black");
270
+ background: transparent;
271
+ }
272
+
273
+ // Hide the inverted crown when printing in browsers that don't support SVG.
274
+ .govuk-header__logotype-crown-fallback-image {
275
+ display: none;
276
+ }
277
+
278
+ .govuk-header__link {
279
+ &:link,
280
+ &:visited {
281
+ color: govuk-colour("black");
282
+ }
283
+
284
+ // Do not append link href to GOV.UK link when printing (e.g. '(/)')
285
+ &:after {
286
+ display: none;
287
+ }
288
+ }
289
+ }
290
+
291
+ @if $govuk-use-legacy-font {
292
+ // Begin adjustments for font baseline offset
293
+ // These should be removed when the font is updated with the correct baseline
294
+ .govuk-header__logotype-crown,
295
+ .govuk-header__logotype-crown-fallback-image {
296
+ position: relative;
297
+ top: -4px;
298
+ vertical-align: middle;
299
+ }
300
+
301
+ .govuk-header {
302
+ $offset: 3px;
303
+ padding-top: $offset;
304
+ }
305
+
306
+ .govuk-header__link--homepage {
307
+ line-height: 30px;
308
+ }
309
+ // End adjustments
310
+ }
311
+
312
+ }
@@ -39,7 +39,13 @@
39
39
  "name": "text",
40
40
  "type": "string",
41
41
  "required": false,
42
- "description": "Text of the navigation item."
42
+ "description": "Text for the navigation item. If `html` is provided, the `text` argument will be ignored."
43
+ },
44
+ {
45
+ "name": "html",
46
+ "type": "string",
47
+ "required": false,
48
+ "description": "HTML for the navigation item. If `html` is provided, the `text` argument will be ignored."
43
49
  },
44
50
  {
45
51
  "name": "href",
@@ -64,10 +64,10 @@
64
64
  <nav>
65
65
  <ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="Top Level Navigation">
66
66
  {% for item in params.navigation %}
67
- {% if item.href and item.text %}
67
+ {% if item.href and (item.text or item.html) %}
68
68
  <li class="govuk-header__navigation-item{{ ' govuk-header__navigation-item--active' if item.active }}">
69
69
  <a class="govuk-header__link" href="{{ item.href }}"{% for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>
70
- {{ item.text }}
70
+ {{ item.html | safe if item.html else item.text }}
71
71
  </a>
72
72
  </li>
73
73
  {% endif %}
@@ -1,50 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/hint") {
6
- .govuk-hint {
7
- @include govuk-font($size: 19);
8
-
9
- display: block;
10
-
11
- margin-bottom: govuk-spacing(3);
12
-
13
- color: $govuk-secondary-text-colour;
14
- }
15
-
16
- // Reduces margin-bottom of hint when used after the default label (no class)
17
- // or govuk-label--s for better vertical alignment.
18
-
19
- // This adjustment will not work when the label is inside the <h1>, however it
20
- // is unlikely that the default or govuk-label--s class would be used in this
21
- // case.
22
-
23
- // This adjustment will not work in browsers that do not support :not().
24
- // Users with these browsers will see the default size margin (5px larger).
25
-
26
- .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-hint {
27
- margin-bottom: govuk-spacing(2);
28
- }
29
-
30
- // Reduces margin-bottom of hint when used after the default legend (no class)
31
- // or govuk-fieldset__legend--s for better vertical alignment.
32
-
33
- // This adjustment will not work when the legend is outside the <h1>, however
34
- // it is unlikely that the default or govuk-fieldset__legend--s class would be
35
- // used in this case.
36
-
37
- // This adjustment will not work in browsers that do not support :not().
38
- // Users with these browsers will see the default size margin (5px larger).
39
-
40
- .govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl) + .govuk-hint {
41
- margin-bottom: govuk-spacing(2);
42
- }
43
-
44
- // Reduces visual spacing of legend when there is a hint
45
-
46
- .govuk-fieldset__legend + .govuk-hint,
47
- .govuk-fieldset__legend + .govuk-hint {
48
- margin-top: -(govuk-spacing(1));
49
- }
50
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,46 @@
1
+ @include govuk-exports("govuk/component/hint") {
2
+ .govuk-hint {
3
+ @include govuk-font($size: 19);
4
+
5
+ display: block;
6
+
7
+ margin-bottom: govuk-spacing(3);
8
+
9
+ color: $govuk-secondary-text-colour;
10
+ }
11
+
12
+ // Reduces margin-bottom of hint when used after the default label (no class)
13
+ // or govuk-label--s for better vertical alignment.
14
+
15
+ // This adjustment will not work when the label is inside the <h1>, however it
16
+ // is unlikely that the default or govuk-label--s class would be used in this
17
+ // case.
18
+
19
+ // This adjustment will not work in browsers that do not support :not().
20
+ // Users with these browsers will see the default size margin (5px larger).
21
+
22
+ .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-hint {
23
+ margin-bottom: govuk-spacing(2);
24
+ }
25
+
26
+ // Reduces margin-bottom of hint when used after the default legend (no class)
27
+ // or govuk-fieldset__legend--s for better vertical alignment.
28
+
29
+ // This adjustment will not work when the legend is outside the <h1>, however
30
+ // it is unlikely that the default or govuk-fieldset__legend--s class would be
31
+ // used in this case.
32
+
33
+ // This adjustment will not work in browsers that do not support :not().
34
+ // Users with these browsers will see the default size margin (5px larger).
35
+
36
+ .govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl) + .govuk-hint {
37
+ margin-bottom: govuk-spacing(2);
38
+ }
39
+
40
+ // Reduces visual spacing of legend when there is a hint
41
+
42
+ .govuk-fieldset__legend + .govuk-hint,
43
+ .govuk-fieldset__legend + .govuk-hint {
44
+ margin-top: -(govuk-spacing(1));
45
+ }
46
+ }
@@ -0,0 +1,99 @@
1
+ @import "../error-message/index";
2
+ @import "../hint/index";
3
+ @import "../label/index";
4
+
5
+ @include govuk-exports("govuk/component/input") {
6
+ .govuk-input {
7
+ @include govuk-font($size: 19);
8
+
9
+ box-sizing: border-box;
10
+ width: 100%;
11
+ height: 40px;
12
+ @if $govuk-typography-use-rem {
13
+ height: govuk-px-to-rem(40px);
14
+ }
15
+ margin-top: 0;
16
+
17
+ padding: govuk-spacing(1);
18
+ // setting any background-color makes text invisible when changing colours to dark backgrounds in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1335476)
19
+ // as background-color and color need to always be set together, color should not be set either
20
+ border: $govuk-border-width-form-element solid $govuk-input-border-colour;
21
+ border-radius: 0;
22
+
23
+ // Disable inner shadow and remove rounded corners
24
+ -webkit-appearance: none;
25
+ -moz-appearance: none;
26
+ appearance: none;
27
+
28
+ &:focus {
29
+ outline: $govuk-focus-width solid $govuk-focus-colour;
30
+ // Ensure outline appears outside of the element
31
+ outline-offset: 0;
32
+ // Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width` - this is for consistency with
33
+ // components such as textarea where we avoid changing `border-width` as
34
+ // it will change the element size. Also, `outline` cannot be utilised
35
+ // here as it is already used for the yellow focus state.
36
+ box-shadow: inset 0 0 0 $govuk-border-width-form-element;
37
+
38
+ @include govuk-if-ie8 {
39
+ // IE8 doesn't support `box-shadow` so double the border with
40
+ // `border-width`.
41
+ border-width: $govuk-border-width-form-element * 2;
42
+ }
43
+ }
44
+ }
45
+
46
+ .govuk-input::-webkit-outer-spin-button,
47
+ .govuk-input::-webkit-inner-spin-button {
48
+ margin: 0;
49
+ -webkit-appearance: none;
50
+ }
51
+
52
+ .govuk-input[type="number"] {
53
+ -moz-appearance: textfield;
54
+ }
55
+
56
+ .govuk-input--error {
57
+ border: $govuk-border-width-form-element-error solid $govuk-error-colour;
58
+
59
+ &:focus {
60
+ border-color: $govuk-input-border-colour;
61
+ // Remove `box-shadow` inherited from `:focus` as `input--error`
62
+ // already has the thicker border.
63
+ box-shadow: none;
64
+ }
65
+ }
66
+
67
+ // The ex measurements are based on the number of W's that can fit inside the input
68
+ // Extra space is left on the right hand side to allow for the Safari prefill icon
69
+ // Linear regression estimation based on visual tests: y = 1.76 + 1.81x
70
+
71
+ .govuk-input--width-30 {
72
+ max-width: 56ex + 3ex;
73
+ }
74
+
75
+ .govuk-input--width-20 {
76
+ max-width: 38ex + 3ex;
77
+ }
78
+
79
+ .govuk-input--width-10 {
80
+ max-width: 20ex + 3ex;
81
+ }
82
+
83
+ .govuk-input--width-5 {
84
+ max-width: 10.8ex;
85
+ }
86
+
87
+ .govuk-input--width-4 {
88
+ max-width: 9ex;
89
+ }
90
+
91
+ .govuk-input--width-3 {
92
+ max-width: 7.2ex;
93
+ }
94
+
95
+ .govuk-input--width-2 {
96
+ max-width: 5.4ex;
97
+ }
98
+
99
+ }