summaryrefslogtreecommitdiffstats
path: root/scss/forms/_floating-labels.scss
diff options
context:
space:
mode:
Diffstat (limited to 'scss/forms/_floating-labels.scss')
-rw-r--r--scss/forms/_floating-labels.scss25
1 files changed, 22 insertions, 3 deletions
diff --git a/scss/forms/_floating-labels.scss b/scss/forms/_floating-labels.scss
index 6e5c9a7..3ca4264 100644
--- a/scss/forms/_floating-labels.scss
+++ b/scss/forms/_floating-labels.scss
@@ -5,6 +5,7 @@
> .form-control-plaintext,
> .form-select {
height: $form-floating-height;
+ min-height: $form-floating-height;
line-height: $form-floating-line-height;
}
@@ -12,7 +13,7 @@
position: absolute;
top: 0;
left: 0;
- width: 100%;
+ z-index: 2;
height: 100%; // allow textareas
padding: $form-floating-padding-y $form-floating-padding-x;
overflow: hidden;
@@ -55,14 +56,24 @@
> .form-control-plaintext,
> .form-select {
~ label {
- opacity: $form-floating-label-opacity;
+ color: rgba(var(--#{$prefix}body-color-rgb), #{$form-floating-label-opacity});
transform: $form-floating-label-transform;
+
+ &::after {
+ position: absolute;
+ inset: $form-floating-padding-y ($form-floating-padding-x * .5);
+ z-index: -1;
+ height: $form-floating-label-height;
+ content: "";
+ background-color: $input-bg;
+ @include border-radius($input-border-radius);
+ }
}
}
// Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
> .form-control:-webkit-autofill {
~ label {
- opacity: $form-floating-label-opacity;
+ color: rgba(var(--#{$prefix}body-color-rgb), #{$form-floating-label-opacity});
transform: $form-floating-label-transform;
}
}
@@ -72,4 +83,12 @@
border-width: $input-border-width 0; // Required to properly position label text - as explained above
}
}
+
+ > :disabled ~ label {
+ color: $form-floating-label-disabled-color;
+
+ &::after {
+ background-color: $input-disabled-bg;
+ }
+ }
}