|
394 | 394 | }
|
395 | 395 | }
|
396 | 396 |
|
| 397 | + @if $variant == 'material' { |
| 398 | + %form-group-display--border { |
| 399 | + &:has(input:-webkit-autofill, input:autofill) { |
| 400 | + %igx-input-group__notch--border { |
| 401 | + border-block-start-color: transparent; |
| 402 | + } |
| 403 | + |
| 404 | + %form-group-label { |
| 405 | + --label-position: #{sizable(18px, 22px, 26px)}; |
| 406 | + |
| 407 | + transform: translateY(calc(var(--label-position) * -1)); |
| 408 | + margin-top: 0; |
| 409 | + overflow: hidden; |
| 410 | + will-change: font-size, color, transform; |
| 411 | + } |
| 412 | + } |
| 413 | + } |
| 414 | + } |
| 415 | + |
397 | 416 | %form-group-display--box {
|
398 | 417 | %form-group-border {
|
399 | 418 | margin-bottom: 0;
|
|
464 | 483 | --size: var(--input-icon) !important;
|
465 | 484 | }
|
466 | 485 | }
|
| 486 | + |
| 487 | + @if $variant == 'material' { |
| 488 | + &:not(%form-group-display--border) { |
| 489 | + &:has(input:-webkit-autofill, input:autofill) { |
| 490 | + %form-group-label { |
| 491 | + --floating-label-position: -73%; |
| 492 | + |
| 493 | + @include type-style('caption'); |
| 494 | + |
| 495 | + transform: translateY(var(--floating-label-position)); |
| 496 | + } |
| 497 | + } |
| 498 | + } |
| 499 | + } |
467 | 500 | }
|
468 | 501 |
|
469 | 502 | %form-group-placeholder {
|
|
1234 | 1267 | }
|
1235 | 1268 | }
|
1236 | 1269 |
|
1237 |
| - %chrome-autofill-fix { |
| 1270 | + // This is a hack that removes the autofill background and it's essential, |
| 1271 | + // otherwise the background is on top of the floating label in material theme. |
| 1272 | + // The !important flag is because bootstrap theme(and potentially feature themes) is overriding the transition delay. |
| 1273 | + %autofill-background-fix { |
1238 | 1274 | &:-webkit-autofill,
|
1239 | 1275 | &:-webkit-autofill:hover,
|
1240 | 1276 | &:-webkit-autofill:focus,
|
1241 |
| - &:-webkit-autofill:active { |
1242 |
| - -webkit-transition-delay: 99999s; |
1243 |
| - transition-delay: 99999s; |
| 1277 | + &:-webkit-autofill:active, |
| 1278 | + &:autofill, |
| 1279 | + &:autofill:hover, |
| 1280 | + &:autofill:focus, |
| 1281 | + &:autofill:active, { |
| 1282 | + -webkit-transition-delay: 99999s !important; |
| 1283 | + transition-delay: 99999s !important; |
1244 | 1284 | }
|
1245 | 1285 | }
|
1246 | 1286 |
|
|
2092 | 2132 | map.get($bootstrap-inline-padding, 'cosy'),
|
2093 | 2133 | map.get($bootstrap-inline-padding, 'comfortable')
|
2094 | 2134 | );
|
2095 |
| - transition: box-shadow .15s ease-out, border .15s ease-out; |
| 2135 | + } |
| 2136 | + |
| 2137 | + // The :not selector is needed otherwise bootstrap will override the %autofill-background-fix |
| 2138 | + %form-group-display--bootstrap { |
| 2139 | + :not(:has(input:-webkit-autofill, input:autofill)) { |
| 2140 | + %bootstrap-input { |
| 2141 | + transition: box-shadow .15s ease-out, border .15s ease-out; |
| 2142 | + } |
| 2143 | + } |
2096 | 2144 | }
|
2097 | 2145 |
|
2098 | 2146 | %bootstrap-input,
|
|
0 commit comments