3 // --------------------------------------------------
6 // Normalize non-controls
8 // Restyle and baseline non-control form elements.
20 margin-bottom: @line-height-computed;
21 font-size: (@font-size-base * 1.5);
25 border-bottom: 1px solid @legend-border-color;
29 display: inline-block;
35 // Normalize form controls
37 // Override content-box in Normalize (* isn't specific enough)
38 input[type="search"] {
39 .box-sizing(border-box);
42 // Position radios and checkboxes better
44 input[type="checkbox"] {
46 margin-top: 1px \9; /* IE8-9 */
50 // Set the height of select and file controls to match text inputs
55 // Make multiple select elements height not fixed
61 // Fix optgroup Firefox bug per https://github.com/twbs/bootstrap/issues/7611
68 // Focus for select, file, radio, and checkbox
69 input[type="file"]:focus,
70 input[type="radio"]:focus,
71 input[type="checkbox"]:focus {
75 // Fix for Chrome number input
76 // Setting certain font-sizes causes the `I` bar to appear on hover of the bottom increment button.
77 // See https://github.com/twbs/bootstrap/issues/8350 for more.
78 input[type="number"] {
79 &::-webkit-outer-spin-button,
80 &::-webkit-inner-spin-button {
88 // Placeholder text gets special styles because when browsers invalidate entire
89 // lines if it doesn't understand a selector/
95 // Common form controls
97 // Shared size and type resets for form controls. Apply `.form-control` to any
98 // of the following form controls:
102 // input[type="text"]
103 // input[type="password"]
104 // input[type="datetime"]
105 // input[type="datetime-local"]
106 // input[type="date"]
107 // input[type="month"]
108 // input[type="time"]
109 // input[type="week"]
110 // input[type="number"]
111 // input[type="email"]
113 // input[type="search"]
115 // input[type="color"]
120 height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
121 padding: @padding-base-vertical @padding-base-horizontal;
122 font-size: @font-size-base;
123 line-height: @line-height-base;
125 vertical-align: middle;
126 background-color: @input-bg;
127 border: 1px solid @input-border;
128 border-radius: @input-border-radius;
129 .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
130 .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
133 border-color: rgba(82,168,236,.8);
135 .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
138 // Disabled and read-only inputs
139 // Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
140 // disabled if the fieldset is disabled. Due to implementation difficulty,
141 // we don't honor that edge case; we style them as disabled anyway.
144 fieldset[disabled] & {
146 background-color: @input-bg-disabled;
149 // Reset height for `textarea`s
158 // Designed to help with the organization and spacing of vertical forms. For
159 // horizontal forms, use the predefined grid classes.
166 // Checkboxes and radios
168 // Indent the labels to position radios/checkboxes as hanging controls.
173 min-height: @line-height-computed; // clear the floating input if there is no label text
177 vertical-align: middle;
185 .radio input[type="radio"],
186 .radio-inline input[type="radio"],
187 .checkbox input[type="checkbox"],
188 .checkbox-inline input[type="checkbox"] {
193 .checkbox + .checkbox {
194 margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
197 // Radios and checkboxes on same line
200 display: inline-block;
203 vertical-align: middle;
207 .radio-inline + .radio-inline,
208 .checkbox-inline + .checkbox-inline {
210 margin-left: 10px; // space out consecutive inline controls
215 // Form control sizing
217 // Relative text size, padding, and border-radii changes for form controls. For
218 // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
219 // element gets special love because it's special, and that's a fact!
223 height: @input-height-large;
224 padding: @padding-large-vertical @padding-large-horizontal;
225 font-size: @font-size-large;
226 border-radius: @border-radius-large;
229 height: @input-height-small;
230 padding: @padding-small-vertical @padding-small-horizontal;
231 font-size: @font-size-small;
232 border-radius: @border-radius-small;
237 height: @input-height-large;
238 line-height: @input-height-large;
241 height: @input-height-small;
242 line-height: @input-height-small;
247 // Form control feedback states
249 // Apply contextual and semantic states to individual form controls.
253 .form-control-validation(@state-warning-text, @state-warning-text, @state-warning-bg);
257 .form-control-validation(@state-danger-text, @state-danger-text, @state-danger-bg);
261 .form-control-validation(@state-success-text, @state-success-text, @state-success-bg);
267 // Apply to any element you wish to create light text for placement immediately
268 // below a form control. Use for general help, formatting, or instructional text.
271 display: block; // account for any element using help-block
274 color: lighten(@text-color, 25%); // lighten the text some for contrast
280 // --------------------------------------------------
283 // -------------------------
286 border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
288 // Undo padding and float of grid classes
301 // Display as table-cell
302 // -------------------------
305 .input-group .form-control {
308 &:not(:first-child):not(:last-child) {
312 // Addon and addon wrapper for buttons
317 vertical-align: middle; // Match the inputs
321 // -------------------------
323 .box-sizing(border-box);
324 padding: @padding-base-vertical @padding-base-horizontal;
325 font-size: @font-size-base;
327 line-height: @line-height-base;
329 background-color: @gray-lighter;
330 border: 1px solid @input-group-addon-border-color;
331 border-radius: @border-radius-base;
334 padding: @padding-small-vertical @padding-small-horizontal;
335 font-size: @font-size-small;
336 border-radius: @border-radius-small;
339 padding: @padding-large-vertical @padding-large-horizontal;
340 font-size: @font-size-large;
341 border-radius: @border-radius-large;
345 // Reset rounded corners
346 .input-group .form-control:first-child,
347 .input-group-addon:first-child,
348 .input-group-btn:first-child > .btn,
349 .input-group-btn:first-child > .dropdown-toggle,
350 .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
351 .border-right-radius(0);
353 .input-group-addon:first-child {
356 .input-group .form-control:last-child,
357 .input-group-addon:last-child,
358 .input-group-btn:last-child > .btn,
359 .input-group-btn:last-child > .dropdown-toggle,
360 .input-group-btn:first-child > .btn:not(:first-child) {
361 .border-left-radius(0);
363 .input-group-addon:last-child {
367 // Button input groups
368 // -------------------------
373 .input-group-btn > .btn {
375 // Jankily prevent input button groups from wrapping
379 // Bring the "active" button to the front
388 // --------------------------------------------------
394 display: inline-block;
405 // --------------------------------------------------
406 // Horizontal forms are built on grid classes.
408 .form-horizontal .control-label {
418 // Only right align form labels here when the columns stop stacking
419 @media (min-width: @screen-tablet) {
420 .form-horizontal .control-label {