2020-10-27 23:45:48 -04:00
|
|
|
.form-floating {
|
|
|
|
position: relative;
|
|
|
|
|
2022-10-06 02:12:00 -04:00
|
|
|
&::before {
|
|
|
|
position: absolute;
|
|
|
|
top: $input-border-width;
|
|
|
|
left: $input-border-width;
|
|
|
|
width: subtract(100%, add($input-height-inner-quarter, $input-height-inner-half));
|
|
|
|
height: $form-floating-label-height;
|
|
|
|
content: "";
|
|
|
|
background-color: $input-bg;
|
|
|
|
@include border-radius($input-border-radius);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:45:48 -04:00
|
|
|
> .form-control,
|
2022-02-08 15:38:29 -05:00
|
|
|
> .form-control-plaintext,
|
2020-10-27 23:45:48 -04:00
|
|
|
> .form-select {
|
|
|
|
height: $form-floating-height;
|
2021-06-03 12:02:46 -04:00
|
|
|
line-height: $form-floating-line-height;
|
2020-10-27 23:45:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
> label {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2022-05-11 00:49:08 -04:00
|
|
|
width: 100%;
|
2020-10-27 23:45:48 -04:00
|
|
|
height: 100%; // allow textareas
|
|
|
|
padding: $form-floating-padding-y $form-floating-padding-x;
|
2022-05-11 00:49:08 -04:00
|
|
|
overflow: hidden;
|
2022-08-01 06:01:32 -04:00
|
|
|
text-align: start;
|
2022-05-11 00:49:08 -04:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2020-10-27 23:45:48 -04:00
|
|
|
pointer-events: none;
|
|
|
|
border: $input-border-width solid transparent; // Required for aligning label's text with the input as it affects inner box model
|
|
|
|
transform-origin: 0 0;
|
|
|
|
@include transition($form-floating-transition);
|
|
|
|
}
|
|
|
|
|
2022-02-08 15:38:29 -05:00
|
|
|
> .form-control,
|
|
|
|
> .form-control-plaintext {
|
2021-05-25 01:31:30 -04:00
|
|
|
padding: $form-floating-padding-y $form-floating-padding-x;
|
|
|
|
|
2020-10-27 23:45:48 -04:00
|
|
|
&::placeholder {
|
|
|
|
color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus,
|
|
|
|
&:not(:placeholder-shown) {
|
|
|
|
padding-top: $form-floating-input-padding-t;
|
|
|
|
padding-bottom: $form-floating-input-padding-b;
|
|
|
|
}
|
|
|
|
// Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
|
|
|
|
&:-webkit-autofill {
|
|
|
|
padding-top: $form-floating-input-padding-t;
|
|
|
|
padding-bottom: $form-floating-input-padding-b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .form-select {
|
|
|
|
padding-top: $form-floating-input-padding-t;
|
|
|
|
padding-bottom: $form-floating-input-padding-b;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .form-control:focus,
|
|
|
|
> .form-control:not(:placeholder-shown),
|
2022-02-08 15:38:29 -05:00
|
|
|
> .form-control-plaintext,
|
2020-10-27 23:45:48 -04:00
|
|
|
> .form-select {
|
|
|
|
~ label {
|
|
|
|
opacity: $form-floating-label-opacity;
|
|
|
|
transform: $form-floating-label-transform;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
|
|
|
|
> .form-control:-webkit-autofill {
|
|
|
|
~ label {
|
|
|
|
opacity: $form-floating-label-opacity;
|
|
|
|
transform: $form-floating-label-transform;
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 15:38:29 -05:00
|
|
|
|
|
|
|
> .form-control-plaintext {
|
|
|
|
~ label {
|
|
|
|
border-width: $input-border-width 0; // Required to properly position label text - as explained above
|
|
|
|
}
|
|
|
|
}
|
2020-10-27 23:45:48 -04:00
|
|
|
}
|