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;
|
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;
|
|
|
|
z-index: 2;
|
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
|
|
|
|
// the column. Applies to IE Edge+ and Firefox. Chrome do not require this.
|
|
|
|
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 {
|
|
|
|
z-index: 3;
|
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-18 14:38:47 -04:00
|
|
|
.input-group-addon,
|
|
|
|
.input-group-btn,
|
|
|
|
.input-group .form-control {
|
2016-12-21 23:26:17 -05:00
|
|
|
// Vertically centers the content of the addons within the input group
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
2015-04-18 14:38:47 -04:00
|
|
|
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
@include border-radius(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-group-addon,
|
|
|
|
.input-group-btn {
|
|
|
|
white-space: nowrap;
|
|
|
|
vertical-align: middle; // Match the inputs
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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 {
|
2015-08-14 02:04:16 -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
|
2014-12-02 17:02:35 -05:00
|
|
|
font-size: $font-size-base;
|
2016-10-19 15:41:27 -04:00
|
|
|
font-weight: $font-weight-normal;
|
2016-02-08 01:47:04 -05:00
|
|
|
line-height: $input-line-height;
|
2014-12-02 17:02:35 -05:00
|
|
|
color: $input-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;
|
2015-12-07 05:07:35 -05:00
|
|
|
border: $input-btn-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 {
|
2015-08-14 02:04:16 -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
|
|
|
}
|
2015-04-23 04:14:43 -04:00
|
|
|
&.form-control-lg {
|
2015-08-22 21:36:43 -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
|
|
|
}
|
|
|
|
|
2016-02-06 15:28:18 -05:00
|
|
|
// scss-lint:disable QualifyingElement
|
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;
|
|
|
|
}
|
2016-02-06 15:28:18 -05:00
|
|
|
// scss-lint:enable QualifyingElement
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
|
|
|
|
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),
|
|
|
|
.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
|
|
|
}
|
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;
|
|
|
|
}
|
2015-12-09 03:40:32 -05:00
|
|
|
.input-group .form-control:not(:first-child),
|
|
|
|
.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
|
|
|
}
|
2015-12-11 13:22:48 -05:00
|
|
|
.form-control + .input-group-addon:not(:first-child) {
|
2013-07-27 21:56:31 -04:00
|
|
|
border-left: 0;
|
|
|
|
}
|
|
|
|
|
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;
|
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-12-21 23:26:17 -05:00
|
|
|
// Vertically stretch the button and center its content
|
|
|
|
flex: 1;
|
2016-10-27 16:40:55 -04:00
|
|
|
|
2013-11-07 14:58:17 -05:00
|
|
|
+ .btn {
|
2015-12-07 05:07:35 -05:00
|
|
|
margin-left: (-$input-btn-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 {
|
2015-11-15 17:09:12 -05:00
|
|
|
z-index: 3;
|
2013-11-07 14:58:17 -05:00
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|
2013-09-06 12:50:38 -04:00
|
|
|
|
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 {
|
2015-12-07 05:07:35 -05:00
|
|
|
margin-right: (-$input-btn-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 {
|
2015-02-27 11:48:30 -05:00
|
|
|
z-index: 2;
|
2015-12-07 05:07:35 -05:00
|
|
|
margin-left: (-$input-btn-border-width);
|
2015-11-15 17:09:12 -05:00
|
|
|
// Because specificity
|
|
|
|
@include hover-focus-active {
|
|
|
|
z-index: 3;
|
|
|
|
}
|
2013-12-16 16:47:09 -05:00
|
|
|
}
|
2013-09-06 12:50:38 -04:00
|
|
|
}
|
2013-07-27 21:56:31 -04:00
|
|
|
}
|