govuk_tech_docs 3.4.0 → 3.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/lib/assets/stylesheets/_govuk_tech_docs.scss +13 -0
  4. data/lib/govuk_tech_docs/version.rb +1 -1
  5. data/lib/source/favicon.ico +0 -0
  6. data/lib/source/layouts/_header.erb +13 -15
  7. data/node_modules/govuk-frontend/govuk/all-ie8.scss +8 -0
  8. data/node_modules/govuk-frontend/govuk/all.js +4918 -3796
  9. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +54 -49
  10. data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js +17 -0
  11. data/node_modules/govuk-frontend/govuk/common/index.js +172 -152
  12. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +334 -321
  13. data/node_modules/govuk-frontend/govuk/common.js +171 -151
  14. data/node_modules/govuk-frontend/govuk/components/_all.scss +3 -2
  15. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +26 -7
  16. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +2203 -1650
  17. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +24 -16
  18. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +34 -11
  19. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +49 -9
  20. data/node_modules/govuk-frontend/govuk/components/button/button.js +961 -916
  21. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +2142 -2038
  22. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +6 -6
  23. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +1204 -1145
  24. data/node_modules/govuk-frontend/govuk/components/details/details.js +826 -799
  25. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +1097 -1044
  26. data/node_modules/govuk-frontend/govuk/components/exit-this-page/_exit-this-page.scss +2 -0
  27. data/node_modules/govuk-frontend/govuk/components/exit-this-page/_index.scss +97 -0
  28. data/node_modules/govuk-frontend/govuk/components/exit-this-page/exit-this-page.js +2120 -0
  29. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +6 -1
  30. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -7
  31. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +6 -0
  32. data/node_modules/govuk-frontend/govuk/components/header/header.js +683 -1003
  33. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +15 -3
  34. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +786 -751
  35. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +5 -5
  36. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +1151 -1105
  37. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +7 -1
  38. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1045 -1014
  39. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +107 -0
  40. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +1514 -1268
  41. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +18 -18
  42. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +8 -1
  43. data/node_modules/govuk-frontend/govuk/core/_all.scss +1 -0
  44. data/node_modules/govuk-frontend/govuk/core/_govuk-frontend-version.scss +5 -0
  45. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +5 -2
  46. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
  47. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +1 -1
  48. data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +12 -0
  49. data/node_modules/govuk-frontend/govuk/i18n.js +371 -364
  50. data/node_modules/govuk-frontend/govuk/objects/_template.scss +20 -0
  51. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +1 -1
  52. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +4 -0
  53. data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +16 -0
  54. data/node_modules/govuk-frontend/govuk/settings/_links.scss +5 -1
  55. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +5 -5
  56. data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +38 -2
  57. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +243 -241
  58. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +14 -12
  59. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +18 -16
  60. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +553 -545
  61. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +40 -36
  62. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +257 -250
  63. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +22 -20
  64. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +204 -197
  65. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +204 -197
  66. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +109 -105
  67. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +407 -399
  68. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +242 -238
  69. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +73 -71
  70. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +15 -13
  71. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +18 -16
  72. data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +1 -0
  73. data/package-lock.json +7 -7
  74. data/package.json +1 -1
  75. metadata +8 -3
@@ -1,16 +1,19 @@
1
1
  @include govuk-exports("govuk/component/back-link") {
2
+ // Component font-size on the Frontend (used for calculations)
3
+ $font-size: 16;
2
4
 
3
5
  // Size of chevron (excluding border)
4
- $chevron-size: 7px;
6
+ $chevron-size: govuk-em(7px, $font-size);
5
7
 
6
8
  // Size of chevron border
7
- $chevron-border-width: 1px;
9
+ $chevron-border-min-width: 1px;
10
+ $chevron-border-width: govuk-em($chevron-border-min-width, $font-size);
8
11
 
9
12
  // Colour of chevron
10
13
  $chevron-border-colour: $govuk-secondary-text-colour;
11
14
 
12
15
  .govuk-back-link {
13
- @include govuk-typography-responsive($size: 16);
16
+ @include govuk-typography-responsive($size: $font-size);
14
17
  @include govuk-link-common;
15
18
  @include govuk-link-style-text;
16
19
 
@@ -21,7 +24,7 @@
21
24
  margin-bottom: govuk-spacing(3);
22
25
 
23
26
  // Allow space for the arrow
24
- padding-left: 14px;
27
+ padding-left: govuk-em(14px, $font-size);
25
28
  }
26
29
 
27
30
  // Prepend left pointing chevron
@@ -35,14 +38,15 @@
35
38
  @if $govuk-use-legacy-font {
36
39
  // Begin adjustments for font baseline offset
37
40
  // These should be removed when legacy font support is dropped
38
- top: -1px;
39
- bottom: 1px;
41
+ $offset: govuk-em(1px, $font-size);
42
+ top: $offset * -1;
43
+ bottom: $offset;
40
44
  } @else {
41
45
  top: 0;
42
46
  bottom: 0;
43
47
  }
44
48
 
45
- left: 3px;
49
+ left: govuk-em(3px, $font-size);
46
50
 
47
51
  width: $chevron-size;
48
52
  height: $chevron-size;
@@ -56,11 +60,18 @@
56
60
  transform: rotate(225deg);
57
61
 
58
62
  border: solid;
59
- border-width: $chevron-border-width $chevron-border-width 0 0;
63
+ border-width: $chevron-border-min-width $chevron-border-min-width 0 0;
60
64
  border-color: $chevron-border-colour;
61
65
 
66
+ @supports (border-width: unquote("max(0px)")) {
67
+ border-width: unquote("max(#{$chevron-border-min-width}, #{$chevron-border-width}) max(#{$chevron-border-min-width}, #{$chevron-border-width})") 0 0;
68
+
69
+ // Ensure that the chevron never gets smaller than 16px
70
+ font-size: unquote("max(#{$font-size * 1px}, 1em)");
71
+ }
72
+
62
73
  // Fall back to a less than sign for IE8
63
- @include govuk-if-ie8 {
74
+ @include _govuk-if-ie8 {
64
75
  content: "\003c"; // Less than sign (<)
65
76
  width: auto;
66
77
  height: auto;
@@ -86,14 +97,11 @@
86
97
  left: 0;
87
98
  }
88
99
 
89
- @if $govuk-use-legacy-font {
90
- // Begin adjustments for font baseline offset
91
- // These should be removed when legacy font support is dropped
92
- .govuk-back-link:before {
93
- $offset: 1px;
100
+ .govuk-back-link--inverse {
101
+ @include govuk-link-style-inverse;
94
102
 
95
- top: $offset * -1;
96
- bottom: $offset;
103
+ &:before {
104
+ border-color: currentcolor;
97
105
  }
98
106
  }
99
107
  }
@@ -1,10 +1,13 @@
1
1
  @include govuk-exports("govuk/component/breadcrumbs") {
2
+ // Component font-size on the Frontend (used for calculations)
3
+ $font-size: 16;
2
4
 
3
5
  // Size of chevron (excluding border)
4
- $chevron-size: 7px;
6
+ $chevron-size: govuk-em(7px, $font-size);
5
7
 
6
8
  // Size of chevron border
7
- $chevron-border-width: 1px;
9
+ $chevron-border-min-width: 1px;
10
+ $chevron-border-width: govuk-em($chevron-border-min-width, $font-size);
8
11
 
9
12
  // Colour of chevron
10
13
  $chevron-border-colour: $govuk-secondary-text-colour;
@@ -13,10 +16,10 @@
13
16
  // of length 8 (7px + 1px border):
14
17
  //
15
18
  // √(8² + 8²) * 0.5 ≅ 5.655
16
- $chevron-altitude-calculated: 5.655px;
19
+ $chevron-altitude-calculated: govuk-em(5.655px, $font-size);
17
20
 
18
21
  .govuk-breadcrumbs {
19
- @include govuk-font($size: 16);
22
+ @include govuk-font($size: $font-size);
20
23
  @include govuk-text-colour;
21
24
 
22
25
  margin-top: govuk-spacing(3);
@@ -40,8 +43,8 @@
40
43
 
41
44
  // Add both margin and padding such that the chevron appears centrally
42
45
  // between each breadcrumb item
43
- margin-left: govuk-spacing(2);
44
- padding-left: govuk-spacing(2) + $chevron-altitude-calculated;
46
+ margin-left: govuk-em(govuk-spacing(2), $font-size);
47
+ padding-left: govuk-em(govuk-spacing(2), $font-size) + $chevron-altitude-calculated;
45
48
 
46
49
  float: left;
47
50
 
@@ -55,8 +58,9 @@
55
58
  @if $govuk-use-legacy-font {
56
59
  // Begin adjustments for font baseline offset
57
60
  // These should be removed when legacy font support is dropped
58
- top: -1px;
59
- bottom: 1px;
61
+ $offset: govuk-em(1px, $font-size);
62
+ top: $offset * -1;
63
+ bottom: $offset;
60
64
  } @else {
61
65
  top: 0;
62
66
  bottom: 0;
@@ -78,11 +82,18 @@
78
82
  transform: rotate(45deg);
79
83
 
80
84
  border: solid;
81
- border-width: $chevron-border-width $chevron-border-width 0 0;
85
+ border-width: $chevron-border-min-width $chevron-border-min-width 0 0;
82
86
  border-color: $chevron-border-colour;
83
87
 
88
+ @supports (border-width: unquote("max(0px)")) {
89
+ border-width: unquote("max(#{$chevron-border-min-width}, #{$chevron-border-width}) max(#{$chevron-border-min-width}, #{$chevron-border-width})") 0 0;
90
+
91
+ // Ensure that the chevron never gets smaller than 16px
92
+ font-size: unquote("max(#{$font-size * 1px}, 1em)");
93
+ }
94
+
84
95
  // Fall back to a greater than sign for IE8
85
- @include govuk-if-ie8 {
96
+ @include _govuk-if-ie8 {
86
97
  content: "\003e"; // Greater than sign (>)
87
98
  width: auto;
88
99
  height: auto;
@@ -122,7 +133,7 @@
122
133
  }
123
134
 
124
135
  &:before {
125
- top: 6px;
136
+ top: govuk-em(6px, $font-size);
126
137
  margin: 0;
127
138
  }
128
139
  }
@@ -133,4 +144,16 @@
133
144
  }
134
145
  }
135
146
  }
147
+
148
+ .govuk-breadcrumbs--inverse {
149
+ color: govuk-colour("white");
150
+
151
+ .govuk-breadcrumbs__link {
152
+ @include govuk-link-style-inverse;
153
+ }
154
+
155
+ .govuk-breadcrumbs__list-item:before {
156
+ border-color: currentcolor;
157
+ }
158
+ }
136
159
  }
@@ -18,21 +18,27 @@ $govuk-button-text-colour: govuk-colour("white") !default;
18
18
 
19
19
  @include govuk-exports("govuk/component/button") {
20
20
  $govuk-button-colour: $govuk-button-background-colour;
21
+ $govuk-button-text-colour: $govuk-button-text-colour;
21
22
  $govuk-button-hover-colour: govuk-shade($govuk-button-colour, 20%);
22
23
  $govuk-button-shadow-colour: govuk-shade($govuk-button-colour, 60%);
23
- $govuk-button-text-colour: $govuk-button-text-colour;
24
24
 
25
25
  // Secondary button variables
26
26
  $govuk-secondary-button-colour: govuk-colour("light-grey", $legacy: "grey-3");
27
+ $govuk-secondary-button-text-colour: govuk-colour("black");
27
28
  $govuk-secondary-button-hover-colour: govuk-shade($govuk-secondary-button-colour, 10%);
28
29
  $govuk-secondary-button-shadow-colour: govuk-shade($govuk-secondary-button-colour, 40%);
29
- $govuk-secondary-button-text-colour: govuk-colour("black");
30
30
 
31
31
  // Warning button variables
32
32
  $govuk-warning-button-colour: govuk-colour("red");
33
+ $govuk-warning-button-text-colour: govuk-colour("white");
33
34
  $govuk-warning-button-hover-colour: govuk-shade($govuk-warning-button-colour, 20%);
34
35
  $govuk-warning-button-shadow-colour: govuk-shade($govuk-warning-button-colour, 60%);
35
- $govuk-warning-button-text-colour: govuk-colour("white");
36
+
37
+ // Inverse button variables
38
+ $govuk-inverse-button-colour: govuk-colour("white");
39
+ $govuk-inverse-button-text-colour: govuk-colour("blue");
40
+ $govuk-inverse-button-hover-colour: govuk-tint($govuk-inverse-button-text-colour, 90%);
41
+ $govuk-inverse-button-shadow-colour: govuk-shade($govuk-inverse-button-text-colour, 30%);
36
42
 
37
43
  // Because the shadow (s0) is visually 'part of' the button, we need to reduce
38
44
  // the height of the button to compensate by adjusting its padding (s1) and
@@ -61,7 +67,7 @@ $govuk-button-text-colour: govuk-colour("white") !default;
61
67
  cursor: pointer;
62
68
  -webkit-appearance: none;
63
69
 
64
- @include govuk-if-ie8 {
70
+ @include _govuk-if-ie8 {
65
71
  border-bottom: $button-shadow-size solid $govuk-button-shadow-colour;
66
72
  }
67
73
 
@@ -92,7 +98,7 @@ $govuk-button-text-colour: govuk-colour("white") !default;
92
98
  // Bump the button down so it looks like its being pressed in
93
99
  top: $button-shadow-size;
94
100
 
95
- @include govuk-if-ie8 {
101
+ @include _govuk-if-ie8 {
96
102
  border-bottom-width: 0;
97
103
  }
98
104
  }
@@ -103,11 +109,11 @@ $govuk-button-text-colour: govuk-colour("white") !default;
103
109
  // backgrounds and box-shadows disappear, so we need to ensure there's a
104
110
  // transparent outline which will be set to a visible colour.
105
111
  // Since Internet Explorer 8 does not support box-shadow, we want to force the user-agent outlines
106
- @include govuk-not-ie8 {
112
+ @include _govuk-not-ie8 {
107
113
  outline: $govuk-focus-width solid transparent;
108
114
  }
109
115
  // Since Internet Explorer does not support `:not()` we set a clearer focus style to match user-agent outlines.
110
- @include govuk-if-ie8 {
116
+ @include _govuk-if-ie8 {
111
117
  color: $govuk-focus-text-colour;
112
118
  background-color: $govuk-focus-colour;
113
119
  }
@@ -166,6 +172,8 @@ $govuk-button-text-colour: govuk-colour("white") !default;
166
172
  }
167
173
  }
168
174
 
175
+ // @deprecated Disabling buttons using the .govuk-button--disabled class is
176
+ // deprecated and will be removed in the next major version.
169
177
  .govuk-button--disabled,
170
178
  .govuk-button[disabled="disabled"],
171
179
  .govuk-button[disabled] {
@@ -173,13 +181,13 @@ $govuk-button-text-colour: govuk-colour("white") !default;
173
181
 
174
182
  &:hover {
175
183
  background-color: $govuk-button-colour;
176
- cursor: default;
184
+ cursor: not-allowed;
177
185
  }
178
186
 
179
187
  &:active {
180
188
  top: 0;
181
189
  box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
182
- @include govuk-if-ie8 {
190
+ @include _govuk-if-ie8 {
183
191
  border-bottom: $button-shadow-size solid $govuk-button-shadow-colour; // s0
184
192
  }
185
193
  }
@@ -249,6 +257,38 @@ $govuk-button-text-colour: govuk-colour("white") !default;
249
257
  }
250
258
  }
251
259
 
260
+ .govuk-button--inverse {
261
+ background-color: $govuk-inverse-button-colour;
262
+ box-shadow: 0 $button-shadow-size 0 $govuk-inverse-button-shadow-colour;
263
+
264
+ &,
265
+ &:link,
266
+ &:visited,
267
+ &:active,
268
+ &:hover {
269
+ color: $govuk-inverse-button-text-colour;
270
+ }
271
+
272
+ // alphagov/govuk_template includes a specific a:link:focus selector
273
+ // designed to make unvisited links a slightly darker blue when focussed, so
274
+ // we need to override the text colour for that combination of selectors so
275
+ // so that unvisited links styled as buttons do not end up with dark blue
276
+ // text when focussed.
277
+ @include _govuk-compatibility(govuk_template) {
278
+ &:link:focus {
279
+ color: $govuk-inverse-button-text-colour;
280
+ }
281
+ }
282
+
283
+ &:hover {
284
+ background-color: $govuk-inverse-button-hover-colour;
285
+
286
+ &[disabled] {
287
+ background-color: $govuk-inverse-button-colour;
288
+ }
289
+ }
290
+ }
291
+
252
292
  .govuk-button--start {
253
293
  @include govuk-typography-weight-bold;
254
294
  @include govuk-typography-responsive($size: 24, $override-line-height: 1);