1
|
// Name: Form
|
2
|
// Description: Styles for forms
|
3
|
//
|
4
|
// Component: `uk-form-*`
|
5
|
// `uk-input`
|
6
|
// `uk-select`
|
7
|
// `uk-textarea`
|
8
|
// `uk-radio`
|
9
|
// `uk-checkbox`
|
10
|
// `uk-legend`
|
11
|
// `uk-fieldset`
|
12
|
//
|
13
|
// Sub-objects: `uk-form-custom`
|
14
|
// `uk-form-stacked`
|
15
|
// `uk-form-horizontal`
|
16
|
// `uk-form-label`
|
17
|
// `uk-form-controls`
|
18
|
// `uk-form-icon`
|
19
|
// `uk-form-icon-flip`
|
20
|
//
|
21
|
// Modifiers: `uk-form-small`
|
22
|
// `uk-form-large`
|
23
|
// `uk-form-danger`
|
24
|
// `uk-form-success`
|
25
|
// `uk-form-blank`
|
26
|
// `uk-form-width-xsmall`
|
27
|
// `uk-form-width-small`
|
28
|
// `uk-form-width-medium`
|
29
|
// `uk-form-width-large`
|
30
|
// `uk-form-controls-text`
|
31
|
//
|
32
|
// ========================================================================
|
33
|
|
34
|
|
35
|
// Variables
|
36
|
// ========================================================================
|
37
|
|
38
|
$form-height: $global-control-height !default;
|
39
|
$form-line-height: $form-height !default;
|
40
|
$form-padding-horizontal: 6px !default;
|
41
|
$form-padding-vertical: 4px !default;
|
42
|
|
43
|
$form-background: $global-muted-background !default;
|
44
|
$form-color: $global-color !default;
|
45
|
|
46
|
$form-focus-background: $global-muted-background !default;
|
47
|
$form-focus-color: $global-color !default;
|
48
|
|
49
|
$form-disabled-background: $global-muted-background !default;
|
50
|
$form-disabled-color: $global-muted-color !default;
|
51
|
|
52
|
$form-placeholder-color: $global-muted-color !default;
|
53
|
|
54
|
$form-small-height: $global-control-small-height !default;
|
55
|
$form-large-height: $global-control-large-height !default;
|
56
|
$form-small-line-height: $form-small-height !default;
|
57
|
$form-large-line-height: $form-large-height !default;
|
58
|
$form-small-font-size: $global-small-font-size !default;
|
59
|
$form-large-font-size: $global-medium-font-size !default;
|
60
|
|
61
|
$form-danger-color: $global-danger-background !default;
|
62
|
$form-success-color: $global-success-background !default;
|
63
|
|
64
|
$form-width-xsmall: 40px !default;
|
65
|
$form-width-small: 130px !default;
|
66
|
$form-width-medium: 200px !default;
|
67
|
$form-width-large: 500px !default;
|
68
|
|
69
|
$form-select-padding-right: 20px !default;
|
70
|
$form-select-icon-color: $global-color !default;
|
71
|
$form-select-disabled-icon-color: $global-muted-color !default;
|
72
|
|
73
|
$form-radio-size: 16px !default;
|
74
|
$form-radio-margin-top: -4px !default;
|
75
|
$form-radio-background: darken($global-muted-background, 5%) !default;
|
76
|
|
77
|
$form-radio-checked-background: $global-primary-background !default;
|
78
|
$form-radio-checked-icon-color: $global-inverse-color !default;
|
79
|
|
80
|
$form-radio-checked-focus-background: darken($global-primary-background, 10%) !default;
|
81
|
|
82
|
$form-radio-disabled-background: $global-muted-background !default;
|
83
|
$form-radio-disabled-icon-color: $global-muted-color !default;
|
84
|
|
85
|
$form-legend-font-size: $global-large-font-size !default;
|
86
|
$form-legend-line-height: 1.4 !default;
|
87
|
|
88
|
$form-stacked-margin-bottom: $global-small-margin !default;
|
89
|
|
90
|
$form-horizontal-label-width: 200px !default;
|
91
|
$form-horizontal-label-margin-top: 7px !default;
|
92
|
$form-horizontal-controls-margin-left: 215px !default;
|
93
|
$form-horizontal-controls-text-padding-top: 7px !default;
|
94
|
|
95
|
$form-icon-width: 30px !default;
|
96
|
$form-icon-font-size: $global-font-size !default;
|
97
|
$form-icon-color: $global-muted-color !default;
|
98
|
$form-icon-hover-color: $global-color !default;
|
99
|
|
100
|
$internal-form-select-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22#000%22%20points%3D%224%201%201%206%207%206%22%3E%3C%2Fpolygon%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22#000%22%20points%3D%224%2013%201%208%207%208%22%3E%3C%2Fpolygon%3E%0A%3C%2Fsvg%3E" !default;
|
101
|
$internal-form-radio-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22#000%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%3E%3C%2Fcircle%3E%0A%3C%2Fsvg%3E" !default;
|
102
|
$internal-form-checkbox-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22#000%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%2F%3E%0A%3C%2Fsvg%3E" !default;
|
103
|
$internal-form-checkbox-indeterminate-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22#000%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%3E%3C%2Frect%3E%0A%3C%2Fsvg%3E" !default;
|
104
|
|
105
|
|
106
|
/* ========================================================================
|
107
|
Component: Form
|
108
|
========================================================================== */
|
109
|
|
110
|
/*
|
111
|
* 1. Define consistent box sizing.
|
112
|
* Default is `content-box` with following exceptions set to `border-box`
|
113
|
* `select`, `input[type="checkbox"]` and `input[type="radio"]`
|
114
|
* `input[type="search"]` in Chrome, Safari and Opera
|
115
|
* `input[type="color"]` in Firefox
|
116
|
* 2. Address margins set differently in Firefox/IE and Chrome/Safari/Opera.
|
117
|
* 3. Remove `border-radius` in iOS.
|
118
|
* 4. Change font properties to `inherit` in all browsers
|
119
|
*/
|
120
|
|
121
|
.uk-input,
|
122
|
.uk-select,
|
123
|
.uk-textarea,
|
124
|
.uk-radio,
|
125
|
.uk-checkbox {
|
126
|
/* 1 */
|
127
|
box-sizing: border-box;
|
128
|
/* 2 */
|
129
|
margin: 0;
|
130
|
/* 3 */
|
131
|
border-radius: 0;
|
132
|
/* 4 */
|
133
|
font: inherit;
|
134
|
}
|
135
|
|
136
|
/*
|
137
|
* Show the overflow in Edge.
|
138
|
*/
|
139
|
|
140
|
.uk-input { overflow: visible; }
|
141
|
|
142
|
/*
|
143
|
* Remove the inheritance of text transform in Firefox.
|
144
|
*/
|
145
|
|
146
|
.uk-select { text-transform: none; }
|
147
|
|
148
|
/*
|
149
|
* 1. Change font properties to `inherit` in all browsers
|
150
|
* 2. Don't inherit the `font-weight` and use `bold` instead.
|
151
|
* NOTE: Both declarations don't work in Chrome, Safari and Opera.
|
152
|
*/
|
153
|
|
154
|
.uk-select optgroup {
|
155
|
/* 1 */
|
156
|
font: inherit;
|
157
|
/* 2 */
|
158
|
font-weight: bold;
|
159
|
}
|
160
|
|
161
|
/*
|
162
|
* Remove the default vertical scrollbar in IE.
|
163
|
*/
|
164
|
|
165
|
.uk-textarea { overflow: auto; }
|
166
|
|
167
|
/*
|
168
|
* Remove the inner padding and cancel buttons in Chrome on OS X and Safari on OS X.
|
169
|
*/
|
170
|
|
171
|
.uk-input[type="search"]::-webkit-search-cancel-button,
|
172
|
.uk-input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
|
173
|
|
174
|
|
175
|
/*
|
176
|
* Correct the cursor style of increment and decrement buttons in Chrome.
|
177
|
*/
|
178
|
|
179
|
.uk-input[type="number"]::-webkit-inner-spin-button,
|
180
|
.uk-input[type="number"]::-webkit-outer-spin-button { height: auto; }
|
181
|
|
182
|
/*
|
183
|
* Removes placeholder transparency in Firefox.
|
184
|
*/
|
185
|
|
186
|
.uk-input::-moz-placeholder,
|
187
|
.uk-textarea::-moz-placeholder { opacity: 1; }
|
188
|
|
189
|
/*
|
190
|
* Remove the padding in IE 10-.
|
191
|
*/
|
192
|
|
193
|
.uk-radio,
|
194
|
.uk-checkbox { padding: 0; }
|
195
|
|
196
|
/*
|
197
|
* Improves consistency of cursor style for clickable elements
|
198
|
*/
|
199
|
|
200
|
.uk-radio:not(:disabled),
|
201
|
.uk-checkbox:not(:disabled) { cursor: pointer; }
|
202
|
|
203
|
/*
|
204
|
* Define consistent border, margin, and padding.
|
205
|
*/
|
206
|
|
207
|
.uk-fieldset {
|
208
|
border: none;
|
209
|
margin: 0;
|
210
|
padding: 0;
|
211
|
}
|
212
|
|
213
|
|
214
|
/* Input, select and textarea
|
215
|
* Allowed: `text`, `password`, `datetime`, `datetime-local`, `date`, `month`,
|
216
|
`time`, `week`, `number`, `email`, `url`, `search`, `tel`, `color`
|
217
|
* Disallowed: `range`, `radio`, `checkbox`, `file`, `submit`, `reset` and `image`
|
218
|
========================================================================== */
|
219
|
|
220
|
/*
|
221
|
* Remove default style in iOS.
|
222
|
*/
|
223
|
|
224
|
.uk-input,
|
225
|
.uk-textarea { -webkit-appearance: none; }
|
226
|
|
227
|
/*
|
228
|
* 1. Prevent content overflow if a fixed width is used
|
229
|
* 2. Take the full width
|
230
|
* 3. Reset default
|
231
|
* 4. Style
|
232
|
*/
|
233
|
|
234
|
.uk-input,
|
235
|
.uk-select,
|
236
|
.uk-textarea {
|
237
|
/* 1 */
|
238
|
max-width: 100%;
|
239
|
/* 2 */
|
240
|
width: 100%;
|
241
|
/* 3 */
|
242
|
border: 0 none;
|
243
|
/* 4 */
|
244
|
padding: 0 $form-padding-horizontal;
|
245
|
background: $form-background;
|
246
|
color: $form-color;
|
247
|
@if(mixin-exists(hook-form)) {@include hook-form();}
|
248
|
}
|
249
|
|
250
|
/*
|
251
|
* Single-line
|
252
|
* 1. Allow an `a` element to look like a `input` or `select` element
|
253
|
* 2. Make sure line-height is not larger than height
|
254
|
* Also needed to center the text vertically if `a` element is used
|
255
|
*/
|
256
|
|
257
|
.uk-input,
|
258
|
.uk-select:not([multiple]):not([size]) {
|
259
|
height: $form-height;
|
260
|
vertical-align: middle;
|
261
|
/* 1 */
|
262
|
display: inline-block;
|
263
|
/* 2 */
|
264
|
line-height: $form-line-height;
|
265
|
@if(mixin-exists(hook-form-single-line)) {@include hook-form-single-line();}
|
266
|
}
|
267
|
|
268
|
/*
|
269
|
* Multi-line
|
270
|
*/
|
271
|
|
272
|
.uk-select[multiple],
|
273
|
.uk-select[size],
|
274
|
.uk-textarea {
|
275
|
padding-top: $form-padding-vertical;
|
276
|
padding-bottom: $form-padding-vertical;
|
277
|
vertical-align: top;
|
278
|
@if(mixin-exists(hook-form-multi-line)) {@include hook-form-multi-line();}
|
279
|
}
|
280
|
|
281
|
/* Focus */
|
282
|
.uk-input:focus,
|
283
|
.uk-select:focus,
|
284
|
.uk-textarea:focus {
|
285
|
outline: 0;
|
286
|
background-color: $form-focus-background;
|
287
|
color: $form-focus-color;
|
288
|
@if(mixin-exists(hook-form-focus)) {@include hook-form-focus();}
|
289
|
}
|
290
|
|
291
|
/* Disabled */
|
292
|
.uk-input:disabled,
|
293
|
.uk-select:disabled,
|
294
|
.uk-textarea:disabled {
|
295
|
background-color: $form-disabled-background;
|
296
|
color: $form-disabled-color;
|
297
|
@if(mixin-exists(hook-form-disabled)) {@include hook-form-disabled();}
|
298
|
}
|
299
|
|
300
|
/*
|
301
|
* Placeholder
|
302
|
*/
|
303
|
|
304
|
.uk-input:-ms-input-placeholder { color: $form-placeholder-color !important; }
|
305
|
.uk-input::-moz-placeholder { color: $form-placeholder-color; }
|
306
|
.uk-input::-webkit-input-placeholder { color: $form-placeholder-color; }
|
307
|
|
308
|
.uk-textarea:-ms-input-placeholder { color: $form-placeholder-color !important; }
|
309
|
.uk-textarea::-moz-placeholder { color: $form-placeholder-color; }
|
310
|
.uk-textarea::-webkit-input-placeholder { color: $form-placeholder-color; }
|
311
|
|
312
|
|
313
|
/* Style modifier (`uk-input`, `uk-select` and `uk-textarea`)
|
314
|
========================================================================== */
|
315
|
|
316
|
/*
|
317
|
* Small
|
318
|
*/
|
319
|
|
320
|
.uk-form-small { font-size: $form-small-font-size; }
|
321
|
|
322
|
.uk-form-small:not(textarea):not([multiple]):not([size]) {
|
323
|
height: $form-small-height;
|
324
|
line-height: $form-small-line-height;
|
325
|
}
|
326
|
|
327
|
/*
|
328
|
* Large
|
329
|
*/
|
330
|
|
331
|
.uk-form-large { font-size: $form-large-font-size; }
|
332
|
|
333
|
.uk-form-large:not(textarea):not([multiple]):not([size]) {
|
334
|
height: $form-large-height;
|
335
|
line-height: $form-large-line-height;
|
336
|
}
|
337
|
|
338
|
|
339
|
/* Style modifier (`uk-input`, `uk-select` and `uk-textarea`)
|
340
|
========================================================================== */
|
341
|
|
342
|
/*
|
343
|
* Error
|
344
|
*/
|
345
|
|
346
|
.uk-form-danger,
|
347
|
.uk-form-danger:focus {
|
348
|
color: $form-danger-color;
|
349
|
@if(mixin-exists(hook-form-danger)) {@include hook-form-danger();}
|
350
|
}
|
351
|
|
352
|
/*
|
353
|
* Success
|
354
|
*/
|
355
|
|
356
|
.uk-form-success,
|
357
|
.uk-form-success:focus {
|
358
|
color: $form-success-color;
|
359
|
@if(mixin-exists(hook-form-success)) {@include hook-form-success();}
|
360
|
}
|
361
|
|
362
|
/*
|
363
|
* Blank
|
364
|
*/
|
365
|
|
366
|
.uk-form-blank {
|
367
|
background: none;
|
368
|
@if(mixin-exists(hook-form-blank)) {@include hook-form-blank();}
|
369
|
}
|
370
|
|
371
|
.uk-form-blank:focus {
|
372
|
@if(mixin-exists(hook-form-blank-focus)) {@include hook-form-blank-focus();}
|
373
|
}
|
374
|
|
375
|
|
376
|
/* Width modifiers (`uk-input`, `uk-select` and `uk-textarea`)
|
377
|
========================================================================== */
|
378
|
|
379
|
/*
|
380
|
* Fixed widths
|
381
|
* Different widths for mini sized `input` and `select` elements
|
382
|
*/
|
383
|
|
384
|
input.uk-form-width-xsmall { width: $form-width-xsmall; }
|
385
|
|
386
|
select.uk-form-width-xsmall { width: ($form-width-xsmall + 25px); }
|
387
|
|
388
|
.uk-form-width-small { width: $form-width-small; }
|
389
|
|
390
|
.uk-form-width-medium { width: $form-width-medium; }
|
391
|
|
392
|
.uk-form-width-large { width: $form-width-large; }
|
393
|
|
394
|
|
395
|
/* Select
|
396
|
========================================================================== */
|
397
|
|
398
|
/*
|
399
|
* 1. Remove default style. Also works in Firefox
|
400
|
* 2. Style
|
401
|
* 3. Remove default style in IE 10/11
|
402
|
*/
|
403
|
|
404
|
.uk-select:not([multiple]):not([size]) {
|
405
|
/* 1 */
|
406
|
-webkit-appearance: none;
|
407
|
-moz-appearance: none;
|
408
|
/* 2 */
|
409
|
padding-right: $form-select-padding-right;
|
410
|
@include svg-fill($internal-form-select-image, "#000", $form-select-icon-color);
|
411
|
background-repeat: no-repeat;
|
412
|
background-position: 100% 50%;
|
413
|
}
|
414
|
|
415
|
/* 3 */
|
416
|
.uk-select:not([multiple]):not([size])::-ms-expand { display: none; }
|
417
|
|
418
|
/*
|
419
|
* Disabled
|
420
|
*/
|
421
|
|
422
|
.uk-select:not([multiple]):not([size]):disabled { @include svg-fill($internal-form-select-image, "#000", $form-select-disabled-icon-color); }
|
423
|
|
424
|
|
425
|
/* Radio and checkbox
|
426
|
* Note: Only works in Chrome, Safari, Opera and Edge
|
427
|
========================================================================== */
|
428
|
|
429
|
/*
|
430
|
* 1. Style
|
431
|
* 2. Make box more robust so it clips the child element
|
432
|
* 3. Vertical alignment
|
433
|
* 4. Remove default style
|
434
|
* 5. Fix black background on iOS
|
435
|
* 6. Center icons
|
436
|
*/
|
437
|
|
438
|
.uk-radio,
|
439
|
.uk-checkbox {
|
440
|
/* 1 */
|
441
|
display: inline-block;
|
442
|
height: $form-radio-size;
|
443
|
width: $form-radio-size;
|
444
|
/* 2 */
|
445
|
overflow: hidden;
|
446
|
/* 3 */
|
447
|
margin-top: $form-radio-margin-top;
|
448
|
vertical-align: middle;
|
449
|
/* 4 */
|
450
|
-webkit-appearance: none;
|
451
|
/* 5 */
|
452
|
background-color: $form-radio-background;
|
453
|
/* 6 */
|
454
|
background-repeat: no-repeat;
|
455
|
background-position: 50% 50%;
|
456
|
@if(mixin-exists(hook-form-radio)) {@include hook-form-radio();}
|
457
|
}
|
458
|
|
459
|
.uk-radio { border-radius: 50%; }
|
460
|
|
461
|
/* Focus */
|
462
|
.uk-radio:focus,
|
463
|
.uk-checkbox:focus {
|
464
|
outline: none;
|
465
|
@if(mixin-exists(hook-form-radio-focus)) {@include hook-form-radio-focus();}
|
466
|
}
|
467
|
|
468
|
/*
|
469
|
* Checked
|
470
|
*/
|
471
|
|
472
|
.uk-radio:checked,
|
473
|
.uk-checkbox:checked,
|
474
|
.uk-checkbox:indeterminate {
|
475
|
background-color: $form-radio-checked-background;
|
476
|
@if(mixin-exists(hook-form-radio-checked)) {@include hook-form-radio-checked();}
|
477
|
}
|
478
|
|
479
|
/* Focus */
|
480
|
.uk-radio:checked:focus,
|
481
|
.uk-checkbox:checked:focus,
|
482
|
.uk-checkbox:indeterminate:focus {
|
483
|
background-color: $form-radio-checked-focus-background;
|
484
|
@if(mixin-exists(hook-form-radio-checked-focus)) {@include hook-form-radio-checked-focus();}
|
485
|
}
|
486
|
|
487
|
/*
|
488
|
* Icons
|
489
|
*/
|
490
|
|
491
|
.uk-radio:checked { @include svg-fill($internal-form-radio-image, "#000", $form-radio-checked-icon-color); }
|
492
|
.uk-checkbox:checked { @include svg-fill($internal-form-checkbox-image, "#000", $form-radio-checked-icon-color); }
|
493
|
.uk-checkbox:indeterminate { @include svg-fill($internal-form-checkbox-indeterminate-image, "#000", $form-radio-checked-icon-color); }
|
494
|
|
495
|
/*
|
496
|
* Disabled
|
497
|
*/
|
498
|
|
499
|
.uk-radio:disabled,
|
500
|
.uk-checkbox:disabled {
|
501
|
background-color: $form-radio-disabled-background;
|
502
|
@if(mixin-exists(hook-form-radio-disabled)) {@include hook-form-radio-disabled();}
|
503
|
}
|
504
|
|
505
|
.uk-radio:disabled:checked { @include svg-fill($internal-form-radio-image, "#000", $form-radio-disabled-icon-color); }
|
506
|
.uk-checkbox:disabled:checked { @include svg-fill($internal-form-checkbox-image, "#000", $form-radio-disabled-icon-color); }
|
507
|
.uk-checkbox:disabled:indeterminate { @include svg-fill($internal-form-checkbox-indeterminate-image, "#000", $form-radio-disabled-icon-color); }
|
508
|
|
509
|
|
510
|
/* Legend
|
511
|
========================================================================== */
|
512
|
|
513
|
/*
|
514
|
* Legend
|
515
|
* 1. Behave like block element
|
516
|
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
517
|
* 3. Remove padding so people aren't caught out if they zero out fieldsets.
|
518
|
* 4. Style
|
519
|
*/
|
520
|
|
521
|
.uk-legend {
|
522
|
/* 1 */
|
523
|
width: 100%;
|
524
|
/* 2 */
|
525
|
color: inherit;
|
526
|
/* 3 */
|
527
|
padding: 0;
|
528
|
/* 4 */
|
529
|
font-size: $form-legend-font-size;
|
530
|
line-height: $form-legend-line-height;
|
531
|
@if(mixin-exists(hook-form-legend)) {@include hook-form-legend();}
|
532
|
}
|
533
|
|
534
|
|
535
|
/* Custom controls
|
536
|
========================================================================== */
|
537
|
|
538
|
/*
|
539
|
* 1. Container fits its content
|
540
|
* 2. Create position context
|
541
|
* 3. Prevent content overflow
|
542
|
* 4. Behave like most inline-block elements
|
543
|
*/
|
544
|
|
545
|
.uk-form-custom {
|
546
|
/* 1 */
|
547
|
display: inline-block;
|
548
|
/* 2 */
|
549
|
position: relative;
|
550
|
/* 3 */
|
551
|
max-width: 100%;
|
552
|
/* 4 */
|
553
|
vertical-align: middle;
|
554
|
}
|
555
|
|
556
|
/*
|
557
|
* 1. Position and resize the form control to always cover its container
|
558
|
* 2. Required for Firefox for positioning to the left
|
559
|
* 3. Required for Webkit to make `height` work
|
560
|
* 4. Hide controle and show cursor
|
561
|
* 5. Needed for the cursor
|
562
|
* 6. Clip height caused by 5. Needed for Webkit only
|
563
|
*/
|
564
|
|
565
|
.uk-form-custom select,
|
566
|
.uk-form-custom input[type="file"] {
|
567
|
/* 1 */
|
568
|
position: absolute;
|
569
|
top: 0;
|
570
|
z-index: 1;
|
571
|
width: 100%;
|
572
|
height: 100%;
|
573
|
/* 2 */
|
574
|
left: 0;
|
575
|
/* 3 */
|
576
|
-webkit-appearance: none;
|
577
|
/* 4 */
|
578
|
opacity: 0;
|
579
|
cursor: pointer;
|
580
|
}
|
581
|
|
582
|
.uk-form-custom input[type="file"] {
|
583
|
/* 5 */
|
584
|
font-size: 500px;
|
585
|
/* 6 */
|
586
|
overflow: hidden;
|
587
|
}
|
588
|
|
589
|
|
590
|
/* Label
|
591
|
========================================================================== */
|
592
|
|
593
|
.uk-form-label {
|
594
|
@if(mixin-exists(hook-form-label)) {@include hook-form-label();}
|
595
|
}
|
596
|
|
597
|
|
598
|
/* Layout
|
599
|
========================================================================== */
|
600
|
|
601
|
/*
|
602
|
* Stacked
|
603
|
*/
|
604
|
|
605
|
.uk-form-stacked .uk-form-label {
|
606
|
display: block;
|
607
|
margin-bottom: $form-stacked-margin-bottom;
|
608
|
@if(mixin-exists(hook-form-stacked-label)) {@include hook-form-stacked-label();}
|
609
|
}
|
610
|
|
611
|
/*
|
612
|
* Horizontal
|
613
|
*/
|
614
|
|
615
|
/* Tablet portrait and smaller */
|
616
|
@media (max-width: $breakpoint-small-max) {
|
617
|
|
618
|
/* Behave like `uk-form-stacked` */
|
619
|
.uk-form-horizontal .uk-form-label {
|
620
|
display: block;
|
621
|
margin-bottom: $form-stacked-margin-bottom;
|
622
|
@if(mixin-exists(hook-form-stacked-label)) {@include hook-form-stacked-label();}
|
623
|
}
|
624
|
|
625
|
}
|
626
|
|
627
|
/* Tablet landscape and bigger */
|
628
|
@media (min-width: $breakpoint-medium) {
|
629
|
|
630
|
.uk-form-horizontal .uk-form-label {
|
631
|
width: $form-horizontal-label-width;
|
632
|
margin-top: $form-horizontal-label-margin-top;
|
633
|
float: left;
|
634
|
@if(mixin-exists(hook-form-horizontal-label)) {@include hook-form-horizontal-label();}
|
635
|
}
|
636
|
|
637
|
.uk-form-horizontal .uk-form-controls { margin-left: $form-horizontal-controls-margin-left; }
|
638
|
|
639
|
/* Better vertical alignment if controls are checkboxes and radio buttons with text */
|
640
|
.uk-form-horizontal .uk-form-controls-text { padding-top: $form-horizontal-controls-text-padding-top; }
|
641
|
|
642
|
}
|
643
|
|
644
|
|
645
|
/* Icons
|
646
|
========================================================================== */
|
647
|
|
648
|
/*
|
649
|
* 1. Set position
|
650
|
* 2. Set width
|
651
|
* 3. Center icon vertically and horizontally
|
652
|
* 4. Style
|
653
|
*/
|
654
|
|
655
|
.uk-form-icon {
|
656
|
/* 1 */
|
657
|
position: absolute;
|
658
|
top: 0;
|
659
|
bottom: 0;
|
660
|
left: 0;
|
661
|
/* 2 */
|
662
|
width: $form-icon-width;
|
663
|
/* 3 */
|
664
|
display: -ms-inline-flexbox;
|
665
|
display: -webkit-inline-flex;
|
666
|
display: inline-flex;
|
667
|
-ms-flex-pack: center;
|
668
|
-webkit-justify-content: center;
|
669
|
justify-content: center;
|
670
|
-ms-flex-align: center;
|
671
|
-webkit-align-items: center;
|
672
|
align-items: center;
|
673
|
/* 4 */
|
674
|
color: $form-icon-color;
|
675
|
}
|
676
|
|
677
|
/*
|
678
|
* Required for `a`.
|
679
|
*/
|
680
|
|
681
|
.uk-form-icon:hover { color: $form-icon-hover-color; }
|
682
|
|
683
|
/*
|
684
|
* Make `input` element clickable through icon, e.g. if it's a `span`
|
685
|
*/
|
686
|
|
687
|
.uk-form-icon:not(a):not(button):not(input) { pointer-events: none; }
|
688
|
|
689
|
/*
|
690
|
* Input padding
|
691
|
*/
|
692
|
|
693
|
.uk-form-icon:not(.uk-form-icon-flip) + .uk-input { padding-left: $form-icon-width; }
|
694
|
|
695
|
/*
|
696
|
* Position modifier
|
697
|
*/
|
698
|
|
699
|
.uk-form-icon-flip {
|
700
|
right: 0;
|
701
|
left: auto;
|
702
|
}
|
703
|
|
704
|
.uk-form-icon-flip + .uk-input { padding-right: $form-icon-width; }
|
705
|
|
706
|
|
707
|
// Hooks
|
708
|
// ========================================================================
|
709
|
|
710
|
@if(mixin-exists(hook-form-misc)) {@include hook-form-misc();}
|
711
|
|
712
|
// @mixin hook-form(){}
|
713
|
// @mixin hook-form-single-line(){}
|
714
|
// @mixin hook-form-multi-line(){}
|
715
|
// @mixin hook-form-focus(){}
|
716
|
// @mixin hook-form-disabled(){}
|
717
|
// @mixin hook-form-danger(){}
|
718
|
// @mixin hook-form-success(){}
|
719
|
// @mixin hook-form-blank(){}
|
720
|
// @mixin hook-form-blank-focus(){}
|
721
|
// @mixin hook-form-radio(){}
|
722
|
// @mixin hook-form-radio-focus(){}
|
723
|
// @mixin hook-form-radio-checked(){}
|
724
|
// @mixin hook-form-radio-checked-focus(){}
|
725
|
// @mixin hook-form-radio-disabled(){}
|
726
|
// @mixin hook-form-legend(){}
|
727
|
// @mixin hook-form-label(){}
|
728
|
// @mixin hook-form-stacked-label(){}
|
729
|
// @mixin hook-form-horizontal-label(){}
|
730
|
// @mixin hook-form-misc(){}
|
731
|
|
732
|
|
733
|
// Inverse
|
734
|
// ========================================================================
|
735
|
|
736
|
$inverse-form-background: $inverse-global-muted-background !default;
|
737
|
$inverse-form-color: $inverse-global-color !default;
|
738
|
$inverse-form-focus-background: $inverse-global-muted-background !default;
|
739
|
$inverse-form-focus-color: $inverse-global-color !default;
|
740
|
$inverse-form-placeholder-color: $inverse-global-muted-color !default;
|
741
|
|
742
|
$inverse-form-select-icon-color: $inverse-global-color !default;
|
743
|
|
744
|
$inverse-form-radio-background: darken($inverse-global-muted-background, 5%) !default;
|
745
|
|
746
|
$inverse-form-radio-checked-background: $inverse-global-primary-background !default;
|
747
|
$inverse-form-radio-checked-icon-color: $inverse-global-inverse-color !default;
|
748
|
|
749
|
$inverse-form-radio-checked-focus-background: darken($inverse-global-primary-background, 10%) !default;
|
750
|
|
751
|
|
752
|
|
753
|
// @mixin hook-inverse-form(){}
|
754
|
// @mixin hook-inverse-form-focus(){}
|
755
|
// @mixin hook-inverse-form-radio(){}
|
756
|
// @mixin hook-inverse-form-radio-focus(){}
|
757
|
// @mixin hook-inverse-form-radio-checked(){}
|
758
|
// @mixin hook-inverse-form-radio-checked-focus(){}
|
759
|
// @mixin hook-inverse-form-label(){}
|