|
1 | 1 | .form-floating {
|
2 | 2 | position: relative;
|
3 | 3 |
|
4 |
| - &:not(.form-control:disabled)::before { |
5 |
| - position: absolute; |
6 |
| - top: $input-border-width; |
7 |
| - left: $input-border-width; |
8 |
| - width: subtract(100%, add($input-height-inner-quarter, $input-height-inner-half)); |
9 |
| - height: $form-floating-label-height; |
10 |
| - content: ""; |
11 |
| - background-color: $input-bg; |
12 |
| - @include border-radius($input-border-radius); |
13 |
| - } |
14 |
| - |
15 | 4 | > .form-control,
|
16 | 5 | > .form-control-plaintext,
|
17 | 6 | > .form-select {
|
|
23 | 12 | position: absolute;
|
24 | 13 | top: 0;
|
25 | 14 | left: 0;
|
26 |
| - width: 100%; |
| 15 | + z-index: 2; |
27 | 16 | height: 100%; // allow textareas
|
28 | 17 | padding: $form-floating-padding-y $form-floating-padding-x;
|
29 | 18 | overflow: hidden;
|
|
66 | 55 | > .form-control-plaintext,
|
67 | 56 | > .form-select {
|
68 | 57 | ~ label {
|
69 |
| - opacity: $form-floating-label-opacity; |
| 58 | + color: rgba(var(--#{$prefix}body-color-rgb), #{$form-floating-label-opacity}); |
70 | 59 | transform: $form-floating-label-transform;
|
| 60 | + |
| 61 | + &::after { |
| 62 | + position: absolute; |
| 63 | + inset: $form-floating-padding-y ($form-floating-padding-x * .5); |
| 64 | + z-index: -1; |
| 65 | + height: $form-floating-label-height; |
| 66 | + content: ""; |
| 67 | + background-color: $input-bg; |
| 68 | + @include border-radius($input-border-radius); |
| 69 | + } |
71 | 70 | }
|
72 | 71 | }
|
73 | 72 | // Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
|
74 | 73 | > .form-control:-webkit-autofill {
|
75 | 74 | ~ label {
|
76 |
| - opacity: $form-floating-label-opacity; |
| 75 | + color: rgba(var(--#{$prefix}body-color-rgb), #{$form-floating-label-opacity}); |
77 | 76 | transform: $form-floating-label-transform;
|
78 | 77 | }
|
79 | 78 | }
|
|
84 | 83 | }
|
85 | 84 | }
|
86 | 85 |
|
87 |
| - > .form-control:disabled ~ label { |
| 86 | + > :disabled ~ label { |
88 | 87 | color: $form-floating-label-disabled-color;
|
| 88 | + |
| 89 | + &::after { |
| 90 | + background-color: $input-disabled-bg; |
| 91 | + } |
89 | 92 | }
|
90 | 93 | }
|
0 commit comments