2021-07-07 11:12:38 +00:00
|
|
|
.form-floating {
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
> .form-control,
|
2022-11-04 15:49:41 +00:00
|
|
|
> .form-control-plaintext,
|
2021-07-07 11:12:38 +00:00
|
|
|
> .form-select {
|
|
|
|
height: $form-floating-height;
|
|
|
|
line-height: $form-floating-line-height;
|
|
|
|
}
|
|
|
|
|
|
|
|
> label {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2022-11-04 15:49:41 +00:00
|
|
|
width: 100%;
|
2021-07-07 11:12:38 +00:00
|
|
|
height: 100%; // allow textareas
|
|
|
|
padding: $form-floating-padding-y $form-floating-padding-x;
|
2022-11-04 15:49:41 +00:00
|
|
|
overflow: hidden;
|
|
|
|
text-align: start;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2021-07-07 11:12:38 +00: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-11-04 15:49:41 +00:00
|
|
|
> .form-control,
|
|
|
|
> .form-control-plaintext {
|
2021-07-07 11:12:38 +00:00
|
|
|
padding: $form-floating-padding-y $form-floating-padding-x;
|
|
|
|
|
|
|
|
&::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-11-04 15:49:41 +00:00
|
|
|
> .form-control-plaintext,
|
2021-07-07 11:12:38 +00: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-11-04 15:49:41 +00:00
|
|
|
|
|
|
|
> .form-control-plaintext {
|
|
|
|
~ label {
|
|
|
|
border-width: $input-border-width 0; // Required to properly position label text - as explained above
|
|
|
|
}
|
|
|
|
}
|
2021-07-07 11:12:38 +00:00
|
|
|
}
|