2017-10-02 23:34:56 -04:00
|
|
|
// stylelint-disable selector-no-qualifying-type
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
2013-07-27 21:56:31 -04:00
|
|
|
// Base styles
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
|
|
|
|
2013-07-27 21:56:31 -04:00
|
|
|
.input-group {
|
2015-04-27 04:43:30 -04:00
|
|
|
position: relative;
|
2016-12-21 23:26:17 -05:00
|
|
|
display: flex;
|
2017-10-02 13:13:09 -04:00
|
|
|
align-items: stretch;
|
2015-12-09 03:40:32 -05:00
|
|
|
width: 100%;
|
2015-04-27 04:43:30 -04:00
|
|
|
|
2013-07-27 21:56:31 -04:00
|
|
|
.form-control {
|
2014-02-11 17:20:01 -05:00
|
|
|
// Ensure that the input is always above the *appended* addon button for
|
|
|
|
// proper border colors.
|
|
|
|
position: relative;
|
2017-10-20 03:01:29 -04:00
|
|
|
z-index: 1;
|
2016-12-21 23:26:17 -05:00
|
|
|
flex: 1 1 auto;
|
|
|
|
// Add width 1% and flex-basis auto to ensure that button will not wrap out
|
2016-12-22 16:25:41 -05:00
|
|
|
// the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
|
2016-12-21 23:26:17 -05:00
|
|
|
width: 1%;
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
2015-11-15 17:09:12 -05:00
|
|
|
// Bring the "active" form control to the front
|
|
|
|
@include hover-focus-active {
|
2017-10-20 03:01:29 -04:00
|
|
|
z-index: 2;
|
2015-11-15 17:09:12 -05:00
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
.input-group-addon,
|
|
|
|
.input-group-btn,
|
2017-10-19 16:04:39 -04:00
|
|
|
.input-group .form-control,
|
|
|
|
.input-group .custom-select,
|
|
|
|
.input-group .custom-file {
|
2017-10-02 13:13:09 -04:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2017-10-19 16:04:39 -04:00
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
@include border-radius(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-19 16:04:39 -04:00
|
|
|
.input-group .custom-file {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-group .custom-select,
|
|
|
|
.input-group .custom-file {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
.input-group-addon,
|
|
|
|
.input-group-btn {
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
2013-08-12 17:03:57 -04:00
|
|
|
// Sizing options
|
|
|
|
//
|
|
|
|
// Remix the default form control sizing classes into new ones for easier
|
|
|
|
// manipulation.
|
|
|
|
|
|
|
|
.input-group-lg > .form-control,
|
2013-08-13 00:27:15 -04:00
|
|
|
.input-group-lg > .input-group-addon,
|
2014-04-26 02:30:50 -04:00
|
|
|
.input-group-lg > .input-group-btn > .btn {
|
2015-04-23 04:14:43 -04:00
|
|
|
@extend .form-control-lg;
|
2014-04-26 02:30:50 -04:00
|
|
|
}
|
2013-08-12 17:03:57 -04:00
|
|
|
.input-group-sm > .form-control,
|
2013-08-13 00:27:15 -04:00
|
|
|
.input-group-sm > .input-group-addon,
|
2014-04-26 02:30:50 -04:00
|
|
|
.input-group-sm > .input-group-btn > .btn {
|
2015-04-23 04:14:43 -04:00
|
|
|
@extend .form-control-sm;
|
2014-04-26 02:30:50 -04:00
|
|
|
}
|
2013-08-12 17:03:57 -04:00
|
|
|
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
2013-07-27 21:56:31 -04:00
|
|
|
// Text input groups
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
|
|
|
|
2013-07-27 21:56:31 -04:00
|
|
|
.input-group-addon {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y $input-padding-x;
|
2016-01-23 06:30:21 -05:00
|
|
|
margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
|
2017-01-03 16:51:06 -05:00
|
|
|
font-size: $font-size-base; // Match inputs
|
2016-10-19 15:41:27 -04:00
|
|
|
font-weight: $font-weight-normal;
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height;
|
2017-07-13 14:11:37 -04:00
|
|
|
color: $input-group-addon-color;
|
2013-07-27 21:56:31 -04:00
|
|
|
text-align: center;
|
2014-12-02 17:02:35 -05:00
|
|
|
background-color: $input-group-addon-bg;
|
2017-10-19 03:05:07 -04:00
|
|
|
border: $input-border-width solid $input-group-addon-border-color;
|
2016-07-28 00:12:44 -04:00
|
|
|
@include border-radius($input-border-radius);
|
2013-07-27 21:56:31 -04:00
|
|
|
|
|
|
|
// Sizing
|
2015-04-23 04:14:43 -04:00
|
|
|
&.form-control-sm {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y-sm $input-padding-x-sm;
|
2014-12-02 17:02:35 -05:00
|
|
|
font-size: $font-size-sm;
|
2016-07-28 00:12:44 -04:00
|
|
|
@include border-radius($input-border-radius-sm);
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
2017-03-28 12:28:27 -04:00
|
|
|
|
2015-04-23 04:14:43 -04:00
|
|
|
&.form-control-lg {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y-lg $input-padding-x-lg;
|
2014-12-02 17:02:35 -05:00
|
|
|
font-size: $font-size-lg;
|
2016-07-28 00:12:44 -04:00
|
|
|
@include border-radius($input-border-radius-lg);
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Nuke default margins from checkboxes and radios to vertically center within.
|
|
|
|
input[type="radio"],
|
|
|
|
input[type="checkbox"] {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
|
|
|
|
//
|
2013-07-27 21:56:31 -04:00
|
|
|
// Reset rounded corners
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
|
|
|
|
2015-12-09 03:40:32 -05:00
|
|
|
.input-group .form-control:not(:last-child),
|
2017-10-19 16:04:39 -04:00
|
|
|
.input-group .custom-select:not(:last-child),
|
|
|
|
.input-group .custom-file:not(:last-child) .custom-file-control::before,
|
2015-12-09 03:40:32 -05:00
|
|
|
.input-group-addon:not(:last-child),
|
|
|
|
.input-group-btn:not(:last-child) > .btn,
|
|
|
|
.input-group-btn:not(:last-child) > .btn-group > .btn,
|
|
|
|
.input-group-btn:not(:last-child) > .dropdown-toggle,
|
|
|
|
.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle),
|
|
|
|
.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn {
|
2014-12-02 17:02:35 -05:00
|
|
|
@include border-right-radius(0);
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
2017-10-19 16:04:39 -04:00
|
|
|
|
2015-12-11 13:22:48 -05:00
|
|
|
.input-group-addon:not(:last-child) {
|
2013-07-27 21:56:31 -04:00
|
|
|
border-right: 0;
|
|
|
|
}
|
2017-10-19 16:04:39 -04:00
|
|
|
|
2015-12-09 03:40:32 -05:00
|
|
|
.input-group .form-control:not(:first-child),
|
2017-10-19 16:04:39 -04:00
|
|
|
.input-group .custom-select:not(:first-child),
|
|
|
|
.input-group .custom-file:not(:first-child) .custom-file-control,
|
2015-12-09 03:40:32 -05:00
|
|
|
.input-group-addon:not(:first-child),
|
|
|
|
.input-group-btn:not(:first-child) > .btn,
|
|
|
|
.input-group-btn:not(:first-child) > .btn-group > .btn,
|
|
|
|
.input-group-btn:not(:first-child) > .dropdown-toggle,
|
|
|
|
.input-group-btn:not(:last-child) > .btn:not(:first-child),
|
|
|
|
.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn {
|
2014-12-02 17:02:35 -05:00
|
|
|
@include border-left-radius(0);
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
2017-10-19 16:04:39 -04:00
|
|
|
|
|
|
|
.form-control,
|
|
|
|
.custom-select,
|
|
|
|
.custom-file {
|
|
|
|
+ .input-group-addon:not(:first-child) {
|
|
|
|
border-left: 0;
|
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
2013-07-27 21:56:31 -04:00
|
|
|
// Button input groups
|
2015-04-18 14:38:47 -04:00
|
|
|
//
|
|
|
|
|
2013-07-27 21:56:31 -04:00
|
|
|
.input-group-btn {
|
|
|
|
position: relative;
|
2017-10-02 13:13:09 -04:00
|
|
|
align-items: stretch;
|
2013-12-15 18:07:38 -05:00
|
|
|
// Jankily prevent input button groups from wrapping with `white-space` and
|
|
|
|
// `font-size` in combination with `inline-block` on buttons.
|
2013-12-10 10:47:12 -05:00
|
|
|
font-size: 0;
|
2013-07-27 21:56:31 -04:00
|
|
|
white-space: nowrap;
|
2013-09-06 12:50:38 -04:00
|
|
|
|
2013-12-15 18:07:38 -05:00
|
|
|
// Negative margin for spacing, position for bringing hovered/focused/actived
|
|
|
|
// element above the siblings.
|
2013-11-07 14:58:17 -05:00
|
|
|
> .btn {
|
|
|
|
position: relative;
|
2016-10-27 16:40:55 -04:00
|
|
|
|
2013-11-07 14:58:17 -05:00
|
|
|
+ .btn {
|
2017-10-19 03:05:07 -04:00
|
|
|
margin-left: (-$input-border-width);
|
2013-11-07 14:58:17 -05:00
|
|
|
}
|
2016-10-27 16:40:55 -04:00
|
|
|
|
2013-11-07 14:58:17 -05:00
|
|
|
// Bring the "active" button to the front
|
2015-01-01 04:05:01 -05:00
|
|
|
@include hover-focus-active {
|
2017-10-20 03:01:29 -04:00
|
|
|
z-index: 2;
|
2013-11-07 14:58:17 -05:00
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
2013-09-06 12:50:38 -04:00
|
|
|
|
2017-05-02 14:03:14 -04:00
|
|
|
&:first-child > .btn + .btn {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
|
2015-12-06 19:45:40 -05:00
|
|
|
// Negative margin to only have a single, shared border between the two
|
2015-12-11 13:22:48 -05:00
|
|
|
&:not(:last-child) {
|
2013-12-16 16:47:09 -05:00
|
|
|
> .btn,
|
|
|
|
> .btn-group {
|
2017-10-19 03:05:07 -04:00
|
|
|
margin-right: (-$input-border-width);
|
2013-12-16 16:47:09 -05:00
|
|
|
}
|
2013-09-06 12:50:38 -04:00
|
|
|
}
|
2015-12-09 03:40:32 -05:00
|
|
|
&:not(:first-child) {
|
2013-12-16 16:47:09 -05:00
|
|
|
> .btn,
|
|
|
|
> .btn-group {
|
2017-10-20 03:01:29 -04:00
|
|
|
z-index: 1;
|
2017-10-19 03:05:07 -04:00
|
|
|
// remove nagative margin ($input-border-width) to solve overlapping issue with button.
|
2017-10-01 20:59:26 -04:00
|
|
|
margin-left: 0;
|
2017-10-02 00:20:47 -04:00
|
|
|
|
|
|
|
// When input is first, overlap the right side of it with the button(-group)
|
|
|
|
&:first-child {
|
2017-10-19 03:05:07 -04:00
|
|
|
margin-left: (-$input-border-width);
|
2017-10-02 00:20:47 -04:00
|
|
|
}
|
|
|
|
|
2015-11-15 17:09:12 -05:00
|
|
|
// Because specificity
|
|
|
|
@include hover-focus-active {
|
2017-10-20 03:01:29 -04:00
|
|
|
z-index: 2;
|
2015-11-15 17:09:12 -05:00
|
|
|
}
|
2013-12-16 16:47:09 -05:00
|
|
|
}
|
2013-09-06 12:50:38 -04:00
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|