@uqds/form 0.0.7-alpha.0 → 0.0.12-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,505 +1,528 @@
1
- @use '@uqds/core/src/scss/global' as core;
2
- @use '@uqds/icon/src/scss/global' as icon;
3
- @use 'global' as *;
4
- @use 'icons' as *;
5
-
6
- $use-encapsulation: false !default;
7
-
8
- @mixin form-styles {
9
- form,
10
- fieldset,
11
- legend,
12
- label,
13
- input,
14
- select,
15
- textarea,
16
- .uq-error-summary,
17
- .uq-error-message,
18
- .uq-success-message,
19
- .uq-inline-help {
20
- box-sizing: border-box;
21
- font-family: core.$font-body;
22
- }
23
-
24
- fieldset,
25
- legend,
26
- label,
27
- input,
28
- select,
29
- textarea {
30
- &::before, &::after,
31
- *, *::before, *::after {
32
- box-sizing: border-box;
33
- }
34
- }
35
-
36
- fieldset {
37
- border: 0;
38
- padding: 0;
39
- margin: 0;
40
- }
41
-
42
- label,
43
- legend {
44
- color: $form-text-color;
45
- display: block;
46
- font-size: $form-label-size;
47
- font-weight: core.$font-weight-bold;
48
- }
49
-
50
- legend {
51
- margin-bottom: $form-spacing;
52
- line-height: core.$line-height-h;
53
- padding: 0;
54
-
55
- &.uq-legend--error {
56
- color: $form-color-error;
57
- }
58
-
59
- .uq-legend__required {
60
- color: $form-color-error;
61
- }
62
- }
63
-
64
- label {
65
- cursor: pointer;
66
- line-height: core.$line-height-ui;
67
-
68
- &.uq-label {
69
- &--inline {
70
- align-items: center;
71
- display: inline-flex;
72
- font-size: core.$font-size;
73
- line-height: core.$line-height;
74
- margin-bottom: core.$space-m;
75
-
76
- input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
77
- select,
78
- textarea,
79
- + input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
80
- + select,
81
- + textarea {
82
- max-width: none;
83
- min-width: 200px;
84
- margin-left: core.$space;
85
- margin-right: core.$space-m;
86
- width: auto;
87
- }
88
-
89
- input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
90
- select,
91
- textarea {
92
- margin-top: 0;
93
- margin-bottom: core.$space-none;
94
- }
95
- }
96
-
97
- &--disabled,
98
- &--readonly {
99
- color: $form-text-disabled-color;
100
- }
101
-
102
- &--disabled {
103
- cursor: not-allowed;
104
- }
105
-
106
- &--error {
107
- color: $form-color-error;
108
- }
109
-
110
- &--success {
111
- color: $form-color-success;
112
- }
113
- }
114
-
115
- input:not([type="checkbox"]):not([type="radio"]),
116
- select,
117
- textarea,
118
- + input:not([type="checkbox"]):not([type="radio"]),
119
- + select,
120
- + textarea {
121
- margin-top: core.$space-s;
122
- }
123
-
124
- input[type="radio"],
125
- input[type="checkbox"] {
126
- + *:not(input):not(select):not(textarea) {
127
- display: inline-block;
128
- font-size: core.$font-size;
129
- font-weight: core.$font-weight-normal;
130
- line-height: $form-checkbox-size;
131
- margin-bottom: core.$space;
132
- margin-left: core.$space-s;
133
- margin-right: $form-spacing;
134
- padding-top: core.$space-xs;
135
- padding-left: core.$space-m;
136
- vertical-align: top;
137
- }
138
-
139
- &[disabled] {
140
- + *:not(input):not(select):not(textarea) {
141
- color: $form-text-disabled-color;
142
- }
143
- }
144
- }
145
-
146
- .uq-label__required {
147
- color: $form-color-error;
148
- }
149
- }
150
-
151
- input,
152
- select,
153
- textarea {
154
- &[disabled] {
155
- cursor: not-allowed;
156
- }
157
- }
158
-
159
- input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
160
- select,
161
- textarea {
162
- background-color: core.$uq-white;
163
- max-width: 100%;
164
- min-width: 100%;
165
- padding: ($form-spacing - core.$space-xs) $form-spacing;
166
- border: $form-border-width solid $form-border-color;
167
- border-radius: $form-border-radius;
168
- font-size: $form-text-size;
169
- color: $form-text-color;
170
- line-height: core.$line-height-ui;
171
- margin-bottom: core.$space-m;
172
-
173
- &:focus {
174
- border-color: $form-border-color-focus;
175
- box-shadow: 0 0 0 1px $form-border-color-focus inset;
176
- outline: none;
177
- }
178
-
179
- &[disabled] {
180
- color: $form-placeholder-color;
181
- }
182
-
183
- &[readonly] {
184
- &:focus {
185
- border-color: $form-border-color;
186
- box-shadow: 0 0 0 1px $form-border-color inset;
187
- }
188
- }
189
-
190
- &::placeholder {
191
- color: $form-placeholder-color;
192
- }
193
-
194
- &.uq-input--error,
195
- &.uq-input--success {
196
- border-radius: $form-border-radius;
197
-
198
- &:focus {
199
- border-color: $form-border-color-focus;
200
- box-shadow: 0 2px 0 0 $form-border-color-focus,
201
- 0 0 0 1px $form-border-color-focus inset;
202
- }
203
- }
204
-
205
- &.uq-input--error {
206
- border-color: $form-color-error;
207
- box-shadow: 0 2px 0 0 $form-color-error;
208
- }
209
-
210
- &.uq-input--success {
211
- border-color: $form-color-success;
212
- box-shadow: 0 2px 0 0 $form-color-success;
213
- }
214
-
215
- &.uq-input--large {
216
- padding: 1.15625rem core.$space-m;
217
- border-radius: core.$space-xs;
218
- }
219
-
220
- + .uq-error-message,
221
- + .uq-success-message {
222
- margin-top: -(core.$space-m);
223
- border-radius: 0 0 $form-border-radius $form-border-radius;
224
- }
225
- }
226
-
227
- select {
228
- appearance: none;
229
- -webkit-appearance: none;
230
- background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon));
231
- background-repeat: no-repeat;
232
- background-position: right core.$space-xs center;
233
- padding-right: 2.5rem;
234
- cursor: pointer;
235
- line-height: 1.2;
236
- width: 100%;
237
-
238
- &:focus {
239
- background-image: url(icon.get-icon('standard--chevron-down-sml', $form-focus-color));
240
- }
241
-
242
- &[multiple] {
243
- height: auto;
244
- background-image: none;
245
-
246
- &:focus {
247
- background-image: none;
248
- }
249
- }
250
-
251
- &[disabled] {
252
- background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon-disabled));
253
- }
254
- }
255
-
256
- textarea {
257
- height: 4 * $form-element-height;
258
- }
259
-
260
- input[type="radio"],
261
- input[type="checkbox"] {
262
- appearance: none;
263
- -webkit-appearance: none;
264
- display: inline-block;
265
- border: $form-checkbox-border-width solid $form-border-color;
266
- cursor: pointer;
267
- height: $form-checkbox-size;
268
- width: $form-checkbox-size;
269
- vertical-align: top;
270
- position: absolute;
271
-
272
- &:focus {
273
- border-color: $form-focus-color;
274
- box-shadow: 0 0 0 1px $form-focus-color;
275
- outline: none;
276
- }
277
-
278
- + label {
279
- display: inline-block;
280
- font-size: core.$font-size;
281
- font-weight: core.$font-weight-normal;
282
- line-height: core.$line-height-h;
283
- margin-bottom: core.$space;
284
- margin-left: core.$space-s;
285
- margin-right: $form-spacing;
286
- padding-top: core.$space-compressed-xs;
287
- padding-left: core.$space-m;
288
- vertical-align: top;
289
- }
290
-
291
- &:checked {
292
- border-color: core.$link;
293
-
294
- &:focus {
295
- border-color: $form-focus-color;
296
- box-shadow: 0 0 0 1px $form-focus-color;
297
- }
298
- }
299
-
300
- &.uq-input--error {
301
- border-color: $form-color-error;
302
-
303
- &:focus {
304
- border-color: $form-focus-color;
305
- box-shadow: 0 0 0 1px $form-focus-color;
306
- }
307
-
308
- &:checked {
309
- border-color: $form-color-error;
310
-
311
- &:focus {
312
- border-color: $form-focus-color;
313
- box-shadow: 0 0 0 1px $form-focus-color;
314
- }
315
- }
316
- }
317
-
318
- &[disabled] {
319
- cursor: not-allowed;
320
- border-color: $form-border-color;
321
- background-color: core.$uq-neutral-light80;
322
-
323
- + label {
324
- color: $form-text-disabled-color;
325
- }
326
-
327
- &:checked {
328
- background-color: core.$uq-neutral-light20;
329
- }
330
- }
331
- }
332
-
333
- input[type="checkbox"] {
334
- border-radius: $form-checkbox-border-radius;
335
-
336
- &::after {
337
- content: "";
338
- display: block;
339
- position: absolute;
340
- background-repeat: no-repeat;
341
- background-position: center center;
342
- top: 1px;
343
- left: 1px;
344
- height: $form-checkbox-check-size;
345
- width: $form-checkbox-check-size;
346
- }
347
-
348
- &:checked {
349
- background-color: core.$link;
350
-
351
- &::after {
352
- background-image: url(icon.get-icon('standard--check', $form-checkbox-check-color));
353
- padding: 0px;
354
- }
355
- }
356
-
357
- &.uq-input--error {
358
- &:checked {
359
- background-color: $form-color-error;
360
- }
361
- }
362
- }
363
-
364
- input[type="radio"] {
365
- border-radius: 50%;
366
-
367
- &:checked {
368
- border-width: 2px;
369
-
370
- &::after {
371
- border-radius: 50%;
372
- background-color: core.$link;
373
- content: "";
374
- display: block;
375
- position: absolute;
376
- top: 3px;
377
- left: 3px;
378
- height: $form-checkbox-size - 10px;
379
- width: $form-checkbox-size - 10px;
380
- }
381
- }
382
-
383
- &[disabled] {
384
- &:checked {
385
- background-color: core.$uq-neutral-light80;
386
- &::after {
387
- background-color: core.$uq-neutral-light20;
388
- }
389
- }
390
- }
391
-
392
- &.uq-input--error {
393
- &:checked {
394
- border-color: $form-color-error;
395
-
396
- &::after {
397
- background-color: $form-color-error;
398
- }
399
- }
400
- }
401
- }
402
-
403
- [type="submit"] {
404
- appearance: none;
405
- }
406
-
407
- .uq-error-summary {
408
- background-color: lighten(core.$alert-light, 10%);
409
- border: 1px solid core.$alert;
410
- border-left-width: core.$space-xs;
411
- padding: core.$space;
412
- margin-bottom: core.$space-m;
413
-
414
- &__title {
415
- color: core.$text;
416
- font-size: core.$font-size-m;
417
- font-weight: core.$font-weight-bold;
418
- line-height: core.$line-height-h;
419
- margin: core.$space-none core.$space-none core.$space core.$space-none;
420
- }
421
-
422
- &_body {
423
- color: core.$text;
424
- font-size: core.$space;
425
- }
426
-
427
- &__list {
428
- color: core.$text;
429
- font-size: core.$space;
430
- margin: core.$space-none;
431
-
432
- &__item {
433
- margin-bottom: core.$space-xs;
434
- line-height: core.$line-height;
435
- }
436
-
437
- a {
438
- color: core.$alert;
439
- text-decoration: underline;
440
- font-weight: core.$font-weight-normal;
441
- &:hover, &:focus {
442
- color: darken(core.$alert, 5%);
443
- }
444
- }
445
- }
446
- }
447
-
448
- .uq-error-message,
449
- .uq-success-message {
450
- color: core.$uq-white;
451
- display: block;
452
- font-size: core.$font-size;
453
- font-style: normal;
454
- font-weight: core.$font-weight-normal;
455
- line-height: core.$line-height;
456
- margin-bottom: core.$space-m;
457
- padding: calc(#{core.$space-s} - 1px) core.$space core.$space-s core.$space-xxl;
458
- position: relative;
459
-
460
- &::before {
461
- content: '';
462
- display: block;
463
- background-position: center;
464
- background-repeat: no-repeat;
465
- background-size: contain;
466
- height: core.$space-compressed-xl;
467
- left: core.$space;
468
- margin-right: core.$space-s;
469
- margin-top: calc(#{-(core.$space-compressed-xl) * 0.5} - 1px);
470
- position: absolute;
471
- top: 50%;
472
- width: core.$space-compressed-xl;
473
- }
474
- }
475
-
476
- .uq-error-message {
477
- background-color: $form-color-error;
478
-
479
- &::before {
480
- background-image: url(icon.get-icon('standard--alert-triangle', core.$uq-white));
481
- }
482
- }
483
-
484
- .uq-success-message {
485
- background-color: $form-color-success;
486
-
487
- &::before {
488
- background-image: url(icon.get-icon('standard--success-circle', core.$uq-white));
489
- }
490
- }
491
-
492
- .uq-inline-help {
493
- display: block;
494
- font-size: $form-description-size;
495
- margin: 0 0 $form-spacing;
496
- }
497
- }
498
-
499
- @if $use-encapsulation {
500
- .uq {
501
- @include form-styles;
502
- }
503
- } @else {
504
- @include form-styles;
505
- }
1
+ @use "@uqds/core/src/scss/global" as core;
2
+ @use "@uqds/icon/src/scss/global" as icon;
3
+ @use "global" as *;
4
+ @use "icons" as *;
5
+
6
+ $use-encapsulation: false !default;
7
+
8
+ @mixin form-styles {
9
+ form,
10
+ fieldset,
11
+ legend,
12
+ label,
13
+ input,
14
+ select,
15
+ textarea,
16
+ .uq-error-summary,
17
+ .uq-error-message,
18
+ .uq-success-message,
19
+ .uq-inline-help {
20
+ box-sizing: border-box;
21
+ font-family: core.$font-body;
22
+ }
23
+
24
+ fieldset,
25
+ legend,
26
+ label,
27
+ input,
28
+ select,
29
+ textarea {
30
+ &::before,
31
+ &::after,
32
+ *,
33
+ *::before,
34
+ *::after {
35
+ box-sizing: border-box;
36
+ }
37
+ }
38
+
39
+ fieldset {
40
+ border: 0;
41
+ padding: 0;
42
+ margin: 0;
43
+ }
44
+
45
+ label,
46
+ legend {
47
+ color: $form-text-color;
48
+ display: block;
49
+ font-size: $form-label-size;
50
+ font-weight: core.$font-weight-bold;
51
+ }
52
+
53
+ legend {
54
+ margin-bottom: $form-spacing;
55
+ line-height: core.$line-height-h;
56
+ padding: 0;
57
+
58
+ &.uq-legend--error {
59
+ color: $form-color-error;
60
+ }
61
+
62
+ .uq-legend__required {
63
+ color: $form-color-error;
64
+ }
65
+ }
66
+
67
+ label {
68
+ cursor: pointer;
69
+ line-height: core.$line-height-ui;
70
+
71
+ &.uq-label {
72
+ &--inline {
73
+ align-items: center;
74
+ display: inline-flex;
75
+ font-size: core.$font-size;
76
+ line-height: core.$line-height;
77
+ margin-bottom: core.$space-m;
78
+
79
+ input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
80
+ select,
81
+ textarea,
82
+ + input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
83
+ + select,
84
+ + textarea {
85
+ max-width: none;
86
+ min-width: 200px;
87
+ margin-left: core.$space;
88
+ margin-right: core.$space-m;
89
+ width: auto;
90
+ }
91
+
92
+ input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
93
+ select,
94
+ textarea {
95
+ margin-top: 0;
96
+ margin-bottom: core.$space-none;
97
+ }
98
+ }
99
+
100
+ &--disabled,
101
+ &--readonly {
102
+ color: $form-text-disabled-color;
103
+ }
104
+
105
+ &--disabled {
106
+ cursor: not-allowed;
107
+ }
108
+
109
+ &--error {
110
+ color: $form-color-error;
111
+ }
112
+
113
+ &--success {
114
+ color: $form-color-success;
115
+ }
116
+ }
117
+
118
+ input:not([type="checkbox"]):not([type="radio"]),
119
+ select,
120
+ textarea,
121
+ + input:not([type="checkbox"]):not([type="radio"]),
122
+ + select,
123
+ + textarea {
124
+ margin-top: core.$space-s;
125
+ }
126
+
127
+ input[type="radio"],
128
+ input[type="checkbox"] {
129
+ + *:not(input):not(select):not(textarea) {
130
+ display: inline-block;
131
+ font-size: core.$font-size;
132
+ font-weight: core.$font-weight-normal;
133
+ line-height: $form-checkbox-size;
134
+ margin-bottom: core.$space;
135
+ margin-left: core.$space-s;
136
+ margin-right: $form-spacing;
137
+ padding-top: core.$space-xs;
138
+ padding-left: core.$space-m;
139
+ vertical-align: top;
140
+ }
141
+
142
+ &[disabled] {
143
+ + *:not(input):not(select):not(textarea) {
144
+ color: $form-text-disabled-color;
145
+ }
146
+ }
147
+ }
148
+
149
+ .uq-label__required {
150
+ color: $form-color-error;
151
+ }
152
+ }
153
+
154
+ input,
155
+ select,
156
+ textarea {
157
+ &[disabled] {
158
+ cursor: not-allowed;
159
+ }
160
+ }
161
+
162
+ input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
163
+ select,
164
+ textarea {
165
+ background-color: core.$uq-white;
166
+ max-width: 100%;
167
+ min-width: 100%;
168
+ padding: ($form-spacing - core.$space-xs) $form-spacing;
169
+ border: $form-border-width solid $form-border-color;
170
+ border-radius: $form-border-radius;
171
+ font-size: $form-text-size;
172
+ color: $form-text-color;
173
+ line-height: core.$line-height-ui;
174
+ margin-bottom: core.$space-m;
175
+
176
+ &:focus {
177
+ border-color: $form-border-color-focus;
178
+ box-shadow: 0 0 0 1px $form-border-color-focus inset;
179
+ outline: none;
180
+ }
181
+
182
+ &[disabled] {
183
+ color: $form-placeholder-color;
184
+ }
185
+
186
+ &[readonly] {
187
+ &:focus {
188
+ border-color: $form-border-color;
189
+ box-shadow: 0 0 0 1px $form-border-color inset;
190
+ }
191
+ }
192
+
193
+ &::placeholder {
194
+ color: $form-placeholder-color;
195
+ }
196
+
197
+ &.uq-input--error,
198
+ &.uq-input--success {
199
+ border-radius: $form-border-radius;
200
+
201
+ &:focus {
202
+ border-color: $form-border-color-focus;
203
+ box-shadow: 0 2px 0 0 $form-border-color-focus,
204
+ 0 0 0 1px $form-border-color-focus inset;
205
+ }
206
+ }
207
+
208
+ &.uq-input--error {
209
+ border-color: $form-color-error;
210
+ box-shadow: 0 2px 0 0 $form-color-error;
211
+ }
212
+
213
+ &.uq-input--success {
214
+ border-color: $form-color-success;
215
+ box-shadow: 0 2px 0 0 $form-color-success;
216
+ }
217
+
218
+ &.uq-input--large {
219
+ padding: 1.15625rem core.$space-m;
220
+ border-radius: core.$space-xs;
221
+ }
222
+
223
+ + .uq-error-message,
224
+ + .uq-success-message {
225
+ margin-top: -(core.$space-m);
226
+ border-radius: 0 0 $form-border-radius $form-border-radius;
227
+ }
228
+ }
229
+
230
+ select {
231
+ appearance: none;
232
+ -webkit-appearance: none;
233
+ background-image: url(icon.get-icon(
234
+ "standard--chevron-down-sml",
235
+ $form-select-icon
236
+ ));
237
+ background-repeat: no-repeat;
238
+ background-position: right core.$space-xs center;
239
+ padding-right: 2.5rem;
240
+ cursor: pointer;
241
+ line-height: 1.2;
242
+ width: 100%;
243
+
244
+ &:focus {
245
+ background-image: url(icon.get-icon(
246
+ "standard--chevron-down-sml",
247
+ $form-focus-color
248
+ ));
249
+ }
250
+
251
+ &[multiple] {
252
+ height: auto;
253
+ background-image: none;
254
+
255
+ &:focus {
256
+ background-image: none;
257
+ }
258
+ }
259
+
260
+ &[disabled] {
261
+ background-image: url(icon.get-icon(
262
+ "standard--chevron-down-sml",
263
+ $form-select-icon-disabled
264
+ ));
265
+ }
266
+ }
267
+
268
+ textarea {
269
+ height: 4 * $form-element-height;
270
+ }
271
+
272
+ input[type="radio"],
273
+ input[type="checkbox"] {
274
+ appearance: none;
275
+ -webkit-appearance: none;
276
+ display: inline-block;
277
+ border: $form-checkbox-border-width solid $form-border-color;
278
+ cursor: pointer;
279
+ height: $form-checkbox-size;
280
+ width: $form-checkbox-size;
281
+ vertical-align: top;
282
+ position: absolute;
283
+
284
+ &:focus {
285
+ border-color: $form-focus-color;
286
+ box-shadow: 0 0 0 1px $form-focus-color;
287
+ outline: none;
288
+ }
289
+
290
+ + label {
291
+ display: inline-block;
292
+ font-size: core.$font-size;
293
+ font-weight: core.$font-weight-normal;
294
+ line-height: core.$line-height-h;
295
+ margin-bottom: core.$space;
296
+ margin-left: core.$space-s;
297
+ margin-right: $form-spacing;
298
+ padding-top: core.$space-compressed-xs;
299
+ padding-left: core.$space-m;
300
+ vertical-align: top;
301
+ }
302
+
303
+ &:checked {
304
+ border-color: core.$link;
305
+
306
+ &:focus {
307
+ border-color: $form-focus-color;
308
+ box-shadow: 0 0 0 1px $form-focus-color;
309
+ }
310
+ }
311
+
312
+ &.uq-input--error {
313
+ border-color: $form-color-error;
314
+
315
+ &:focus {
316
+ border-color: $form-focus-color;
317
+ box-shadow: 0 0 0 1px $form-focus-color;
318
+ }
319
+
320
+ &:checked {
321
+ border-color: $form-color-error;
322
+
323
+ &:focus {
324
+ border-color: $form-focus-color;
325
+ box-shadow: 0 0 0 1px $form-focus-color;
326
+ }
327
+ }
328
+ }
329
+
330
+ &[disabled] {
331
+ cursor: not-allowed;
332
+ border-color: $form-border-color;
333
+ background-color: core.$uq-neutral-light80;
334
+
335
+ + label {
336
+ color: $form-text-disabled-color;
337
+ }
338
+
339
+ &:checked {
340
+ background-color: core.$uq-neutral-light20;
341
+ }
342
+ }
343
+ }
344
+
345
+ input[type="checkbox"] {
346
+ border-radius: $form-checkbox-border-radius;
347
+
348
+ &::after {
349
+ content: "";
350
+ display: block;
351
+ position: absolute;
352
+ background-repeat: no-repeat;
353
+ background-position: center center;
354
+ top: 1px;
355
+ left: 1px;
356
+ height: $form-checkbox-check-size;
357
+ width: $form-checkbox-check-size;
358
+ }
359
+
360
+ &:checked {
361
+ background-color: core.$link;
362
+
363
+ &::after {
364
+ background-image: url(icon.get-icon(
365
+ "standard--check",
366
+ $form-checkbox-check-color
367
+ ));
368
+ padding: 0px;
369
+ }
370
+ }
371
+
372
+ &.uq-input--error {
373
+ &:checked {
374
+ background-color: $form-color-error;
375
+ }
376
+ }
377
+ }
378
+
379
+ input[type="radio"] {
380
+ border-radius: 50%;
381
+
382
+ &:checked {
383
+ border-width: 2px;
384
+
385
+ &::after {
386
+ border-radius: 50%;
387
+ background-color: core.$link;
388
+ content: "";
389
+ display: block;
390
+ position: absolute;
391
+ top: 3px;
392
+ left: 3px;
393
+ height: $form-checkbox-size - 10px;
394
+ width: $form-checkbox-size - 10px;
395
+ }
396
+ }
397
+
398
+ &[disabled] {
399
+ &:checked {
400
+ background-color: core.$uq-neutral-light80;
401
+ &::after {
402
+ background-color: core.$uq-neutral-light20;
403
+ }
404
+ }
405
+ }
406
+
407
+ &.uq-input--error {
408
+ &:checked {
409
+ border-color: $form-color-error;
410
+
411
+ &::after {
412
+ background-color: $form-color-error;
413
+ }
414
+ }
415
+ }
416
+ }
417
+
418
+ [type="submit"] {
419
+ appearance: none;
420
+ }
421
+
422
+ .uq-error-summary {
423
+ background-color: lighten(core.$alert-light, 10%);
424
+ border: 1px solid core.$alert;
425
+ border-left-width: core.$space-xs;
426
+ padding: core.$space;
427
+ margin-bottom: core.$space-m;
428
+
429
+ &__title {
430
+ color: core.$text;
431
+ font-size: core.$font-size-m;
432
+ font-weight: core.$font-weight-bold;
433
+ line-height: core.$line-height-h;
434
+ margin: core.$space-none core.$space-none core.$space core.$space-none;
435
+ }
436
+
437
+ &_body {
438
+ color: core.$text;
439
+ font-size: core.$space;
440
+ }
441
+
442
+ &__list {
443
+ color: core.$text;
444
+ font-size: core.$space;
445
+ margin: core.$space-none;
446
+
447
+ &__item {
448
+ margin-bottom: core.$space-xs;
449
+ line-height: core.$line-height;
450
+ }
451
+
452
+ a {
453
+ color: core.$alert;
454
+ text-decoration: underline;
455
+ font-weight: core.$font-weight-normal;
456
+ &:hover,
457
+ &:focus {
458
+ color: darken(core.$alert, 5%);
459
+ }
460
+ }
461
+ }
462
+ }
463
+
464
+ .uq-error-message,
465
+ .uq-success-message {
466
+ color: core.$uq-white;
467
+ display: block;
468
+ font-size: core.$font-size;
469
+ font-style: normal;
470
+ font-weight: core.$font-weight-normal;
471
+ line-height: core.$line-height;
472
+ margin-bottom: core.$space-m;
473
+ padding: calc(#{core.$space-s} - 1px) core.$space core.$space-s
474
+ core.$space-xxl;
475
+ position: relative;
476
+
477
+ &::before {
478
+ content: "";
479
+ display: block;
480
+ background-position: center;
481
+ background-repeat: no-repeat;
482
+ background-size: contain;
483
+ height: core.$space-compressed-xl;
484
+ left: core.$space;
485
+ margin-right: core.$space-s;
486
+ margin-top: calc(#{- (core.$space-compressed-xl) * 0.5} - 1px);
487
+ position: absolute;
488
+ top: 50%;
489
+ width: core.$space-compressed-xl;
490
+ }
491
+ }
492
+
493
+ .uq-error-message {
494
+ background-color: $form-color-error;
495
+
496
+ &::before {
497
+ background-image: url(icon.get-icon(
498
+ "standard--exclamation-triangle",
499
+ core.$uq-white
500
+ ));
501
+ }
502
+ }
503
+
504
+ .uq-success-message {
505
+ background-color: $form-color-success;
506
+
507
+ &::before {
508
+ background-image: url(icon.get-icon(
509
+ "standard--check-circle",
510
+ core.$uq-white
511
+ ));
512
+ }
513
+ }
514
+
515
+ .uq-inline-help {
516
+ display: block;
517
+ font-size: $form-description-size;
518
+ margin: 0 0 $form-spacing;
519
+ }
520
+ }
521
+
522
+ @if $use-encapsulation {
523
+ .uq {
524
+ @include form-styles;
525
+ }
526
+ } @else {
527
+ @include form-styles;
528
+ }