1 // stylelint-disable selector-no-qualifying-type
4 // Textual form controls
10 height: $input-height;
11 padding: $input-padding-y $input-padding-x;
12 font-family: $input-font-family;
13 @include font-size($input-font-size);
14 font-weight: $input-font-weight;
15 line-height: $input-line-height;
17 background-color: $input-bg;
18 background-clip: padding-box;
19 border: $input-border-width solid $input-border-color;
21 // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
22 @include border-radius($input-border-radius, 0);
24 @include box-shadow($input-box-shadow);
25 @include transition($input-transition);
27 // Unstyle the caret on `<select>`s in IE10+.
29 background-color: transparent;
33 // Remove select outline from select box in FF
36 text-shadow: 0 0 0 $input-color;
39 // Customize the `:focus` state to imitate native WebKit styles.
40 @include form-control-focus($ignore-warning: true);
44 color: $input-placeholder-color;
45 // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
49 // Disabled and read-only inputs
51 // HTML5 says that controls under a fieldset > legend:first-child won't be
52 // disabled if the fieldset is disabled. Due to implementation difficulty, we
53 // don't honor that edge case; we style them as disabled anyway.
56 background-color: $input-disabled-bg;
57 // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
64 input[type="datetime-local"],
67 appearance: none; // Fix appearance for date inputs in Safari
73 // Suppress the nested default white text on blue background highlight given to
74 // the selected option text when the (still closed) <select> receives focus
75 // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
76 // match the appearance of the native widget.
77 // See https://github.com/twbs/bootstrap/issues/19398.
79 background-color: $input-bg;
83 // Make file inputs better match text inputs by forcing them to new lines.
95 // For use with horizontal and inline forms, when you need the label (or legend)
96 // text to align with the form controls.
98 padding-top: add($input-padding-y, $input-border-width);
99 padding-bottom: add($input-padding-y, $input-border-width);
100 margin-bottom: 0; // Override the `<label>/<legend>` default
101 @include font-size(inherit); // Override the `<legend>` default
102 line-height: $input-line-height;
106 padding-top: add($input-padding-y-lg, $input-border-width);
107 padding-bottom: add($input-padding-y-lg, $input-border-width);
108 @include font-size($input-font-size-lg);
109 line-height: $input-line-height-lg;
113 padding-top: add($input-padding-y-sm, $input-border-width);
114 padding-bottom: add($input-padding-y-sm, $input-border-width);
115 @include font-size($input-font-size-sm);
116 line-height: $input-line-height-sm;
120 // Readonly controls as plain text
122 // Apply class to a readonly input to make it appear like regular plain
123 // text (without any border, background color, focus indicator)
125 .form-control-plaintext {
128 padding: $input-padding-y 0;
129 margin-bottom: 0; // match inputs if this class comes on inputs with default margins
130 @include font-size($input-font-size);
131 line-height: $input-line-height;
132 color: $input-plaintext-color;
133 background-color: transparent;
134 border: solid transparent;
135 border-width: $input-border-width 0;
145 // Form control sizing
147 // Build on `.form-control` with modifier classes to decrease or increase the
148 // height and font-size of form controls.
150 // Repeated in `_input_group.scss` to avoid Sass extend issues.
153 height: $input-height-sm;
154 padding: $input-padding-y-sm $input-padding-x-sm;
155 @include font-size($input-font-size-sm);
156 line-height: $input-line-height-sm;
157 @include border-radius($input-border-radius-sm);
161 height: $input-height-lg;
162 padding: $input-padding-y-lg $input-padding-x-lg;
163 @include font-size($input-font-size-lg);
164 line-height: $input-line-height-lg;
165 @include border-radius($input-border-radius-lg);
168 // stylelint-disable-next-line no-duplicate-selectors
169 select.form-control {
176 textarea.form-control {
182 // Designed to help with the organization and spacing of vertical forms. For
183 // horizontal forms, use the predefined grid classes.
186 margin-bottom: $form-group-margin-bottom;
191 margin-top: $form-text-margin-top;
197 // Special replacement for our grid system's `.row` for tighter form layouts.
202 margin-right: -$form-grid-gutter-width / 2;
203 margin-left: -$form-grid-gutter-width / 2;
207 padding-right: $form-grid-gutter-width / 2;
208 padding-left: $form-grid-gutter-width / 2;
213 // Checkboxes and radios
215 // Indent the labels to position radios/checkboxes as hanging controls.
220 padding-left: $form-check-input-gutter;
225 margin-top: $form-check-input-margin-y;
226 margin-left: -$form-check-input-gutter;
228 // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247
229 &[disabled] ~ .form-check-label,
230 &:disabled ~ .form-check-label {
236 margin-bottom: 0; // Override default `<label>` bottom margin
240 display: inline-flex;
242 padding-left: 0; // Override base .form-check
243 margin-right: $form-check-inline-margin-x;
245 // Undo .form-check-input defaults and add some `margin-right`.
249 margin-right: $form-check-inline-input-margin-x;
256 padding-right: calc(1.5em + 0.75rem);
257 background-repeat: no-repeat;
258 background-position: right calc(0.375em + 0.1875rem) center;
259 background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
262 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTDExMTAwMDExMTMzMzExMTExMTAwMDAwMDIyMjIyMjAwMDIyMtDcR4EAAAAMdFJOUwDfIO86ksUQf1ivcKwSZ8wAAABaSURBVBjTY2AYcMB4Bg4EUDlMMtZgFezNBxUY2GXOSDgwMDA1nzlWwMB6cOKZw2lpNmcyZQIYmI0YvEAaljAoA/UoMLAedXGJCQCxQKYfYWDwMYBZJQDBlAMAlfIjX/5EzDQAAAAASUVORK5CYII=') !important;
265 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUdwTDAwMDAwMDExMTExMTExMTExMTIyMjExMTAwMDAwMDIyMjIyMjAwMDIyMm633p8AAAAOdFJOUwAgEN9BwKGQzzB/YO9gZ/nLrQAAAK1JREFUGNOdzzEKwkAUhOF1QcUUsiBaiVikDnqBLSy0E71AULAOFp4jeALxJIIXEc0mEhH+M/jW6AF0qvmqN0+pPzOz5ebbu0jWVW9ZD2fe6FBMwpSz7zXLUQ+buKGggVO6MClbwYCn0ixO5IKETAU8IgoBXGcJeRsEMdkB8oi7YM6zDqMLN0GTshYXxrISaMtWm6C6o/qUkzBmrD4T/LZ9tbTnsfz+ME3d7of3X1WUUZSrxwjQAAAAAElFTkSuQmCC') !important;
272 // Provide feedback to users when form field values are valid or invalid. Works
273 // primarily for client-side validation via scoped `:invalid` and `:valid`
274 // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
275 // server side validation.
277 @each $state, $data in $form-validation-states {
278 @include form-validation-state($state, map-get($data, color), map-get($data, icon));
283 // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
284 // forms begin stacked on extra small (mobile) devices and then go inline when
285 // viewports reach <768px.
287 // Requires wrapping inputs and labels with `.form-group` for proper display of
288 // default HTML form controls and our custom form controls (e.g., input groups).
293 align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
295 // Because we use flex, the initial sizing of checkboxes is collapsed and
296 // doesn't occupy the full-width (which is what we want for xs grid tier),
297 // so we force that here.
302 // Kick in the inline
303 @include media-breakpoint-up(sm) {
307 justify-content: center;
311 // Inline-block all the things for "inline"
320 // Allow folks to *not* use `.form-group`
322 display: inline-block;
323 width: auto; // Prevent labels from stacking above inputs in `.form-group`
324 vertical-align: middle;
327 // Make static controls behave like regular ones
328 .form-control-plaintext {
329 display: inline-block;
337 // Remove default margin on radios/checkboxes that were used for stacking, and
338 // then undo the floating of radios and checkboxes to match.
342 justify-content: center;
350 margin-right: $form-check-input-margin-x;
356 justify-content: center;
358 .custom-control-label {