|
6 | 6 |
|
7 | 7 | // Includes the structural styles for the form field inherited from MDC.
|
8 | 8 | @mixin private-text-field-structure {
|
9 |
| - $filled-slots: (tokens-mdc-filled-text-field.$prefix, |
10 |
| - tokens-mdc-filled-text-field.get-token-slots()); |
11 |
| - $outlined-slots: (tokens-mdc-outlined-text-field.$prefix, |
12 |
| - tokens-mdc-outlined-text-field.get-token-slots()); |
| 9 | + $filled-slots: ( |
| 10 | + tokens-mdc-filled-text-field.$prefix, |
| 11 | + tokens-mdc-filled-text-field.get-token-slots() |
| 12 | + ); |
| 13 | + $outlined-slots: ( |
| 14 | + tokens-mdc-outlined-text-field.$prefix, |
| 15 | + tokens-mdc-outlined-text-field.get-token-slots() |
| 16 | + ); |
13 | 17 |
|
14 | 18 | .mdc-text-field {
|
15 | 19 | display: inline-flex;
|
|
130 | 134 | .mdc-text-field--outlined {
|
131 | 135 | height: 56px;
|
132 | 136 | overflow: visible;
|
133 |
| - padding-left: 16px; |
134 |
| - padding-right: 16px; |
135 | 137 |
|
136 |
| - @include _supports-max { |
137 |
| - @include token-utils.use-tokens($outlined-slots...) { |
138 |
| - $shape-var: token-utils.get-token-variable(container-shape); |
139 |
| - padding-right: max(16px, #{$shape-var}); |
140 |
| - padding-left: max(16px, calc(#{$shape-var} + 4px)); |
| 138 | + @include token-utils.use-tokens($outlined-slots...) { |
| 139 | + $shape-var: token-utils.get-token-variable(container-shape); |
| 140 | + padding-right: max(16px, #{$shape-var}); |
| 141 | + padding-left: max(16px, calc(#{$shape-var} + 4px)); |
141 | 142 |
|
142 |
| - [dir='rtl'] & { |
143 |
| - padding-right: max(16px, calc(#{$shape-var} + 4px)); |
144 |
| - padding-left: max(16px, #{$shape-var}); |
145 |
| - } |
| 143 | + [dir='rtl'] & { |
| 144 | + padding-right: max(16px, calc(#{$shape-var} + 4px)); |
| 145 | + padding-left: max(16px, #{$shape-var}); |
146 | 146 | }
|
147 | 147 | }
|
148 | 148 | }
|
|
342 | 342 | border-right: none;
|
343 | 343 | border-top-right-radius: 0;
|
344 | 344 | border-bottom-right-radius: 0;
|
345 |
| - width: 12px; |
346 | 345 |
|
347 | 346 | @include token-utils.use-tokens($outlined-slots...) {
|
348 | 347 | @include token-utils.create-token-slot(border-top-left-radius, container-shape);
|
349 | 348 | @include token-utils.create-token-slot(border-bottom-left-radius, container-shape);
|
350 | 349 |
|
351 |
| - @include _supports-max { |
352 |
| - .mdc-text-field--outlined .mdc-notched-outline & { |
353 |
| - $shape-var: token-utils.get-token-variable(container-shape); |
354 |
| - width: max(12px, #{$shape-var}); |
355 |
| - } |
| 350 | + .mdc-text-field--outlined .mdc-notched-outline & { |
| 351 | + $shape-var: token-utils.get-token-variable(container-shape); |
| 352 | + width: max(12px, #{$shape-var}); |
356 | 353 | }
|
357 | 354 | }
|
358 | 355 |
|
|
397 | 394 | .mdc-notched-outline__notch {
|
398 | 395 | flex: 0 0 auto;
|
399 | 396 | width: auto;
|
400 |
| - max-width: calc(100% - 24px); |
401 | 397 |
|
402 | 398 | @include token-utils.use-tokens($outlined-slots...) {
|
403 |
| - @include _supports-max { |
404 |
| - .mdc-text-field--outlined .mdc-notched-outline & { |
405 |
| - $shape-var: token-utils.get-token-variable(container-shape); |
406 |
| - max-width: calc(100% - max(12px, #{$shape-var}) * 2); |
407 |
| - } |
| 399 | + .mdc-text-field--outlined .mdc-notched-outline & { |
| 400 | + $shape-var: token-utils.get-token-variable(container-shape); |
| 401 | + max-width: min( |
| 402 | + var(--mat-form-field-notch-max-width, 100%), |
| 403 | + calc(100% - max(12px, #{$shape-var}) * 2) |
| 404 | + ); |
408 | 405 | }
|
409 | 406 | }
|
410 | 407 |
|
|
420 | 417 | padding-left: 0;
|
421 | 418 | padding-right: 8px;
|
422 | 419 | border-top: none;
|
| 420 | + --mat-form-field-notch-max-width: 100%; |
423 | 421 | }
|
424 | 422 |
|
425 | 423 | [dir='rtl'] .mdc-notched-outline--notched & {
|
|
433 | 431 | }
|
434 | 432 |
|
435 | 433 | .mdc-line-ripple {
|
436 |
| - &::before, &::after { |
| 434 | + &::before, |
| 435 | + &::after { |
437 | 436 | position: absolute;
|
438 | 437 | bottom: 0;
|
439 | 438 | left: 0;
|
|
459 | 458 | }
|
460 | 459 |
|
461 | 460 | .mdc-text-field--filled.mdc-text-field--disabled & {
|
462 |
| - @include token-utils.create-token-slot(border-bottom-color, |
463 |
| - disabled-active-indicator-color); |
| 461 | + @include token-utils.create-token-slot( |
| 462 | + border-bottom-color, |
| 463 | + disabled-active-indicator-color |
| 464 | + ); |
464 | 465 | }
|
465 | 466 |
|
466 | 467 | #{$enabled-field}.mdc-text-field--invalid & {
|
467 | 468 | @include token-utils.create-token-slot(border-bottom-color, error-active-indicator-color);
|
468 | 469 | }
|
469 | 470 |
|
470 | 471 | #{$enabled-field}.mdc-text-field--invalid:not(.mdc-text-field--focused):hover & {
|
471 |
| - @include token-utils.create-token-slot(border-bottom-color, |
472 |
| - error-hover-active-indicator-color); |
| 472 | + @include token-utils.create-token-slot( |
| 473 | + border-bottom-color, |
| 474 | + error-hover-active-indicator-color |
| 475 | + ); |
473 | 476 | }
|
474 | 477 | }
|
475 | 478 | }
|
|
481 | 484 |
|
482 | 485 | @include token-utils.use-tokens($filled-slots...) {
|
483 | 486 | .mdc-text-field--filled & {
|
484 |
| - @include token-utils.create-token-slot(border-bottom-width, |
485 |
| - focus-active-indicator-height); |
| 487 | + @include token-utils.create-token-slot( |
| 488 | + border-bottom-width, |
| 489 | + focus-active-indicator-height |
| 490 | + ); |
486 | 491 | }
|
487 | 492 |
|
488 | 493 | .mdc-text-field--filled:not(.mdc-text-field--disabled) & {
|
489 | 494 | @include token-utils.create-token-slot(border-bottom-color, focus-active-indicator-color);
|
490 | 495 | }
|
491 | 496 |
|
492 | 497 | .mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) & {
|
493 |
| - @include token-utils.create-token-slot(border-bottom-color, |
494 |
| - error-focus-active-indicator-color); |
| 498 | + @include token-utils.create-token-slot( |
| 499 | + border-bottom-color, |
| 500 | + error-focus-active-indicator-color |
| 501 | + ); |
495 | 502 | }
|
496 | 503 | }
|
497 | 504 | }
|
|
571 | 578 | }
|
572 | 579 | }
|
573 | 580 |
|
574 |
| -// Wraps the content in a `@supports` query targeting the `max` CSS function. |
575 |
| -@mixin _supports-max { |
576 |
| - // stylelint-disable material/no-prefixes |
577 |
| - @supports (top: max(0%)) { |
578 |
| - @content; |
579 |
| - } |
580 |
| - // stylelint-enable |
581 |
| -} |
582 |
| - |
583 | 581 | // Includes the animation styles for the form field inherited from MDC.
|
584 | 582 | @mixin private-text-field-animations {
|
585 | 583 | $timing-curve: cubic-bezier(0.4, 0, 0.2, 1);
|
586 | 584 |
|
587 | 585 | .mdc-floating-label {
|
588 |
| - transition: transform 150ms $timing-curve, color 150ms $timing-curve; |
| 586 | + transition: |
| 587 | + transform 150ms $timing-curve, |
| 588 | + color 150ms $timing-curve; |
589 | 589 | }
|
590 | 590 |
|
591 | 591 | .mdc-text-field__input {
|
|
611 | 611 | }
|
612 | 612 |
|
613 | 613 | .mdc-line-ripple::after {
|
614 |
| - transition: transform 180ms $timing-curve, opacity 180ms $timing-curve; |
| 614 | + transition: |
| 615 | + transform 180ms $timing-curve, |
| 616 | + opacity 180ms $timing-curve; |
615 | 617 | }
|
616 | 618 | }
|
0 commit comments