1
// stylelint-disable selector-no-qualifying-type
10
flex-wrap: wrap; // For form validation feedback
15
> .form-control-plaintext,
18
position: relative; // For focus state's z-index
21
min-width: 0; // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
27
margin-left: -$input-border-width;
31
// Bring the "active" form control to the top of surrounding elements
32
> .form-control:focus,
33
> .custom-select:focus,
34
> .custom-file .custom-file-input:focus ~ .custom-file-label {
38
// Bring the custom file input above the label
39
> .custom-file .custom-file-input:focus {
45
&:not(:first-child) { @include border-left-radius(0); }
48
// Custom file inputs have more complex markup, thus requiring different
49
// border-radius overrides.
54
&:not(:last-child) .custom-file-label,
55
&:not(:last-child) .custom-file-label::after { @include border-right-radius(0); }
56
&:not(:first-child) .custom-file-label { @include border-left-radius(0); }
59
&:not(.has-validation) {
60
> .form-control:not(:last-child),
61
> .custom-select:not(:last-child),
62
> .custom-file:not(:last-child) .custom-file-label,
63
> .custom-file:not(:last-child) .custom-file-label::after {
64
@include border-right-radius(0);
69
> .form-control:nth-last-child(n + 3),
70
> .custom-select:nth-last-child(n + 3),
71
> .custom-file:nth-last-child(n + 3) .custom-file-label,
72
> .custom-file:nth-last-child(n + 3) .custom-file-label::after {
73
@include border-right-radius(0);
81
// While it requires one extra layer of HTML for each, dedicated prepend and
82
// append elements allow us to 1) be less clever, 2) simplify our selectors, and
83
// 3) support HTML5 form validation.
89
// Ensure buttons are always above inputs for more visually pleasing borders.
90
// This isn't needed for `.input-group-text` since it shares the same border-color
102
.btn + .input-group-text,
103
.input-group-text + .input-group-text,
104
.input-group-text + .btn {
105
margin-left: -$input-border-width;
109
.input-group-prepend { margin-right: -$input-border-width; }
110
.input-group-append { margin-left: -$input-border-width; }
115
// Serves as a catch-all element for any text or radio/checkbox input you wish
116
// to prepend or append to an input.
121
padding: $input-padding-y $input-padding-x;
122
margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
123
@include font-size($input-font-size); // Match inputs
124
font-weight: $font-weight-normal;
125
line-height: $input-line-height;
126
color: $input-group-addon-color;
129
background-color: $input-group-addon-bg;
130
border: $input-border-width solid $input-group-addon-border-color;
131
@include border-radius($input-border-radius);
133
// Nuke default margins from checkboxes and radios to vertically center within.
135
input[type="checkbox"] {
143
// Remix the default form control sizing classes into new ones for easier
146
.input-group-lg > .form-control:not(textarea),
147
.input-group-lg > .custom-select {
148
height: $input-height-lg;
151
.input-group-lg > .form-control,
152
.input-group-lg > .custom-select,
153
.input-group-lg > .input-group-prepend > .input-group-text,
154
.input-group-lg > .input-group-append > .input-group-text,
155
.input-group-lg > .input-group-prepend > .btn,
156
.input-group-lg > .input-group-append > .btn {
157
padding: $input-padding-y-lg $input-padding-x-lg;
158
@include font-size($input-font-size-lg);
159
line-height: $input-line-height-lg;
160
@include border-radius($input-border-radius-lg);
163
.input-group-sm > .form-control:not(textarea),
164
.input-group-sm > .custom-select {
165
height: $input-height-sm;
168
.input-group-sm > .form-control,
169
.input-group-sm > .custom-select,
170
.input-group-sm > .input-group-prepend > .input-group-text,
171
.input-group-sm > .input-group-append > .input-group-text,
172
.input-group-sm > .input-group-prepend > .btn,
173
.input-group-sm > .input-group-append > .btn {
174
padding: $input-padding-y-sm $input-padding-x-sm;
175
@include font-size($input-font-size-sm);
176
line-height: $input-line-height-sm;
177
@include border-radius($input-border-radius-sm);
180
.input-group-lg > .custom-select,
181
.input-group-sm > .custom-select {
182
padding-right: $custom-select-padding-x + $custom-select-indicator-padding;
186
// Prepend and append rounded corners
188
// These rulesets must come after the sizing ones to properly override sm and lg
189
// border-radius values when extending. They're more specific than we'd like
190
// with the `.input-group >` part, but without it, we cannot override the sizing.
193
.input-group > .input-group-prepend > .btn,
194
.input-group > .input-group-prepend > .input-group-text,
195
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn,
196
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text,
197
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn,
198
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text,
199
.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),
200
.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) {
201
@include border-right-radius(0);
204
.input-group > .input-group-append > .btn,
205
.input-group > .input-group-append > .input-group-text,
206
.input-group > .input-group-prepend:not(:first-child) > .btn,
207
.input-group > .input-group-prepend:not(:first-child) > .input-group-text,
208
.input-group > .input-group-prepend:first-child > .btn:not(:first-child),
209
.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) {
210
@include border-left-radius(0);