Merge "Add qtip job to pod zte-virtual6"
[releng.git] / utils / test / testapi / 3rd_party / static / testapi-ui / assets / lib / bootstrap / less / forms.less
1 //
2 // Forms
3 // --------------------------------------------------
4
5
6 // Normalize non-controls
7 //
8 // Restyle and baseline non-control form elements.
9
10 fieldset {
11   padding: 0;
12   margin: 0;
13   border: 0;
14   // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
15   // so we reset that to ensure it behaves more like a standard block element.
16   // See https://github.com/twbs/bootstrap/issues/12359.
17   min-width: 0;
18 }
19
20 legend {
21   display: block;
22   width: 100%;
23   padding: 0;
24   margin-bottom: @line-height-computed;
25   font-size: (@font-size-base * 1.5);
26   line-height: inherit;
27   color: @legend-color;
28   border: 0;
29   border-bottom: 1px solid @legend-border-color;
30 }
31
32 label {
33   display: inline-block;
34   max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)
35   margin-bottom: 5px;
36   font-weight: bold;
37 }
38
39
40 // Normalize form controls
41 //
42 // While most of our form styles require extra classes, some basic normalization
43 // is required to ensure optimum display with or without those classes to better
44 // address browser inconsistencies.
45
46 // Override content-box in Normalize (* isn't specific enough)
47 input[type="search"] {
48   .box-sizing(border-box);
49 }
50
51 // Position radios and checkboxes better
52 input[type="radio"],
53 input[type="checkbox"] {
54   margin: 4px 0 0;
55   margin-top: 1px \9; // IE8-9
56   line-height: normal;
57 }
58
59 // Set the height of file controls to match text inputs
60 input[type="file"] {
61   display: block;
62 }
63
64 // Make range inputs behave like textual form controls
65 input[type="range"] {
66   display: block;
67   width: 100%;
68 }
69
70 // Make multiple select elements height not fixed
71 select[multiple],
72 select[size] {
73   height: auto;
74 }
75
76 // Focus for file, radio, and checkbox
77 input[type="file"]:focus,
78 input[type="radio"]:focus,
79 input[type="checkbox"]:focus {
80   .tab-focus();
81 }
82
83 // Adjust output element
84 output {
85   display: block;
86   padding-top: (@padding-base-vertical + 1);
87   font-size: @font-size-base;
88   line-height: @line-height-base;
89   color: @input-color;
90 }
91
92
93 // Common form controls
94 //
95 // Shared size and type resets for form controls. Apply `.form-control` to any
96 // of the following form controls:
97 //
98 // select
99 // textarea
100 // input[type="text"]
101 // input[type="password"]
102 // input[type="datetime"]
103 // input[type="datetime-local"]
104 // input[type="date"]
105 // input[type="month"]
106 // input[type="time"]
107 // input[type="week"]
108 // input[type="number"]
109 // input[type="email"]
110 // input[type="url"]
111 // input[type="search"]
112 // input[type="tel"]
113 // input[type="color"]
114
115 .form-control {
116   display: block;
117   width: 100%;
118   height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
119   padding: @padding-base-vertical @padding-base-horizontal;
120   font-size: @font-size-base;
121   line-height: @line-height-base;
122   color: @input-color;
123   background-color: @input-bg;
124   background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
125   border: 1px solid @input-border;
126   border-radius: @input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of <select>s in CSS.
127   .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
128   .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
129
130   // Customize the `:focus` state to imitate native WebKit styles.
131   .form-control-focus();
132
133   // Placeholder
134   .placeholder();
135
136   // Disabled and read-only inputs
137   //
138   // HTML5 says that controls under a fieldset > legend:first-child won't be
139   // disabled if the fieldset is disabled. Due to implementation difficulty, we
140   // don't honor that edge case; we style them as disabled anyway.
141   &[disabled],
142   &[readonly],
143   fieldset[disabled] & {
144     cursor: @cursor-disabled;
145     background-color: @input-bg-disabled;
146     opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655
147   }
148
149   // Reset height for `textarea`s
150   textarea& {
151     height: auto;
152   }
153 }
154
155
156 // Search inputs in iOS
157 //
158 // This overrides the extra rounded corners on search inputs in iOS so that our
159 // `.form-control` class can properly style them. Note that this cannot simply
160 // be added to `.form-control` as it's not specific enough. For details, see
161 // https://github.com/twbs/bootstrap/issues/11586.
162
163 input[type="search"] {
164   -webkit-appearance: none;
165 }
166
167
168 // Special styles for iOS temporal inputs
169 //
170 // In Mobile Safari, setting `display: block` on temporal inputs causes the
171 // text within the input to become vertically misaligned. As a workaround, we
172 // set a pixel line-height that matches the given height of the input, but only
173 // for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848
174
175 @media screen and (-webkit-min-device-pixel-ratio: 0) {
176   input[type="date"],
177   input[type="time"],
178   input[type="datetime-local"],
179   input[type="month"] {
180     line-height: @input-height-base;
181
182     &.input-sm,
183     .input-group-sm & {
184       line-height: @input-height-small;
185     }
186
187     &.input-lg,
188     .input-group-lg & {
189       line-height: @input-height-large;
190     }
191   }
192 }
193
194
195 // Form groups
196 //
197 // Designed to help with the organization and spacing of vertical forms. For
198 // horizontal forms, use the predefined grid classes.
199
200 .form-group {
201   margin-bottom: 15px;
202 }
203
204
205 // Checkboxes and radios
206 //
207 // Indent the labels to position radios/checkboxes as hanging controls.
208
209 .radio,
210 .checkbox {
211   position: relative;
212   display: block;
213   margin-top: 10px;
214   margin-bottom: 10px;
215
216   label {
217     min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text
218     padding-left: 20px;
219     margin-bottom: 0;
220     font-weight: normal;
221     cursor: pointer;
222   }
223 }
224 .radio input[type="radio"],
225 .radio-inline input[type="radio"],
226 .checkbox input[type="checkbox"],
227 .checkbox-inline input[type="checkbox"] {
228   position: absolute;
229   margin-left: -20px;
230   margin-top: 4px \9;
231 }
232
233 .radio + .radio,
234 .checkbox + .checkbox {
235   margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
236 }
237
238 // Radios and checkboxes on same line
239 .radio-inline,
240 .checkbox-inline {
241   display: inline-block;
242   padding-left: 20px;
243   margin-bottom: 0;
244   vertical-align: middle;
245   font-weight: normal;
246   cursor: pointer;
247 }
248 .radio-inline + .radio-inline,
249 .checkbox-inline + .checkbox-inline {
250   margin-top: 0;
251   margin-left: 10px; // space out consecutive inline controls
252 }
253
254 // Apply same disabled cursor tweak as for inputs
255 // Some special care is needed because <label>s don't inherit their parent's `cursor`.
256 //
257 // Note: Neither radios nor checkboxes can be readonly.
258 input[type="radio"],
259 input[type="checkbox"] {
260   &[disabled],
261   &.disabled,
262   fieldset[disabled] & {
263     cursor: @cursor-disabled;
264   }
265 }
266 // These classes are used directly on <label>s
267 .radio-inline,
268 .checkbox-inline {
269   &.disabled,
270   fieldset[disabled] & {
271     cursor: @cursor-disabled;
272   }
273 }
274 // These classes are used on elements with <label> descendants
275 .radio,
276 .checkbox {
277   &.disabled,
278   fieldset[disabled] & {
279     label {
280       cursor: @cursor-disabled;
281     }
282   }
283 }
284
285
286 // Static form control text
287 //
288 // Apply class to a `p` element to make any string of text align with labels in
289 // a horizontal form layout.
290
291 .form-control-static {
292   // Size it appropriately next to real form controls
293   padding-top: (@padding-base-vertical + 1);
294   padding-bottom: (@padding-base-vertical + 1);
295   // Remove default margin from `p`
296   margin-bottom: 0;
297
298   &.input-lg,
299   &.input-sm {
300     padding-left: 0;
301     padding-right: 0;
302   }
303 }
304
305
306 // Form control sizing
307 //
308 // Build on `.form-control` with modifier classes to decrease or increase the
309 // height and font-size of form controls.
310 //
311 // The `.form-group-* form-control` variations are sadly duplicated to avoid the
312 // issue documented in https://github.com/twbs/bootstrap/issues/15074.
313
314 .input-sm {
315   .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small);
316 }
317 .form-group-sm {
318   .form-control {
319     .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small);
320   }
321   .form-control-static {
322     height: @input-height-small;
323     padding: @padding-small-vertical @padding-small-horizontal;
324     font-size: @font-size-small;
325     line-height: @line-height-small;
326   }
327 }
328
329 .input-lg {
330   .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large);
331 }
332 .form-group-lg {
333   .form-control {
334     .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large);
335   }
336   .form-control-static {
337     height: @input-height-large;
338     padding: @padding-large-vertical @padding-large-horizontal;
339     font-size: @font-size-large;
340     line-height: @line-height-large;
341   }
342 }
343
344
345 // Form control feedback states
346 //
347 // Apply contextual and semantic states to individual form controls.
348
349 .has-feedback {
350   // Enable absolute positioning
351   position: relative;
352
353   // Ensure icons don't overlap text
354   .form-control {
355     padding-right: (@input-height-base * 1.25);
356   }
357 }
358 // Feedback icon (requires .glyphicon classes)
359 .form-control-feedback {
360   position: absolute;
361   top: 0;
362   right: 0;
363   z-index: 2; // Ensure icon is above input groups
364   display: block;
365   width: @input-height-base;
366   height: @input-height-base;
367   line-height: @input-height-base;
368   text-align: center;
369   pointer-events: none;
370 }
371 .input-lg + .form-control-feedback {
372   width: @input-height-large;
373   height: @input-height-large;
374   line-height: @input-height-large;
375 }
376 .input-sm + .form-control-feedback {
377   width: @input-height-small;
378   height: @input-height-small;
379   line-height: @input-height-small;
380 }
381
382 // Feedback states
383 .has-success {
384   .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
385 }
386 .has-warning {
387   .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
388 }
389 .has-error {
390   .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
391 }
392
393 // Reposition feedback icon if input has visible label above
394 .has-feedback label {
395
396   & ~ .form-control-feedback {
397      top: (@line-height-computed + 5); // Height of the `label` and its margin
398   }
399   &.sr-only ~ .form-control-feedback {
400      top: 0;
401   }
402 }
403
404
405 // Help text
406 //
407 // Apply to any element you wish to create light text for placement immediately
408 // below a form control. Use for general help, formatting, or instructional text.
409
410 .help-block {
411   display: block; // account for any element using help-block
412   margin-top: 5px;
413   margin-bottom: 10px;
414   color: lighten(@text-color, 25%); // lighten the text some for contrast
415 }
416
417
418 // Inline forms
419 //
420 // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
421 // forms begin stacked on extra small (mobile) devices and then go inline when
422 // viewports reach <768px.
423 //
424 // Requires wrapping inputs and labels with `.form-group` for proper display of
425 // default HTML form controls and our custom form controls (e.g., input groups).
426 //
427 // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
428
429 .form-inline {
430
431   // Kick in the inline
432   @media (min-width: @screen-sm-min) {
433     // Inline-block all the things for "inline"
434     .form-group {
435       display: inline-block;
436       margin-bottom: 0;
437       vertical-align: middle;
438     }
439
440     // In navbar-form, allow folks to *not* use `.form-group`
441     .form-control {
442       display: inline-block;
443       width: auto; // Prevent labels from stacking above inputs in `.form-group`
444       vertical-align: middle;
445     }
446
447     // Make static controls behave like regular ones
448     .form-control-static {
449       display: inline-block;
450     }
451
452     .input-group {
453       display: inline-table;
454       vertical-align: middle;
455
456       .input-group-addon,
457       .input-group-btn,
458       .form-control {
459         width: auto;
460       }
461     }
462
463     // Input groups need that 100% width though
464     .input-group > .form-control {
465       width: 100%;
466     }
467
468     .control-label {
469       margin-bottom: 0;
470       vertical-align: middle;
471     }
472
473     // Remove default margin on radios/checkboxes that were used for stacking, and
474     // then undo the floating of radios and checkboxes to match.
475     .radio,
476     .checkbox {
477       display: inline-block;
478       margin-top: 0;
479       margin-bottom: 0;
480       vertical-align: middle;
481
482       label {
483         padding-left: 0;
484       }
485     }
486     .radio input[type="radio"],
487     .checkbox input[type="checkbox"] {
488       position: relative;
489       margin-left: 0;
490     }
491
492     // Re-override the feedback icon.
493     .has-feedback .form-control-feedback {
494       top: 0;
495     }
496   }
497 }
498
499
500 // Horizontal forms
501 //
502 // Horizontal forms are built on grid classes and allow you to create forms with
503 // labels on the left and inputs on the right.
504
505 .form-horizontal {
506
507   // Consistent vertical alignment of radios and checkboxes
508   //
509   // Labels also get some reset styles, but that is scoped to a media query below.
510   .radio,
511   .checkbox,
512   .radio-inline,
513   .checkbox-inline {
514     margin-top: 0;
515     margin-bottom: 0;
516     padding-top: (@padding-base-vertical + 1); // Default padding plus a border
517   }
518   // Account for padding we're adding to ensure the alignment and of help text
519   // and other content below items
520   .radio,
521   .checkbox {
522     min-height: (@line-height-computed + (@padding-base-vertical + 1));
523   }
524
525   // Make form groups behave like rows
526   .form-group {
527     .make-row();
528   }
529
530   // Reset spacing and right align labels, but scope to media queries so that
531   // labels on narrow viewports stack the same as a default form example.
532   @media (min-width: @screen-sm-min) {
533     .control-label {
534       text-align: right;
535       margin-bottom: 0;
536       padding-top: (@padding-base-vertical + 1); // Default padding plus a border
537     }
538   }
539
540   // Validation states
541   //
542   // Reposition the icon because it's now within a grid column and columns have
543   // `position: relative;` on them. Also accounts for the grid gutter padding.
544   .has-feedback .form-control-feedback {
545     right: (@grid-gutter-width / 2);
546   }
547
548   // Form group sizes
549   //
550   // Quick utility class for applying `.input-lg` and `.input-sm` styles to the
551   // inputs and labels within a `.form-group`.
552   .form-group-lg {
553     @media (min-width: @screen-sm-min) {
554       .control-label {
555         padding-top: ((@padding-large-vertical * @line-height-large) + 1);
556       }
557     }
558   }
559   .form-group-sm {
560     @media (min-width: @screen-sm-min) {
561       .control-label {
562         padding-top: (@padding-small-vertical + 1);
563       }
564     }
565   }
566 }