dxw_govuk_frontend_rails 4.0.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  4. data/package-lock.json +4 -4
  5. data/package.json +1 -1
  6. data/vendor/assets/javascripts/govuk_frontend_rails.js +4537 -2583
  7. data/vendor/assets/stylesheets/all-ie8.scss +8 -0
  8. data/vendor/assets/stylesheets/components/_all.scss +2 -1
  9. data/vendor/assets/stylesheets/components/accordion/_index.scss +30 -12
  10. data/vendor/assets/stylesheets/components/back-link/_index.scss +20 -20
  11. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +22 -13
  12. data/vendor/assets/stylesheets/components/button/_index.scss +37 -27
  13. data/vendor/assets/stylesheets/components/character-count/_index.scss +9 -0
  14. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +9 -8
  15. data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -1
  16. data/vendor/assets/stylesheets/components/footer/_index.scss +13 -30
  17. data/vendor/assets/stylesheets/components/header/_index.scss +36 -24
  18. data/vendor/assets/stylesheets/components/input/_index.scss +28 -26
  19. data/vendor/assets/stylesheets/components/pagination/_index.scss +247 -0
  20. data/vendor/assets/stylesheets/components/pagination/_pagination.scss +2 -0
  21. data/vendor/assets/stylesheets/components/panel/_index.scss +1 -1
  22. data/vendor/assets/stylesheets/components/radios/_index.scss +10 -17
  23. data/vendor/assets/stylesheets/components/select/_index.scss +18 -1
  24. data/vendor/assets/stylesheets/components/skip-link/_index.scss +1 -3
  25. data/vendor/assets/stylesheets/components/summary-list/_index.scss +152 -13
  26. data/vendor/assets/stylesheets/components/table/_index.scss +1 -1
  27. data/vendor/assets/stylesheets/components/tag/_index.scss +18 -18
  28. data/vendor/assets/stylesheets/components/textarea/_index.scss +8 -1
  29. data/vendor/assets/stylesheets/core/_all.scss +1 -0
  30. data/vendor/assets/stylesheets/core/_govuk-frontend-version.scss +5 -0
  31. data/vendor/assets/stylesheets/core/_section-break.scss +1 -1
  32. data/vendor/assets/stylesheets/helpers/_colour.scss +10 -7
  33. data/vendor/assets/stylesheets/helpers/_focused.scss +6 -1
  34. data/vendor/assets/stylesheets/helpers/_font-faces.scss +1 -1
  35. data/vendor/assets/stylesheets/helpers/_links.scss +13 -11
  36. data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -2
  37. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  38. data/vendor/assets/stylesheets/helpers/_spacing.scss +3 -3
  39. data/vendor/assets/stylesheets/helpers/_typography.scss +16 -9
  40. data/vendor/assets/stylesheets/objects/_button-group.scss +10 -26
  41. data/vendor/assets/stylesheets/objects/_template.scss +1 -1
  42. data/vendor/assets/stylesheets/objects/_width-container.scss +1 -5
  43. data/vendor/assets/stylesheets/overrides/_spacing.scss +56 -12
  44. data/vendor/assets/stylesheets/settings/_all.scss +1 -0
  45. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +4 -0
  46. data/vendor/assets/stylesheets/settings/_colours-palette.scss +12 -0
  47. data/vendor/assets/stylesheets/settings/_compatibility.scss +26 -0
  48. data/vendor/assets/stylesheets/settings/_ie8.scss +16 -0
  49. data/vendor/assets/stylesheets/settings/_links.scss +5 -1
  50. data/vendor/assets/stylesheets/settings/_measurements.scss +5 -5
  51. data/vendor/assets/stylesheets/settings/_spacing.scss +4 -8
  52. data/vendor/assets/stylesheets/settings/_typography-font.scss +23 -0
  53. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -0
  54. data/vendor/assets/stylesheets/settings/_warnings.scss +53 -0
  55. data/vendor/assets/stylesheets/tools/_compatibility.scss +20 -6
  56. data/vendor/assets/stylesheets/tools/_exports.scss +1 -1
  57. data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
  58. data/vendor/assets/stylesheets/tools/_ie8.scss +38 -2
  59. data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
  60. data/vendor/assets/stylesheets/tools/_px-to-em.scss +2 -2
  61. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
  62. metadata +5 -1
@@ -58,7 +58,7 @@
58
58
  position: relative;
59
59
  top: -1px;
60
60
  margin-right: 1px;
61
- fill: currentColor;
61
+ fill: currentcolor;
62
62
  vertical-align: top;
63
63
  }
64
64
 
@@ -91,7 +91,7 @@
91
91
  text-decoration: underline;
92
92
  text-decoration-thickness: $govuk-header-link-underline-thickness;
93
93
 
94
- @if ($govuk-link-underline-offset) {
94
+ @if $govuk-link-underline-offset {
95
95
  text-underline-offset: $govuk-link-underline-offset;
96
96
  }
97
97
  }
@@ -111,6 +111,16 @@
111
111
  font-size: 30px; // We don't have a mixin that produces 30px font size
112
112
  line-height: 1;
113
113
 
114
+ @include govuk-media-query($from: tablet) {
115
+ display: inline;
116
+
117
+ &:focus {
118
+ // Replicate the focus box shadow but without the -2px y-offset of the first yellow shadow
119
+ // This is to stop the logo getting cut off by the box shadow when focused on above a product name
120
+ box-shadow: 0 0 $govuk-focus-colour;
121
+ }
122
+ }
123
+
114
124
  &:link,
115
125
  &:visited {
116
126
  text-decoration: none;
@@ -132,6 +142,9 @@
132
142
  }
133
143
  }
134
144
 
145
+ // The govuk-header__link--service-name class is deprecated - use
146
+ // govuk-header__service-name instead.
147
+ .govuk-header__service-name,
135
148
  .govuk-header__link--service-name {
136
149
  display: inline-block;
137
150
  margin-bottom: govuk-spacing(2);
@@ -180,7 +193,7 @@
180
193
  -webkit-text-decoration: solid underline $govuk-header-link-underline-thickness;
181
194
  text-decoration: solid underline $govuk-header-link-underline-thickness;
182
195
 
183
- @if ($govuk-link-underline-offset) {
196
+ @if $govuk-link-underline-offset {
184
197
  text-underline-offset: $govuk-link-underline-offset;
185
198
  }
186
199
  }
@@ -195,14 +208,21 @@
195
208
  margin-left: govuk-spacing(1);
196
209
  }
197
210
 
211
+ &[aria-expanded="true"]:after {
212
+ @include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
213
+ }
214
+
198
215
  @include govuk-media-query ($from: tablet) {
199
216
  top: govuk-spacing(3);
200
217
  }
201
- }
202
218
 
203
- .govuk-header__menu-button--open {
204
- &:after {
205
- @include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
219
+ .js-enabled & {
220
+ display: block;
221
+ }
222
+
223
+ &[hidden],
224
+ .js-enabled &[hidden] {
225
+ display: none;
206
226
  }
207
227
  }
208
228
 
@@ -217,25 +237,9 @@
217
237
  margin: 0;
218
238
  padding: 0;
219
239
  list-style: none;
220
- }
221
-
222
- .js-enabled {
223
- .govuk-header__menu-button {
224
- display: block;
225
- @include govuk-media-query ($from: desktop) {
226
- display: none;
227
- }
228
- }
229
240
 
230
- .govuk-header__navigation-list {
241
+ &[hidden] {
231
242
  display: none;
232
- @include govuk-media-query ($from: desktop) {
233
- display: block;
234
- }
235
- }
236
-
237
- .govuk-header__navigation-list--open {
238
- display: block;
239
243
  }
240
244
  }
241
245
 
@@ -247,6 +251,8 @@
247
251
  }
248
252
  }
249
253
 
254
+ // The govuk-header__navigation--no-service-name class is deprecated and will
255
+ // be removed in the next major release.
250
256
  .govuk-header__navigation--no-service-name {
251
257
  padding-top: govuk-spacing(7);
252
258
  }
@@ -276,6 +282,12 @@
276
282
  color: $govuk-header-link-active;
277
283
  }
278
284
 
285
+ // When printing, use the normal blue as this contrasts better with the
286
+ // white printing header
287
+ @include govuk-media-query($media-type: print) {
288
+ color: $govuk-brand-colour;
289
+ }
290
+
279
291
  // When focussed, the text colour needs to be darker to ensure that colour
280
292
  // contrast is still acceptable
281
293
  &:focus {
@@ -22,7 +22,6 @@
22
22
 
23
23
  // Disable inner shadow and remove rounded corners
24
24
  -webkit-appearance: none;
25
- -moz-appearance: none;
26
25
  appearance: none;
27
26
 
28
27
  &:focus {
@@ -35,12 +34,19 @@
35
34
  // here as it is already used for the yellow focus state.
36
35
  box-shadow: inset 0 0 0 $govuk-border-width-form-element;
37
36
 
38
- @include govuk-if-ie8 {
37
+ @include _govuk-if-ie8 {
39
38
  // IE8 doesn't support `box-shadow` so double the border with
40
39
  // `border-width`.
41
40
  border-width: $govuk-border-width-form-element * 2;
42
41
  }
43
42
  }
43
+
44
+ &:disabled {
45
+ opacity: .5;
46
+ color: inherit;
47
+ background-color: transparent;
48
+ cursor: not-allowed;
49
+ }
44
50
  }
45
51
 
46
52
  .govuk-input::-webkit-outer-spin-button,
@@ -61,49 +67,49 @@
61
67
  }
62
68
  }
63
69
 
64
- // The ex measurements are based on the number of W's that can fit inside the input
65
- // Extra space is left on the right hand side to allow for the Safari prefill icon
66
- // Linear regression estimation based on visual tests: y = 1.76 + 1.81x
70
+ .govuk-input--extra-letter-spacing {
71
+ @include govuk-font(false, $tabular: true);
72
+ letter-spacing: .05em;
73
+ }
74
+
75
+ // em measurements are based on the point size of the typeface
76
+ // Extra space is added on the right hand side to allow for the Safari prefill icon
67
77
 
68
78
  .govuk-input--width-30 {
69
- max-width: 56ex + 3ex;
79
+ max-width: 29.5em;
70
80
  }
71
81
 
72
82
  .govuk-input--width-20 {
73
- max-width: 38ex + 3ex;
83
+ max-width: 20.5em;
74
84
  }
75
85
 
76
86
  .govuk-input--width-10 {
77
- max-width: 20ex + 3ex;
87
+ max-width: 11.5em;
78
88
  }
79
89
 
80
90
  .govuk-input--width-5 {
81
- max-width: 10.8ex;
91
+ max-width: 5.5em;
82
92
  }
83
93
 
84
94
  .govuk-input--width-4 {
85
- max-width: 9ex;
95
+ max-width: 4.5em;
86
96
  }
87
97
 
88
98
  .govuk-input--width-3 {
89
- max-width: 7.2ex;
99
+ max-width: 3.75em;
90
100
  }
91
101
 
92
102
  .govuk-input--width-2 {
93
- max-width: 5.4ex;
103
+ max-width: 2.75em;
94
104
  }
95
105
 
96
106
  .govuk-input__wrapper {
97
- display: -webkit-box;
98
- display: -webkit-flex;
99
107
  display: -ms-flexbox;
100
108
  display: flex;
101
109
 
102
110
  .govuk-input {
103
- -webkit-box-flex: 0;
104
- -webkit-flex: 0 1 auto;
105
- -ms-flex: 0 1 auto;
106
- flex: 0 1 auto;
111
+ -ms-flex: 0 1 auto;
112
+ flex: 0 1 auto;
107
113
  }
108
114
 
109
115
  .govuk-input:focus {
@@ -150,13 +156,9 @@
150
156
  // Emphasise non-editable status of prefixes and suffixes
151
157
  cursor: default;
152
158
 
153
- -webkit-box-flex: 0;
154
-
155
- -webkit-flex: 0 0 auto;
156
-
157
- -ms-flex: 0 0 auto;
159
+ -ms-flex: 0 0 auto;
158
160
 
159
- flex: 0 0 auto;
161
+ flex: 0 0 auto;
160
162
 
161
163
  // Split prefix/suffix onto separate lines on narrow screens
162
164
  @include govuk-media-query($until: mobile) {
@@ -171,7 +173,7 @@
171
173
  border-bottom: 0;
172
174
  }
173
175
  @include govuk-media-query($from: mobile) {
174
- @include govuk-not-ie8 {
176
+ @include _govuk-not-ie8 {
175
177
  border-right: 0;
176
178
  }
177
179
  }
@@ -183,7 +185,7 @@
183
185
  border-top: 0;
184
186
  }
185
187
  @include govuk-media-query($from: mobile) {
186
- @include govuk-not-ie8 {
188
+ @include _govuk-not-ie8 {
187
189
  border-left: 0;
188
190
  }
189
191
  }
@@ -0,0 +1,247 @@
1
+ @include govuk-exports("govuk/component/pagination") {
2
+ // Flexbox enhancement for small screen visual design
3
+ // Falls back to a float: left layout on non-flex browsers
4
+ .govuk-pagination {
5
+ @include govuk-responsive-margin(6, "bottom");
6
+ display: -ms-flexbox;
7
+ display: flex;
8
+ -ms-flex-direction: column;
9
+ flex-direction: column;
10
+ -ms-flex-align: center;
11
+ align-items: center;
12
+ -ms-flex-wrap: wrap;
13
+ flex-wrap: wrap;
14
+
15
+ @include govuk-media-query($from: tablet) {
16
+ -ms-flex-direction: row;
17
+ flex-direction: row;
18
+ -ms-flex-align: start;
19
+ align-items: flex-start;
20
+ }
21
+ }
22
+
23
+ .govuk-pagination__list {
24
+ margin: 0;
25
+ padding: 0;
26
+ list-style: none;
27
+ }
28
+
29
+ .govuk-pagination__item,
30
+ .govuk-pagination__next,
31
+ .govuk-pagination__prev {
32
+ @include govuk-font(19);
33
+ box-sizing: border-box;
34
+ position: relative;
35
+ min-width: 45px;
36
+ min-height: 45px;
37
+ padding: govuk-spacing(2) govuk-spacing(3);
38
+ float: left; // Float is ignored if flex is active for prev/next links
39
+
40
+ &:hover {
41
+ background-color: govuk-colour("light-grey", $legacy: "grey-4");
42
+ }
43
+ }
44
+
45
+ .govuk-pagination__item {
46
+ // Hide items on small screens except the prev/next items,
47
+ // non-link items and the first and last items
48
+ display: none;
49
+
50
+ // Center align pagination links in their parent list item so that they
51
+ // visually sit in the middle of their touch area
52
+ text-align: center;
53
+
54
+ @include govuk-media-query($from: tablet) {
55
+ display: block;
56
+ }
57
+ }
58
+
59
+ .govuk-pagination__prev,
60
+ .govuk-pagination__next {
61
+ @include govuk-typography-weight-bold;
62
+
63
+ // Use flex to get around a whitespace issue between the arrow svg and the link text
64
+ // without having to rely on whitespace control from backend tooling
65
+ .govuk-pagination__link {
66
+ display: -ms-flexbox;
67
+ display: flex;
68
+ -ms-flex-align: center;
69
+ align-items: center;
70
+ }
71
+ }
72
+
73
+ .govuk-pagination__prev {
74
+ padding-left: 0;
75
+ }
76
+
77
+ .govuk-pagination__next {
78
+ padding-right: 0;
79
+ }
80
+
81
+ // Only show first, last and non-link items on mobile
82
+ .govuk-pagination__item--current,
83
+ .govuk-pagination__item--ellipses,
84
+ .govuk-pagination__item:first-child,
85
+ .govuk-pagination__item:last-child {
86
+ display: block;
87
+ }
88
+
89
+ .govuk-pagination__item--current {
90
+ @include govuk-typography-weight-bold;
91
+ outline: 1px solid transparent;
92
+ background-color: $govuk-link-colour;
93
+
94
+ &:hover {
95
+ background-color: $govuk-link-colour;
96
+ }
97
+
98
+ .govuk-pagination__link {
99
+ @include govuk-link-style-inverse;
100
+ }
101
+ }
102
+
103
+ .govuk-pagination__item--ellipses {
104
+ @include govuk-typography-weight-bold;
105
+ color: $govuk-secondary-text-colour;
106
+
107
+ // Remove hover state for ellipsis items as they don't have links within them
108
+ &:hover {
109
+ background-color: transparent;
110
+ }
111
+ }
112
+
113
+ .govuk-pagination__link {
114
+ display: block;
115
+ min-width: govuk-spacing(3);
116
+
117
+ // Increase the touch area for the link to the parent element.
118
+ @media screen {
119
+ &:after {
120
+ content: "";
121
+ position: absolute;
122
+ top: 0;
123
+ right: 0;
124
+ bottom: 0;
125
+ left: 0;
126
+ }
127
+ }
128
+
129
+ // Add link hover decoration to prev/next text if no label present on prev/next only mode
130
+ // We do this so that we have a hover state in all possible instances
131
+ &:hover,
132
+ &:active {
133
+ .govuk-pagination__link-title--decorated {
134
+ @include govuk-link-decoration;
135
+ }
136
+
137
+ .govuk-pagination__link-label,
138
+ .govuk-pagination__link-title--decorated {
139
+ @include govuk-link-hover-decoration;
140
+ }
141
+ }
142
+
143
+ &:focus {
144
+ .govuk-pagination__icon {
145
+ color: $govuk-focus-text-colour;
146
+ }
147
+
148
+ .govuk-pagination__link-label {
149
+ text-decoration: none;
150
+ }
151
+
152
+ .govuk-pagination__link-title--decorated {
153
+ text-decoration: none;
154
+ }
155
+ }
156
+ }
157
+
158
+ .govuk-pagination__link-label {
159
+ @include govuk-font($size: 19, $weight: "regular");
160
+ @include govuk-link-decoration;
161
+ display: inline-block;
162
+ padding-left: govuk-spacing(6);
163
+ }
164
+
165
+ .govuk-pagination__icon {
166
+ // Set size using rems to make the icon scale with text if user resizes text in their browser
167
+ width: govuk-px-to-rem(15px);
168
+ height: govuk-px-to-rem(13px);
169
+ color: $govuk-secondary-text-colour;
170
+ fill: currentcolor;
171
+ forced-color-adjust: auto;
172
+ }
173
+
174
+ .govuk-pagination__icon--prev {
175
+ margin-right: govuk-spacing(3);
176
+ }
177
+
178
+ .govuk-pagination__icon--next {
179
+ margin-left: govuk-spacing(3);
180
+ }
181
+
182
+ // Block mode - position previous and next links above and below numbers
183
+ .govuk-pagination--block {
184
+ display: block;
185
+
186
+ .govuk-pagination__item {
187
+ padding: govuk-spacing(3);
188
+ float: none;
189
+ }
190
+
191
+ .govuk-pagination__next,
192
+ .govuk-pagination__prev {
193
+ padding-left: 0;
194
+ float: none;
195
+ }
196
+
197
+ .govuk-pagination__next {
198
+ padding-right: govuk-spacing(3);
199
+
200
+ .govuk-pagination__icon {
201
+ margin-left: 0;
202
+ }
203
+ }
204
+
205
+ // Only apply a border between prev and next if both are present
206
+ .govuk-pagination__prev + .govuk-pagination__next {
207
+ border-top: 1px solid $govuk-border-colour;
208
+ }
209
+
210
+ // Reset both these elements to their inline default, both to ensure that the focus state
211
+ // for block mode "shrink wraps" text as expected
212
+ .govuk-pagination__link,
213
+ .govuk-pagination__link-title {
214
+ display: inline;
215
+ }
216
+
217
+ // Set the after pseudo element to a block which makes the title visually display
218
+ // as block level whilst programmatically being inline
219
+ // We do this to get around an NVDA quirk where adjacent block level
220
+ // elements are always read out separately
221
+ .govuk-pagination__link-title:after {
222
+ content: "";
223
+ display: block;
224
+ }
225
+
226
+ .govuk-pagination__link {
227
+ text-align: left;
228
+
229
+ &:focus {
230
+ // apply focus styling to the label within the link as if it were being focused
231
+ // to get around a display issue with a focusable inline element containing a mixture
232
+ // of inline and inline-block level elements
233
+ .govuk-pagination__link-label {
234
+ @include govuk-focused-text;
235
+ }
236
+ }
237
+
238
+ &:not(:focus) {
239
+ text-decoration: none;
240
+ }
241
+ }
242
+
243
+ .govuk-pagination__icon {
244
+ margin-right: govuk-spacing(2);
245
+ }
246
+ }
247
+ }
@@ -0,0 +1,2 @@
1
+ @import "../../base";
2
+ @import "./index";
@@ -33,7 +33,7 @@
33
33
  background: govuk-colour("green", $legacy: "turquoise");
34
34
 
35
35
  @include govuk-media-query($media-type: print) {
36
- border-color: currentColor;
36
+ border-color: currentcolor;
37
37
  color: $govuk-print-text-colour;
38
38
  background: none;
39
39
  }
@@ -39,7 +39,7 @@
39
39
 
40
40
  // IE8 doesn’t support pseudo-elements, so we don’t want to hide native
41
41
  // elements there.
42
- @include govuk-not-ie8 {
42
+ @include _govuk-not-ie8 {
43
43
  position: absolute;
44
44
 
45
45
  z-index: 1;
@@ -53,7 +53,7 @@
53
53
  opacity: 0;
54
54
  }
55
55
 
56
- @include govuk-if-ie8 {
56
+ @include _govuk-if-ie8 {
57
57
  margin-top: 10px;
58
58
  margin-right: $govuk-radios-size / -2;
59
59
  margin-left: $govuk-radios-size / -2;
@@ -87,7 +87,7 @@
87
87
  width: $govuk-radios-size;
88
88
  height: $govuk-radios-size;
89
89
 
90
- border: $govuk-border-width-form-element solid currentColor;
90
+ border: $govuk-border-width-form-element solid currentcolor;
91
91
  border-radius: 50%;
92
92
  background: transparent;
93
93
  }
@@ -106,10 +106,10 @@
106
106
  width: 0;
107
107
  height: 0;
108
108
 
109
- border: govuk-spacing(2) solid currentColor;
109
+ border: govuk-spacing(2) solid currentcolor;
110
110
  border-radius: 50%;
111
111
  opacity: 0;
112
- background: currentColor;
112
+ background: currentcolor;
113
113
  }
114
114
 
115
115
  .govuk-radios__hint {
@@ -146,10 +146,11 @@
146
146
  // Disabled state
147
147
  .govuk-radios__input:disabled,
148
148
  .govuk-radios__input:disabled + .govuk-radios__label {
149
- cursor: default;
149
+ cursor: not-allowed;
150
150
  }
151
151
 
152
- .govuk-radios__input:disabled + .govuk-radios__label {
152
+ .govuk-radios__input:disabled + .govuk-radios__label,
153
+ .govuk-radios__input:disabled ~ .govuk-hint {
153
154
  opacity: .5;
154
155
  }
155
156
 
@@ -167,14 +168,6 @@
167
168
  clear: none;
168
169
  }
169
170
  }
170
-
171
- // Prevent inline modifier being used with conditional reveals
172
- &.govuk-radios--conditional {
173
- .govuk-radios__item {
174
- margin-right: 0;
175
- float: none;
176
- }
177
- }
178
171
  }
179
172
 
180
173
  // =========================================================
@@ -246,11 +239,11 @@
246
239
  // ▲┆└─ Radio pseudo element, aligned with margin
247
240
  // └─── Touch target (invisible input), shifted into the margin
248
241
  .govuk-radios__input {
249
- @include govuk-not-ie8 {
242
+ @include _govuk-not-ie8 {
250
243
  left: $input-offset * -1;
251
244
  }
252
245
 
253
- @include govuk-if-ie8 {
246
+ @include _govuk-if-ie8 {
254
247
  margin-left: $govuk-small-radios-size * -1;
255
248
  }
256
249
  }
@@ -7,6 +7,12 @@
7
7
  @include govuk-font($size: 19, $line-height: 1.25);
8
8
 
9
9
  box-sizing: border-box; // should this be global?
10
+
11
+ // This min-width was chosen because:
12
+ // - it makes the Select noticeably wider than it is taller (which is what users expect)
13
+ // - 11.5em matches the 'length-10' variant of the input component
14
+ // - it fits comfortably on screens as narrow as 240px wide
15
+ min-width: 11.5em;
10
16
  max-width: 100%;
11
17
  height: 40px;
12
18
  @if $govuk-typography-use-rem {
@@ -15,6 +21,11 @@
15
21
  padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
16
22
  border: $govuk-border-width-form-element solid $govuk-input-border-colour;
17
23
 
24
+ // Default user agent colours for selects can have low contrast,
25
+ // and may look disabled (#2435)
26
+ color: $govuk-text-colour;
27
+ background-color: govuk-colour("white");
28
+
18
29
  &:focus {
19
30
  outline: $govuk-focus-width solid $govuk-focus-colour;
20
31
  // Ensure outline appears outside of the element
@@ -24,12 +35,18 @@
24
35
  // since `outline` is already used for the yellow focus state.
25
36
  box-shadow: inset 0 0 0 $govuk-border-width-form-element;
26
37
 
27
- @include govuk-if-ie8 {
38
+ @include _govuk-if-ie8 {
28
39
  // IE8 doesn't support `box-shadow` so double the border with
29
40
  // `border-width`.
30
41
  border-width: $govuk-border-width-form-element * 2;
31
42
  }
32
43
  }
44
+
45
+ &:disabled {
46
+ opacity: .5;
47
+ color: inherit;
48
+ cursor: not-allowed;
49
+ }
33
50
  }
34
51
 
35
52
  .govuk-select option:active,
@@ -11,9 +11,7 @@
11
11
 
12
12
  // Respect 'display cutout' safe area (avoids notches and rounded corners)
13
13
  @supports (padding: unquote("max(calc(0px))")) {
14
- $padding-safe-area-right: -webkit-calc(#{govuk-spacing(3)} + env(safe-area-inset-right));
15
14
  $padding-safe-area-right: calc(#{govuk-spacing(3)} + env(safe-area-inset-right));
16
- $padding-safe-area-left: -webkit-calc(#{govuk-spacing(3)} + env(safe-area-inset-left));
17
15
  $padding-safe-area-left: calc(#{govuk-spacing(3)} + env(safe-area-inset-left));
18
16
 
19
17
  // Use max() to pick largest padding, default or with safe area
@@ -28,7 +26,7 @@
28
26
  background-color: $govuk-focus-colour;
29
27
 
30
28
  // Undo unwanted changes when global styles are enabled
31
- @if ($govuk-global-styles) {
29
+ @if $govuk-global-styles {
32
30
  box-shadow: none;
33
31
  }
34
32
  }