// // Input Groups //-------------- .input-group { position: relative; display: flex; flex-wrap: wrap; align-items: center; width: 100%; > .form-control, > .custom-select, > .custom-file { position: relative; // For focus state's z-index flex: 1 1 auto; // Add width 1% and flex-basis auto to ensure that button will not wrap out // the column. Applies to IE Edge+ and Firefox. Chrome does not require this. width: 1%; margin-bottom: 0; // Bring the "active" form control to the top of surrounding elements &:focus { z-index: 3; } + .form-control, + .custom-select, + .custom-file { margin-left: -$input-border-width; } } > .form-control, > .custom-select{ &:not(:last-child) { border-bottom-right-radius: 0; border-top-right-radius: 0; } &:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } } // Custom file inputs have more complex markup, thus requiring different // border-radius overrides. > .custom-file { display: flex; align-items: center; &:not(:last-child) .custom-file-label, &:not(:last-child) .custom-file-label::after { border-bottom-right-radius: 0; border-top-right-radius: 0; } &:not(:first-child) .custom-file-label, &:not(:first-child) .custom-file-label::after { border-bottom-left-radius: 0; border-top-left-radius: 0; } } > .select2-container { &.atum-select2, &.atum-enhanced-select { z-index: 0; .select2-selection--single { border-bottom-left-radius: 0; border-top-left-radius: 0; border-bottom-right-radius: $input-border-radius; border-top-right-radius: $input-border-radius; } } } &.invalid { input[type=text], input[type=number], textarea, select, .select2-container { border-color: $danger; background-color: transparentize($danger, 0.85); } } } // Prepend and append // // While it requires one extra layer of HTML for each, dedicated prepend and // append elements allow us to 1) be less clever, 2) simplify our selectors, and // 3) support HTML5 form validation. .input-group-prepend, .input-group-append { display: flex; z-index: 1; border: $input-border-width solid $input-border-color; .input-group.invalid & { border-color: $danger; } // Ensure buttons are always above inputs for more visually pleasing borders. // This isn't needed for `.input-group-text` since it shares the same border-color // as our inputs. .btn { position: relative; z-index: 2; } .btn + .btn, .btn + .input-group-text, .input-group-text + .input-group-text, .input-group-text + .btn { margin-left: -$input-border-width; } } .input-group-prepend { border-right: none } .input-group-append { border-left: none } // Textual addons // // Serves as a catch-all element for any text or radio/checkbox input you wish // to prepend or append to an input. .input-group-text { display: flex; align-items: center; padding: $input-padding-y $input-padding-x; margin-bottom: 0; // Allow use of