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