@react-md/core 1.0.0-next.5 → 1.0.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +12 -0
  3. package/CHANGELOG.md +12 -0
  4. package/dist/_core.scss +157 -240
  5. package/dist/_utils.scss +10 -0
  6. package/dist/app-bar/_app-bar.scss +95 -93
  7. package/dist/avatar/_avatar.scss +49 -47
  8. package/dist/badge/_badge.scss +19 -17
  9. package/dist/box/_box.scss +57 -55
  10. package/dist/button/_button.scss +122 -120
  11. package/dist/card/_card.scss +72 -70
  12. package/dist/chip/_chip.scss +105 -103
  13. package/dist/dialog/_dialog.scss +128 -126
  14. package/dist/divider/_divider.scss +24 -22
  15. package/dist/draggable/_draggable.scss +16 -12
  16. package/dist/expansion-panel/_expansion-panel.scss +69 -52
  17. package/dist/form/Form.d.ts +1 -1
  18. package/dist/form/Form.js +2 -1
  19. package/dist/form/Form.js.map +1 -1
  20. package/dist/form/_form.scss +1175 -1128
  21. package/dist/icon/_icon.scss +64 -62
  22. package/dist/interaction/_interaction.scss +39 -35
  23. package/dist/layout/_layout.scss +68 -67
  24. package/dist/link/_link.scss +52 -50
  25. package/dist/list/_list.scss +124 -122
  26. package/dist/menu/_menu.scss +9 -7
  27. package/dist/overlay/_overlay.scss +25 -23
  28. package/dist/progress/_progress.scss +11 -6
  29. package/dist/responsive-item/_responsive-item.scss +91 -89
  30. package/dist/segmented-button/_segmented-button.scss +54 -49
  31. package/dist/sheet/_sheet.scss +84 -82
  32. package/dist/snackbar/_snackbar.scss +128 -123
  33. package/dist/table/_table.scss +159 -157
  34. package/dist/tabs/_tabs.scss +10 -8
  35. package/dist/tooltip/_tooltip.scss +60 -58
  36. package/dist/transition/_transition.scss +44 -39
  37. package/dist/tree/_tree.scss +83 -81
  38. package/dist/typography/_typography.scss +58 -49
  39. package/dist/window-splitter/_window-splitter.scss +72 -70
  40. package/package.json +1 -1
  41. package/src/_core.scss +157 -240
  42. package/src/_utils.scss +10 -0
  43. package/src/app-bar/_app-bar.scss +95 -93
  44. package/src/avatar/_avatar.scss +49 -47
  45. package/src/badge/_badge.scss +19 -17
  46. package/src/box/_box.scss +57 -55
  47. package/src/button/_button.scss +122 -120
  48. package/src/card/_card.scss +72 -70
  49. package/src/chip/_chip.scss +105 -103
  50. package/src/dialog/_dialog.scss +128 -126
  51. package/src/divider/_divider.scss +24 -22
  52. package/src/draggable/_draggable.scss +16 -12
  53. package/src/expansion-panel/_expansion-panel.scss +69 -52
  54. package/src/form/Form.tsx +2 -1
  55. package/src/form/_form.scss +1175 -1128
  56. package/src/icon/_icon.scss +64 -62
  57. package/src/interaction/_interaction.scss +39 -35
  58. package/src/layout/_layout.scss +68 -67
  59. package/src/link/_link.scss +52 -50
  60. package/src/list/_list.scss +124 -122
  61. package/src/menu/_menu.scss +9 -7
  62. package/src/overlay/_overlay.scss +25 -23
  63. package/src/progress/_progress.scss +11 -6
  64. package/src/responsive-item/_responsive-item.scss +91 -89
  65. package/src/segmented-button/_segmented-button.scss +54 -49
  66. package/src/sheet/_sheet.scss +84 -82
  67. package/src/snackbar/_snackbar.scss +128 -123
  68. package/src/table/_table.scss +159 -157
  69. package/src/tabs/_tabs.scss +10 -8
  70. package/src/tooltip/_tooltip.scss +60 -58
  71. package/src/transition/_transition.scss +44 -39
  72. package/src/tree/_tree.scss +83 -81
  73. package/src/typography/_typography.scss +58 -49
  74. package/src/window-splitter/_window-splitter.scss +72 -70
  75. package/tsconfig.json +2 -2
@@ -426,7 +426,7 @@ $variables: (
426
426
  }
427
427
  }
428
428
 
429
- @mixin file-input-styles {
429
+ @mixin file-input-styles($disable-layer: false) {
430
430
  @if utils.$disable-has-selectors or utils.$disable-focus-visible {
431
431
  .rmd-file-input:focus-within::before {
432
432
  @include utils.keyboard-only {
@@ -440,394 +440,408 @@ $variables: (
440
440
  }
441
441
  }
442
442
 
443
- @mixin form-message-styles {
444
- .rmd-form-message-container {
445
- display: flex;
446
- flex-direction: column;
447
- }
443
+ @mixin form-message-styles($disable-layer: false) {
444
+ @include utils.optional-layer(form, $disable-layer) {
445
+ .rmd-form-message-container {
446
+ display: flex;
447
+ flex-direction: column;
448
+ }
448
449
 
449
- .rmd-form-message {
450
- @include utils.map-to-styles($message-typography-styles);
450
+ .rmd-form-message {
451
+ @include utils.map-to-styles($message-typography-styles);
451
452
 
452
- display: flex;
453
- margin: $message-margin-top 0 $message-margin-bottom;
454
- min-height: $message-min-height;
453
+ display: flex;
454
+ margin: $message-margin-top 0 $message-margin-bottom;
455
+ min-height: $message-min-height;
455
456
 
456
- @if not $disable-text-field-filled-theme and $text-field-filled-padding {
457
- &--filled {
458
- padding-left: $text-field-filled-padding;
459
- padding-right: $text-field-filled-padding;
457
+ @if not $disable-text-field-filled-theme and $text-field-filled-padding {
458
+ &--filled {
459
+ padding-left: $text-field-filled-padding;
460
+ padding-right: $text-field-filled-padding;
461
+ }
460
462
  }
461
- }
462
463
 
463
- @if not $disable-text-field-outlined-theme and $text-field-outlined-padding
464
- {
465
- &--outline {
466
- padding-left: $text-field-outlined-padding;
467
- padding-right: $text-field-outlined-padding;
464
+ @if not
465
+ $disable-text-field-outlined-theme and
466
+ $text-field-outlined-padding
467
+ {
468
+ &--outline {
469
+ padding-left: $text-field-outlined-padding;
470
+ padding-right: $text-field-outlined-padding;
471
+ }
468
472
  }
469
- }
470
473
 
471
- @if not
472
- $disable-text-field-underlined-theme and
473
- $text-field-underlined-padding
474
- {
475
- &--underline {
476
- padding-left: $text-field-underlined-padding;
477
- padding-right: $text-field-underlined-padding;
474
+ @if not
475
+ $disable-text-field-underlined-theme and
476
+ $text-field-underlined-padding
477
+ {
478
+ &--underline {
479
+ padding-left: $text-field-underlined-padding;
480
+ padding-right: $text-field-underlined-padding;
481
+ }
478
482
  }
479
- }
480
483
 
481
- &__message {
482
- margin: 0;
483
- }
484
+ &__message {
485
+ margin: 0;
486
+ }
484
487
 
485
- @if not $disable-text-field-counter {
486
- &__counter {
487
- @include utils.auto-rtl(margin-left, auto);
488
- @include utils.auto-rtl(padding-left, $message-counter-spacing);
488
+ @if not $disable-text-field-counter {
489
+ &__counter {
490
+ @include utils.auto-rtl(margin-left, auto);
491
+ @include utils.auto-rtl(padding-left, $message-counter-spacing);
489
492
 
490
- flex-shrink: 0;
491
- white-space: nowrap;
493
+ flex-shrink: 0;
494
+ white-space: nowrap;
495
+ }
492
496
  }
493
497
  }
494
498
  }
495
499
  }
496
500
 
497
- @mixin label-styles {
498
- .rmd-label {
499
- @include utils.map-to-styles($label-typography);
501
+ @mixin label-styles($disable-layer: false) {
502
+ @include utils.optional-layer(form, $disable-layer) {
503
+ .rmd-label {
504
+ @include utils.map-to-styles($label-typography);
500
505
 
501
- align-items: center;
502
- display: inline-flex;
503
- transition-duration: transition.$linear-duration;
504
- transition-property: background-color, transform;
506
+ align-items: center;
507
+ display: inline-flex;
508
+ transition-duration: transition.$linear-duration;
509
+ transition-property: background-color, transform;
505
510
 
506
- $active-selector: "&--active";
507
- @if not $_disable-text-field-container {
508
- $active-selector: $active-selector +
509
- ", .rmd-text-field-container:focus-within &";
510
- }
511
+ $active-selector: "&--active";
512
+ @if not $_disable-text-field-container {
513
+ $active-selector: $active-selector +
514
+ ", .rmd-text-field-container:focus-within &";
515
+ }
511
516
 
512
- #{$active-selector} {
513
- @include use-var(color, focus-color);
514
- }
517
+ #{$active-selector} {
518
+ @include use-var(color, focus-color);
519
+ }
515
520
 
516
- @if not $disable-floating-label {
517
- &--floating {
518
- @include utils.rtl {
519
- left: auto;
520
- right: 0;
521
+ @if not $disable-floating-label {
522
+ &--floating {
523
+ @include utils.rtl {
524
+ left: auto;
525
+ right: 0;
526
+ transform: translate(
527
+ utils.negate-var(get-var(text-field-padding-left)),
528
+ get-var(label-floating-top)
529
+ );
530
+ }
531
+
532
+ left: 0;
533
+ // disable pointer events for floating labels so that the input behind
534
+ // is clicked instead. this prevents double click events for the Select
535
+ // component
536
+ pointer-events: none;
537
+ position: absolute;
538
+ top: 0;
521
539
  transform: translate(
522
- utils.negate-var(get-var(text-field-padding-left)),
540
+ get-var(text-field-padding-left),
523
541
  get-var(label-floating-top)
524
542
  );
525
543
  }
526
544
 
527
- left: 0;
528
- // disable pointer events for floating labels so that the input behind
529
- // is clicked instead. this prevents double click events for the Select
530
- // component
531
- pointer-events: none;
532
- position: absolute;
533
- top: 0;
534
- transform: translate(
535
- get-var(text-field-padding-left),
536
- get-var(label-floating-top)
537
- );
538
- }
545
+ &--floating-dense {
546
+ @include set-var(label-floating-top, $label-floating-top-dense);
547
+ }
539
548
 
540
- &--floating-dense {
541
- @include set-var(label-floating-top, $label-floating-top-dense);
542
- }
549
+ $floating-active-selector: "&--floating-active";
550
+ @if not
551
+ $disable-text-field or not
552
+ $disable-password or not
553
+ $disable-textarea
554
+ {
555
+ $floating-active-selector: $floating-active-selector +
556
+ ", .rmd-text-field-container:focus-within &--floating" +
557
+ ", .rmd-text-field:not(:placeholder-shown) + &--floating";
558
+ }
559
+ @if not $disable-native-select {
560
+ $floating-active-selector: $floating-active-selector +
561
+ ", .rmd-native-select[multiple] + &--floating" +
562
+ ", .rmd-native-select:not(:invalid) + &--floating";
563
+ }
543
564
 
544
- $floating-active-selector: "&--floating-active";
545
- @if not
546
- $disable-text-field or not
547
- $disable-password or not
548
- $disable-textarea
549
- {
550
- $floating-active-selector: $floating-active-selector +
551
- ", .rmd-text-field-container:focus-within &--floating" +
552
- ", .rmd-text-field:not(:placeholder-shown) + &--floating";
553
- }
554
- @if not $disable-native-select {
555
- $floating-active-selector: $floating-active-selector +
556
- ", .rmd-native-select[multiple] + &--floating" +
557
- ", .rmd-native-select:not(:invalid) + &--floating";
558
- }
565
+ #{$floating-active-selector} {
566
+ @include utils.rtl {
567
+ transform: scale($label-floating-scale)
568
+ translate(
569
+ utils.negate-var(get-var(label-left-offset)),
570
+ get-var(label-top-offset)
571
+ );
572
+ transform-origin: 100% 0;
573
+ }
574
+ @include use-var(background-color, label-active-background-color);
575
+ @include use-var(padding, label-active-padding);
559
576
 
560
- #{$floating-active-selector} {
561
- @include utils.rtl {
562
577
  transform: scale($label-floating-scale)
563
- translate(
564
- utils.negate-var(get-var(label-left-offset)),
565
- get-var(label-top-offset)
566
- );
578
+ translate(get-var(label-left-offset), get-var(label-top-offset));
579
+ // need to add the `transform-origin` because of the scaling applied.
580
+ // it'll change the position based on the size of the label otherwise
581
+ transform-origin: 0 0;
582
+ z-index: 1;
567
583
  }
568
- @include use-var(background-color, label-active-background-color);
569
- @include use-var(padding, label-active-padding);
570
-
571
- transform: scale($label-floating-scale)
572
- translate(get-var(label-left-offset), get-var(label-top-offset));
573
- z-index: 1;
574
584
  }
575
- }
576
585
 
577
- @if not $disable-label-gap {
578
- &--gap {
579
- gap: $label-gap;
586
+ @if not $disable-label-gap {
587
+ &--gap {
588
+ gap: $label-gap;
589
+ }
580
590
  }
581
- }
582
591
 
583
- @if not $disable-label-reversed {
584
- &--reversed {
585
- flex-direction: row-reverse;
586
- // this makes it so the content is at the starting edge
587
- justify-content: flex-end;
592
+ @if not $disable-label-reversed {
593
+ &--reversed {
594
+ flex-direction: row-reverse;
595
+ // this makes it so the content is at the starting edge
596
+ justify-content: flex-end;
597
+ }
588
598
  }
589
- }
590
599
 
591
- @if not $disable-label-stacked {
592
- &--stacked {
593
- flex-direction: column;
600
+ @if not $disable-label-stacked {
601
+ &--stacked {
602
+ flex-direction: column;
603
+ }
594
604
  }
595
- }
596
605
 
597
- @if not $disable-label-stacked-reversed {
598
- &--stacked-reversed {
599
- flex-direction: column-reverse;
606
+ @if not $disable-label-stacked-reversed {
607
+ &--stacked-reversed {
608
+ flex-direction: column-reverse;
609
+ }
600
610
  }
601
611
  }
602
612
  }
603
613
  }
604
614
 
605
- @mixin text-field-container-styles {
606
- .rmd-text-field-container {
607
- @include use-var(height, text-field-height);
615
+ @mixin text-field-container-styles($disable-layer: false) {
616
+ @include utils.optional-layer(form, $disable-layer) {
617
+ .rmd-text-field-container {
618
+ @include set-var(label-left-offset, get-var(text-field-padding-left));
619
+ @include use-var(height, text-field-height);
608
620
 
609
- align-items: center;
610
- display: flex;
611
- position: relative;
621
+ align-items: center;
622
+ display: flex;
623
+ position: relative;
612
624
 
613
- @if not $disable-text-field-container-dense {
614
- &--dense {
615
- @include set-var(text-field-height, $text-field-dense-height);
625
+ @if not $disable-text-field-container-dense {
626
+ &--dense {
627
+ @include set-var(text-field-height, $text-field-dense-height);
628
+ }
629
+
630
+ &--dense-label {
631
+ @include set-var(text-field-height, $text-field-label-dense-height);
632
+ }
616
633
  }
617
634
 
618
- &--dense-label {
619
- @include set-var(text-field-height, $text-field-label-dense-height);
635
+ &--inline {
636
+ display: inline-flex;
620
637
  }
621
- }
622
638
 
623
- &--inline {
624
- display: inline-flex;
625
- }
639
+ &--stretch {
640
+ flex: 1 1 auto;
641
+ width: 100%;
642
+ }
626
643
 
627
- &--stretch {
628
- flex: 1 1 auto;
629
- width: 100%;
630
- }
644
+ &--label {
645
+ @include set-var(text-field-height, $text-field-label-height);
646
+ }
631
647
 
632
- &--label {
633
- @include set-var(text-field-height, $text-field-label-height);
634
- }
648
+ &--error {
649
+ @if not $disable-text-field-addon {
650
+ @include icon.set-var(color, currentcolor);
651
+ }
652
+ @include set-var(active-color, currentcolor);
653
+ @include set-var(focus-color, currentcolor);
635
654
 
636
- &--error {
637
- @if not $disable-text-field-addon {
638
- @include icon.set-var(color, currentcolor);
655
+ @if not
656
+ $disable-text-field-underlined-theme or not
657
+ $disable-text-field-outlined-theme
658
+ {
659
+ @include set-var(
660
+ text-field-border-color,
661
+ theme.theme-get-var(error-color)
662
+ );
663
+ @include set-var(
664
+ text-field-hover-border-color,
665
+ theme.theme-get-var(error-color)
666
+ );
667
+ }
639
668
  }
640
- @include set-var(active-color, currentcolor);
641
- @include set-var(focus-color, currentcolor);
642
669
 
643
- @if not
644
- $disable-text-field-underlined-theme or not
645
- $disable-text-field-outlined-theme
646
- {
670
+ &--hoverable:hover {
647
671
  @include set-var(
648
672
  text-field-border-color,
649
- theme.theme-get-var(error-color)
650
- );
651
- @include set-var(
652
- text-field-hover-border-color,
653
- theme.theme-get-var(error-color)
673
+ get-var(text-field-hover-border-color)
654
674
  );
655
675
  }
656
- }
657
-
658
- &--hoverable:hover {
659
- @include set-var(
660
- text-field-border-color,
661
- get-var(text-field-hover-border-color)
662
- );
663
- }
664
676
 
665
- @if not $disable-text-field-outlined-theme {
666
- &--outline {
667
- @include set-var(text-field-padding-left, $text-field-outlined-padding);
668
- @include set-var(
669
- text-field-padding-right,
670
- $text-field-outlined-padding
671
- );
672
- @include set-var(
673
- label-left-offset,
674
- $text-field-outlined-padding - $label-floating-padding
675
- );
676
- @include set-var(label-top-offset, -50%);
677
- @include set-var(label-active-padding, 0 $label-floating-padding);
678
- @include set-var(
679
- label-active-background-color,
680
- theme.theme-get-var(background-color)
681
- );
682
- @include use-var(border-color, text-field-border-color);
683
-
684
- border-radius: $text-field-border-radius;
685
- border-style: solid;
686
- border-width: $text-field-border-width;
677
+ @if not $disable-text-field-outlined-theme {
678
+ &--outline {
679
+ @include set-var(
680
+ text-field-padding-left,
681
+ $text-field-outlined-padding
682
+ );
683
+ @include set-var(
684
+ text-field-padding-right,
685
+ $text-field-outlined-padding
686
+ );
687
+ @include set-var(label-top-offset, -50%);
688
+ @include set-var(label-active-padding, 0 $label-floating-padding);
689
+ @include set-var(
690
+ label-active-background-color,
691
+ theme.theme-get-var(background-color)
692
+ );
693
+ @include use-var(border-color, text-field-border-color);
687
694
 
688
- &::after {
689
- @include utils.pseudo-element;
695
+ border-radius: $text-field-border-radius;
696
+ border-style: solid;
697
+ border-width: $text-field-border-width;
690
698
 
691
- box-shadow: 0
692
- 0
693
- 0
694
- $text-field-border-width-active
695
- get-var(focus-color);
696
- opacity: 0;
697
- transition: opacity transition.$linear-duration;
699
+ &::after {
700
+ @include utils.pseudo-element;
701
+
702
+ box-shadow: 0
703
+ 0
704
+ 0
705
+ $text-field-border-width-active
706
+ get-var(focus-color);
707
+ opacity: 0;
708
+ transition: opacity transition.$linear-duration;
709
+ }
698
710
  }
699
- }
700
711
 
701
- &--outline:focus-within::after,
702
- &--outline-active::after {
703
- opacity: 1;
704
- }
712
+ &--outline:focus-within::after,
713
+ &--outline-active::after {
714
+ opacity: 1;
715
+ }
705
716
 
706
- &--outline-left {
707
- $distance: calc(
708
- #{icon.get-var(size)} +
709
- #{$text-field-outlined-padding +
710
- $text-field-spacing}
711
- );
717
+ &--outline-left {
718
+ $distance: calc(
719
+ #{icon.get-var(size)} +
720
+ #{$text-field-outlined-padding +
721
+ $text-field-spacing}
722
+ );
712
723
 
713
- @include set-var(text-field-padding-left, $distance);
714
- }
724
+ @include set-var(text-field-padding-left, $distance);
725
+ }
715
726
 
716
- &--outline-right {
717
- $distance: calc(#{icon.get-var(size)} + #{$text-field-spacing * 2});
727
+ &--outline-right {
728
+ $distance: calc(#{icon.get-var(size)} + #{$text-field-spacing * 2});
718
729
 
719
- @include set-var(text-field-padding-right, $distance);
730
+ @include set-var(text-field-padding-right, $distance);
731
+ }
720
732
  }
721
- }
722
733
 
723
- @if not $disable-text-field-filled-theme {
724
- &--filled {
725
- @include set-var(text-field-padding-left, $text-field-filled-padding);
726
- @include set-var(text-field-padding-right, $text-field-filled-padding);
727
- @include set-var(label-left-offset, $text-field-filled-padding);
728
- @include use-var(background-color, text-field-filled-color);
729
- }
730
- }
731
-
732
- // the filled theme uses the same styles as underline
733
- @if not
734
- $disable-text-field-underlined-theme or not
735
- $disable-text-field-filled-theme
736
- {
737
- &--underline {
738
- @include use-var(border-color, text-field-border-color);
739
-
740
- border-bottom-style: solid;
741
- border-bottom-width: $text-field-border-width;
742
-
743
- @if $text-field-underlined-padding {
744
- @include set-var(
745
- text-field-padding-left,
746
- $text-field-underlined-padding
747
- );
734
+ @if not $disable-text-field-filled-theme {
735
+ &--filled {
736
+ @include set-var(text-field-padding-left, $text-field-filled-padding);
748
737
  @include set-var(
749
738
  text-field-padding-right,
750
- $text-field-underlined-padding
739
+ $text-field-filled-padding
751
740
  );
741
+ @include use-var(background-color, text-field-filled-color);
752
742
  }
743
+ }
753
744
 
754
- &::after {
755
- @include use-var(background-color, focus-color);
745
+ // the filled theme uses the same styles as underline
746
+ @if not
747
+ $disable-text-field-underlined-theme or not
748
+ $disable-text-field-filled-theme
749
+ {
750
+ &--underline {
751
+ @include use-var(border-color, text-field-border-color);
756
752
 
757
- bottom: -$text-field-border-width;
758
- content: "";
759
- height: $text-field-border-width-active;
760
- left: 0;
761
- position: absolute;
762
- right: 0;
763
- transform: scale(0);
764
- transition: transform
765
- transition.$linear-duration
766
- transition.$linear-timing-function;
767
- z-index: 1;
753
+ border-bottom-style: solid;
754
+ border-bottom-width: $text-field-border-width;
755
+
756
+ @if $text-field-underlined-padding {
757
+ @include set-var(
758
+ text-field-padding-left,
759
+ $text-field-underlined-padding
760
+ );
761
+ @include set-var(
762
+ text-field-padding-right,
763
+ $text-field-underlined-padding
764
+ );
765
+ }
766
+
767
+ &::after {
768
+ @include use-var(background-color, focus-color);
769
+
770
+ bottom: -$text-field-border-width;
771
+ content: "";
772
+ height: $text-field-border-width-active;
773
+ left: 0;
774
+ position: absolute;
775
+ right: 0;
776
+ transform: scale(0);
777
+ transition: transform
778
+ transition.$linear-duration
779
+ transition.$linear-timing-function;
780
+ z-index: 1;
781
+ }
768
782
  }
769
- }
770
783
 
771
- @if $text-field-underlined-placeholder-height {
772
- &--underline-placeholder {
773
- @include set-var(
774
- text-field-padding-top,
775
- $text-field-underlined-placeholder-addon-padding-top
776
- );
777
- height: $text-field-underlined-placeholder-height;
784
+ @if $text-field-underlined-placeholder-height {
785
+ &--underline-placeholder {
786
+ @include set-var(
787
+ text-field-padding-top,
788
+ $text-field-underlined-placeholder-addon-padding-top
789
+ );
790
+ height: $text-field-underlined-placeholder-height;
791
+ }
792
+
793
+ &--underline-placeholder-only {
794
+ @include set-var(
795
+ text-field-padding-top,
796
+ $text-field-underlined-placeholder-padding-top
797
+ );
798
+ }
778
799
  }
779
800
 
780
- &--underline-placeholder-only {
801
+ &--underline-labelled {
781
802
  @include set-var(
782
803
  text-field-padding-top,
783
- $text-field-underlined-placeholder-padding-top
804
+ $text-field-underlined-label-padding-top
784
805
  );
806
+ @include set-var(addon-margin-top, $text-field-addon-margin);
785
807
  }
786
- }
787
808
 
788
- &--underline-labelled {
789
- @include set-var(
790
- text-field-padding-top,
791
- $text-field-underlined-label-padding-top
792
- );
793
- @include set-var(addon-margin-top, $text-field-addon-margin);
794
- }
795
-
796
- @if not $disable-text-field-underline-left {
797
- &--underline-left::after {
798
- transform-origin: left;
809
+ @if not $disable-text-field-underline-left {
810
+ &--underline-left::after {
811
+ transform-origin: left;
812
+ }
799
813
  }
800
- }
801
814
 
802
- @if not $disable-text-field-underline-center {
803
- &--underline-center::after {
804
- transform-origin: center;
815
+ @if not $disable-text-field-underline-center {
816
+ &--underline-center::after {
817
+ transform-origin: center;
818
+ }
805
819
  }
806
- }
807
820
 
808
- @if not $disable-text-field-underline-right {
809
- &--underline-right::after {
810
- transform-origin: right;
821
+ @if not $disable-text-field-underline-right {
822
+ &--underline-right::after {
823
+ transform-origin: right;
824
+ }
811
825
  }
812
- }
813
-
814
- &:focus-within::after,
815
- &--underline-active::after {
816
- transform: scale(1);
817
- }
818
826
 
819
- @if not $disable-text-field-addon {
820
- $addon-offset: "#{icon.get-var(size)} + #{$text-field-underlined-label-left-offset * 2}";
821
- @if $text-field-underlined-padding {
822
- $addon-offset: "#{$addon-offset} + #{$text-field-underlined-padding}";
827
+ &:focus-within::after,
828
+ &--underline-active::after {
829
+ transform: scale(1);
823
830
  }
824
831
 
825
- &--underline-left-addon {
826
- @include set-var(text-field-padding-left, calc(#{$addon-offset}));
827
- }
832
+ @if not $disable-text-field-addon {
833
+ $addon-offset: "#{icon.get-var(size)} + #{$text-field-underlined-label-left-offset * 2}";
834
+ @if $text-field-underlined-padding {
835
+ $addon-offset: "#{$addon-offset} + #{$text-field-underlined-padding}";
836
+ }
828
837
 
829
- &--underline-right-addon {
830
- @include set-var(text-field-padding-right, calc(#{$addon-offset}));
838
+ &--underline-left-addon {
839
+ @include set-var(text-field-padding-left, calc(#{$addon-offset}));
840
+ }
841
+
842
+ &--underline-right-addon {
843
+ @include set-var(text-field-padding-right, calc(#{$addon-offset}));
844
+ }
831
845
  }
832
846
  }
833
847
  }
@@ -857,1054 +871,1080 @@ $variables: (
857
871
  }
858
872
  }
859
873
 
860
- @mixin text-field-styles {
861
- .rmd-text-field {
862
- @include _text-field-base-styles;
874
+ @mixin text-field-styles($disable-layer: false) {
875
+ @include utils.optional-layer(form, $disable-layer) {
876
+ .rmd-text-field {
877
+ @include _text-field-base-styles;
863
878
 
864
- @if $text-field-color-min-width {
865
- &[type="color"] {
866
- min-width: $text-field-color-min-width;
879
+ @if $text-field-color-min-width {
880
+ &[type="color"] {
881
+ min-width: $text-field-color-min-width;
882
+ }
867
883
  }
868
- }
869
884
 
870
- &::placeholder {
871
- @if not $disable-placeholder-ellipsis {
872
- @include typography.text-overflow;
873
- }
885
+ &::placeholder {
886
+ @if not $disable-placeholder-ellipsis {
887
+ @include typography.text-overflow;
888
+ }
874
889
 
875
- @include theme.theme-use-var(color, text-secondary-color);
876
- // want to gain the same font styles as the input/textarea itself,
877
- // just apply different colors as needed instead. Can't just do font: inherit
878
- // since it'll break the styles in firefox.
879
- font-family: inherit;
880
- font-size: inherit;
881
- font-weight: inherit;
890
+ @include theme.theme-use-var(color, text-secondary-color);
891
+ // want to gain the same font styles as the input/textarea itself,
892
+ // just apply different colors as needed instead. Can't just do font: inherit
893
+ // since it'll break the styles in firefox.
894
+ font-family: inherit;
895
+ font-size: inherit;
896
+ font-weight: inherit;
882
897
 
883
- // fix firefox setting opacity to 0.54 by default
884
- opacity: 1;
898
+ // fix firefox setting opacity to 0.54 by default
899
+ opacity: 1;
885
900
 
886
- // Note: doesn't look like firefox applies css transitions to placeholder text?
887
- transition: opacity transition.$linear-duration;
888
- }
901
+ // Note: doesn't look like firefox applies css transitions to placeholder text?
902
+ transition: opacity transition.$linear-duration;
903
+ }
889
904
 
890
- &[disabled]::placeholder {
891
- color: inherit;
892
- }
905
+ &[disabled]::placeholder {
906
+ color: inherit;
907
+ }
893
908
 
894
- &--placeholder-hidden:not(:focus)::placeholder {
895
- opacity: 0;
909
+ &--placeholder-hidden:not(:focus)::placeholder {
910
+ opacity: 0;
911
+ }
896
912
  }
897
913
  }
898
914
  }
899
915
 
900
- @mixin password-styles {
901
- .rmd-password {
902
- @include set-var(
903
- text-field-padding-right,
904
- $password-visibility-toggle-spacing
905
- );
916
+ @mixin password-styles($disable-layer: false) {
917
+ @include utils.optional-layer(form, $disable-layer) {
918
+ .rmd-password {
919
+ @include set-var(
920
+ text-field-padding-right,
921
+ $password-visibility-toggle-spacing
922
+ );
906
923
 
907
- &__input {
908
- @include utils.auto-rtl(margin-right, button.get-var(icon-size));
909
- }
924
+ &__input {
925
+ @include utils.auto-rtl(margin-right, button.get-var(icon-size));
926
+ }
910
927
 
911
- &__toggle {
912
- @include utils.auto-rtl(right, 0);
928
+ &__toggle {
929
+ @include utils.auto-rtl(right, 0);
913
930
 
914
- position: absolute;
931
+ position: absolute;
932
+ }
915
933
  }
916
934
  }
917
935
  }
918
936
 
919
- @mixin textarea-container-styles {
920
- .rmd-textarea-container {
921
- @include set-var(addon-top, $textarea-addon-top);
922
-
923
- height: auto;
924
- max-width: 100%;
925
- padding-top: calc(
926
- #{get-var(text-field-padding-top)} + #{get-var(textarea-padding)}
927
- );
928
-
929
- &--cursor:hover {
930
- // need to add this cursor back since the textarea container adds padding to
931
- // itself instead of the textarea so it loses this cursor. the container
932
- // element will still focus the textarea when clicked
933
- cursor: text;
934
- }
937
+ @mixin textarea-container-styles($disable-layer: false) {
938
+ @include utils.optional-layer(form, $disable-layer) {
939
+ .rmd-textarea-container {
940
+ @include set-var(addon-top, $textarea-addon-top);
935
941
 
936
- @if not
937
- $disable-text-field-filled-theme or not
938
- $disable-text-field-underlined-theme
939
- {
940
- &--underline-labelled {
941
- @include set-var(textarea-padding, 0px);
942
- @include set-var(
943
- label-floating-top,
944
- $text-field-underlined-label-padding-top
945
- );
946
- }
947
- }
942
+ height: auto;
943
+ max-width: 100%;
944
+ padding-top: calc(
945
+ #{get-var(text-field-padding-top)} + #{get-var(textarea-padding)}
946
+ );
948
947
 
949
- @if not $disable-textarea-resizing-rows {
950
- &--height {
951
- height: calc(
952
- #{get-var(text-field-padding-top)} +
953
- #{get-var(textarea-padding)} +
954
- #{get-var(textarea-height)}
955
- );
948
+ &--cursor:hover {
949
+ // need to add this cursor back since the textarea container adds padding to
950
+ // itself instead of the textarea so it loses this cursor. the container
951
+ // element will still focus the textarea when clicked
952
+ cursor: text;
956
953
  }
957
954
 
958
- &--animate {
959
- transition: height
960
- transition.$linear-duration
961
- transition.$linear-timing-function;
955
+ @if not
956
+ $disable-text-field-filled-theme or not
957
+ $disable-text-field-underlined-theme
958
+ {
959
+ &--underline-labelled {
960
+ @include set-var(textarea-padding, 0px);
961
+ @include set-var(
962
+ label-floating-top,
963
+ $text-field-underlined-label-padding-top
964
+ );
965
+ }
962
966
  }
963
967
 
964
- &__inner {
965
- height: get-var(textarea-height, 100%);
966
- width: 100%;
968
+ @if not $disable-textarea-resizing-rows {
969
+ &--height {
970
+ height: calc(
971
+ #{get-var(text-field-padding-top)} +
972
+ #{get-var(textarea-padding)} +
973
+ #{get-var(textarea-height)}
974
+ );
975
+ }
967
976
 
968
977
  &--animate {
969
978
  transition: height
970
979
  transition.$linear-duration
971
980
  transition.$linear-timing-function;
972
981
  }
982
+
983
+ &__inner {
984
+ height: get-var(textarea-height, 100%);
985
+ width: 100%;
986
+
987
+ &--animate {
988
+ transition: height
989
+ transition.$linear-duration
990
+ transition.$linear-timing-function;
991
+ }
992
+ }
973
993
  }
974
994
  }
975
995
  }
976
996
  }
977
997
 
978
- @mixin textarea-styles {
979
- .rmd-textarea {
980
- @include set-var(text-field-padding-top, 0px);
981
- @include use-var(min-height, text-field-height);
998
+ @mixin textarea-styles($disable-layer: false) {
999
+ @include utils.optional-layer(form, $disable-layer) {
1000
+ .rmd-textarea {
1001
+ @include set-var(text-field-padding-top, 0px);
1002
+ @include use-var(min-height, text-field-height);
982
1003
 
983
- height: get-var(textarea-height, 100%);
1004
+ height: get-var(textarea-height, 100%);
984
1005
 
985
- @if not $disable-textarea-resize-horizontal {
986
- &--rh {
987
- resize: horizontal;
1006
+ @if not $disable-textarea-resize-horizontal {
1007
+ &--rh {
1008
+ resize: horizontal;
1009
+ }
988
1010
  }
989
- }
990
1011
 
991
- @if not $disable-textarea-resize-vertical {
992
- &--rv {
993
- resize: vertical;
1012
+ @if not $disable-textarea-resize-vertical {
1013
+ &--rv {
1014
+ resize: vertical;
1015
+ }
994
1016
  }
995
- }
996
1017
 
997
- &--rn {
998
- overflow: hidden;
999
- resize: none;
1000
- }
1018
+ &--rn {
1019
+ overflow: hidden;
1020
+ resize: none;
1021
+ }
1001
1022
 
1002
- // only want the textarea to be scrollable if there's a limit on the rows
1003
- // since it'll flash the scrollbar on most OS during the height transition
1004
- &--scrollable {
1005
- overflow: auto;
1006
- }
1023
+ // only want the textarea to be scrollable if there's a limit on the rows
1024
+ // since it'll flash the scrollbar on most OS during the height transition
1025
+ &--scrollable {
1026
+ overflow: auto;
1027
+ }
1007
1028
 
1008
- @if not $disable-textarea-resizing-mask {
1009
- &--mask {
1010
- height: auto;
1011
- left: 0;
1012
- opacity: 0;
1013
- overflow: hidden;
1014
- pointer-events: none;
1015
- position: absolute;
1016
- right: 0;
1017
- z-index: -1;
1029
+ @if not $disable-textarea-resizing-mask {
1030
+ &--mask {
1031
+ height: auto;
1032
+ left: 0;
1033
+ opacity: 0;
1034
+ overflow: hidden;
1035
+ pointer-events: none;
1036
+ position: absolute;
1037
+ right: 0;
1038
+ z-index: -1;
1039
+ }
1018
1040
  }
1019
1041
  }
1020
1042
  }
1021
1043
  }
1022
1044
 
1023
- @mixin select-styles {
1024
- .rmd-select-container {
1025
- outline-style: none;
1026
- }
1027
-
1028
- .rmd-select-value {
1029
- @include _text-field-base-styles;
1030
-
1031
- align-items: center;
1032
- display: flex;
1033
- gap: 0.5rem;
1034
- position: absolute;
1035
- white-space: nowrap;
1036
-
1037
- &__v {
1038
- @include typography.text-overflow;
1045
+ @mixin select-styles($disable-layer: false) {
1046
+ @include utils.optional-layer(form, $disable-layer) {
1047
+ .rmd-select-container {
1048
+ outline-style: none;
1039
1049
  }
1040
- }
1041
1050
 
1042
- .rmd-select {
1043
- opacity: 0;
1044
- pointer-events: none;
1045
-
1046
- // ALl these additional overrides are provided so that the select will have
1047
- // the same sizing as a text field with the same props provided.
1048
- @if not $disable-text-field-underlined-theme {
1049
- &--underline {
1050
- @include utils.rtl {
1051
- @include use-var(padding-right, text-field-padding-left);
1051
+ .rmd-select-value {
1052
+ @include _text-field-base-styles;
1052
1053
 
1053
- padding-left: 0;
1054
- }
1054
+ align-items: center;
1055
+ display: flex;
1056
+ gap: 0.5rem;
1057
+ position: absolute;
1058
+ white-space: nowrap;
1055
1059
 
1056
- padding-right: 0;
1060
+ &__v {
1061
+ @include typography.text-overflow;
1057
1062
  }
1058
1063
  }
1059
1064
 
1060
- @if not $disable-text-field-outlined-theme {
1061
- &--outline {
1062
- @include utils.rtl {
1063
- @include use-var(padding-right, text-field-padding-left);
1064
-
1065
- padding-left: $text-field-outlined-padding;
1066
- }
1065
+ .rmd-select {
1066
+ opacity: 0;
1067
+ pointer-events: none;
1067
1068
 
1068
- padding-right: $text-field-outlined-padding;
1069
- }
1070
- }
1069
+ // ALl these additional overrides are provided so that the select will have
1070
+ // the same sizing as a text field with the same props provided.
1071
+ @if not $disable-text-field-underlined-theme {
1072
+ &--underline {
1073
+ @include utils.rtl {
1074
+ @include use-var(padding-right, text-field-padding-left);
1071
1075
 
1072
- @if not $disable-text-field-filled-theme {
1073
- &--filled {
1074
- @include utils.rtl {
1075
- @include use-var(padding-right, text-field-padding-left);
1076
+ padding-left: 0;
1077
+ }
1076
1078
 
1077
- padding-left: $text-field-filled-padding;
1079
+ padding-right: 0;
1078
1080
  }
1079
-
1080
- padding-right: $text-field-filled-padding;
1081
1081
  }
1082
- }
1083
- }
1084
- }
1085
1082
 
1086
- @mixin option-styles {
1087
- .rmd-option {
1088
- &--icon {
1089
- @include utils.rtl {
1090
- @include list.use-var(padding-left, item-horizontal-padding);
1083
+ @if not $disable-text-field-outlined-theme {
1084
+ &--outline {
1085
+ @include utils.rtl {
1086
+ @include use-var(padding-right, text-field-padding-left);
1087
+
1088
+ padding-left: $text-field-outlined-padding;
1089
+ }
1091
1090
 
1092
- padding-right: $option-padding-left;
1091
+ padding-right: $text-field-outlined-padding;
1092
+ }
1093
1093
  }
1094
1094
 
1095
- padding-left: $option-padding-left;
1096
- }
1095
+ @if not $disable-text-field-filled-theme {
1096
+ &--filled {
1097
+ @include utils.rtl {
1098
+ @include use-var(padding-right, text-field-padding-left);
1097
1099
 
1098
- &--selected {
1099
- @include utils.map-to-styles($option-selected-styles);
1100
- }
1100
+ padding-left: $text-field-filled-padding;
1101
+ }
1101
1102
 
1102
- &__icon {
1103
- @include icon.set-var(spacing, $option-selected-icon-spacing);
1104
- @include icon.set-var(size, $option-selected-icon-size);
1103
+ padding-right: $text-field-filled-padding;
1104
+ }
1105
+ }
1105
1106
  }
1106
1107
  }
1107
1108
  }
1108
1109
 
1109
- @mixin native-select-styles {
1110
- @if not $disable-native-select-multiple {
1111
- .rmd-native-select-container {
1112
- &--multi {
1113
- @include set-var(addon-top, $native-select-addon-top);
1114
- @include use-var(min-height, text-field-height);
1110
+ @mixin option-styles($disable-layer: false) {
1111
+ @include utils.optional-layer(form, $disable-layer) {
1112
+ .rmd-option {
1113
+ &--icon {
1114
+ @include utils.rtl {
1115
+ @include list.use-var(padding-left, item-horizontal-padding);
1116
+
1117
+ padding-right: $option-padding-left;
1118
+ }
1115
1119
 
1116
- height: auto;
1120
+ padding-left: $option-padding-left;
1117
1121
  }
1118
1122
 
1119
- &--padded {
1120
- padding-top: $native-select-multiple-padding;
1123
+ &--selected {
1124
+ @include utils.map-to-styles($option-selected-styles);
1121
1125
  }
1122
1126
 
1123
- @if not
1124
- $disable-text-field-filled-theme or not
1125
- $disable-text-field-underlined-theme
1126
- {
1127
- &--underline {
1128
- @include set-var(text-field-padding-top, 0);
1129
- }
1130
-
1131
- &--underline-padded {
1132
- padding-top: $native-select-multiple-underline-padding;
1133
- }
1127
+ &__icon {
1128
+ @include icon.set-var(spacing, $option-selected-icon-spacing);
1129
+ @include icon.set-var(size, $option-selected-icon-size);
1134
1130
  }
1135
1131
  }
1136
1132
  }
1133
+ }
1137
1134
 
1138
- .rmd-native-select {
1139
- @include _text-field-base-styles;
1140
- @include typography.text-overflow;
1135
+ @mixin native-select-styles($disable-layer: false) {
1136
+ @include utils.optional-layer(form, $disable-layer) {
1137
+ @if not $disable-native-select-multiple {
1138
+ .rmd-native-select-container {
1139
+ &--multi {
1140
+ @include set-var(addon-top, $native-select-addon-top);
1141
+ @include use-var(min-height, text-field-height);
1141
1142
 
1142
- appearance: none;
1143
+ height: auto;
1144
+ }
1143
1145
 
1144
- &[multiple] {
1145
- overflow: auto;
1146
- }
1147
- }
1148
- }
1146
+ &--padded {
1147
+ padding-top: $native-select-multiple-padding;
1148
+ }
1149
1149
 
1150
- @mixin text-field-addon-styles {
1151
- .rmd-text-field-addon {
1152
- @if not
1153
- $disable-text-field-filled-theme or not
1154
- $disable-text-field-underlined-theme
1155
- {
1156
- @include use-var(margin-top, addon-margin-top);
1157
- }
1150
+ @if not
1151
+ $disable-text-field-filled-theme or not
1152
+ $disable-text-field-underlined-theme
1153
+ {
1154
+ &--underline {
1155
+ @include set-var(text-field-padding-top, 0);
1156
+ }
1158
1157
 
1159
- // this makes it so that this container element is the same size as the
1160
- // child (normally icons). without this, icons would have a height of 30.5px
1161
- // and no longer be centered
1162
- display: inline-flex;
1163
- position: absolute;
1164
-
1165
- // Note: Can't use `:first-child` and `:last-child` since
1166
- // password/autocomplete managers might add another element into the
1167
- // `.rmd-text-field-container` which would prevent these styles from being
1168
- // applied
1169
- &--before {
1170
- @include utils.auto-rtl(left, get-var(label-left-offset));
1158
+ &--underline-padded {
1159
+ padding-top: $native-select-multiple-underline-padding;
1160
+ }
1161
+ }
1162
+ }
1171
1163
  }
1172
1164
 
1173
- &--after {
1174
- @include utils.auto-rtl(right, $text-field-spacing);
1175
- }
1165
+ .rmd-native-select {
1166
+ @include _text-field-base-styles;
1167
+ @include typography.text-overflow;
1176
1168
 
1177
- &--presentational {
1178
- pointer-events: none;
1179
- }
1180
- }
1181
- }
1169
+ appearance: none;
1182
1170
 
1183
- @mixin hidden-input-styles {
1184
- .rmd-hidden-input {
1185
- height: 100%;
1186
- inset: 0;
1187
- margin: 0;
1188
- opacity: 0;
1189
- position: absolute;
1190
- width: 100%;
1191
- z-index: 1;
1192
-
1193
- &:not(:disabled):hover {
1194
- cursor: pointer;
1171
+ &[multiple] {
1172
+ overflow: auto;
1173
+ }
1195
1174
  }
1196
1175
  }
1197
1176
  }
1198
1177
 
1199
- @mixin input-toggle-styles {
1200
- .rmd-input-toggle {
1201
- @include interaction.surface(
1202
- $focus-selector:
1203
- if(
1204
- utils.$disable-has-selectors or utils.$disable-focus-visible,
1205
- "&:focus-within",
1206
- "&:has(:focus-visible)"
1207
- ),
1208
- $keyboard-only-focus: utils.$disable-has-selectors or
1209
- utils.$disable-focus-visible,
1210
- $disabled-selector: "&--disabled",
1211
- $higher-contrast: false
1212
- );
1213
- @include icon.set-var(color, currentcolor);
1214
-
1215
- align-items: center;
1216
- border-radius: $input-toggle-border-radius;
1217
- display: inline-flex;
1218
- flex-shrink: 0;
1219
- justify-content: center;
1220
- padding: $input-toggle-padding;
1221
-
1222
- &--em {
1223
- @include icon.set-var(size, 1em);
1224
- }
1225
-
1226
- &--active {
1227
- @include use-var(color, active-color);
1228
- }
1229
-
1230
- @if $input-toggle-small-size {
1231
- &--small {
1232
- font-size: $input-toggle-small-size;
1178
+ @mixin text-field-addon-styles($disable-layer: false) {
1179
+ @include utils.optional-layer(form, $disable-layer) {
1180
+ .rmd-text-field-addon {
1181
+ @if not
1182
+ $disable-text-field-filled-theme or not
1183
+ $disable-text-field-underlined-theme
1184
+ {
1185
+ @include use-var(margin-top, addon-margin-top);
1233
1186
  }
1234
- }
1235
1187
 
1236
- @if $input-toggle-dense-size {
1237
- &--dense {
1238
- font-size: $input-toggle-dense-size;
1188
+ // this makes it so that this container element is the same size as the
1189
+ // child (normally icons). without this, icons would have a height of 30.5px
1190
+ // and no longer be centered
1191
+ display: inline-flex;
1192
+ position: absolute;
1193
+
1194
+ // Note: Can't use `:first-child` and `:last-child` since
1195
+ // password/autocomplete managers might add another element into the
1196
+ // `.rmd-text-field-container` which would prevent these styles from being
1197
+ // applied
1198
+ &--before {
1199
+ @include utils.auto-rtl(left, get-var(label-left-offset));
1239
1200
  }
1240
- }
1241
1201
 
1242
- @if $input-toggle-normal-size {
1243
- &--normal {
1244
- font-size: $input-toggle-normal-size;
1202
+ &--after {
1203
+ @include utils.auto-rtl(right, $text-field-spacing);
1245
1204
  }
1246
- }
1247
1205
 
1248
- @if $input-toggle-large-size {
1249
- &--large {
1250
- font-size: $input-toggle-large-size;
1206
+ &--presentational {
1207
+ pointer-events: none;
1251
1208
  }
1252
1209
  }
1210
+ }
1211
+ }
1253
1212
 
1254
- @if not $disable-uncontrolled-input-toggles {
1255
- &--uncontrolled {
1256
- $icon-color-selector: ".rmd-hidden-input:where(:checked:not(:disabled)) ~ .rmd-icon";
1257
- $unchecked-icon-selector: "~ :nth-child(-n + 1 of .rmd-icon)";
1258
- $checked-icon-selector: "~ :nth-child(n + 2 of .rmd-icon)";
1259
- // make sure the active color from the label also applies to the icon when
1260
- // checked
1261
- .rmd-label--active & #{$icon-color-selector} {
1262
- @include use-var(color, focus-color);
1263
- }
1264
-
1265
- // make sure the error color applies to the icon when checked
1266
- &:where(:not(.rmd-error-color)) #{$icon-color-selector} {
1267
- @include use-var(color, active-color);
1268
- }
1213
+ @mixin hidden-input-styles($disable-layer: false) {
1214
+ @include utils.optional-layer(form, $disable-layer) {
1215
+ .rmd-hidden-input {
1216
+ height: 100%;
1217
+ inset: 0;
1218
+ margin: 0;
1219
+ opacity: 0;
1220
+ position: absolute;
1221
+ width: 100%;
1222
+ z-index: 1;
1269
1223
 
1270
- // when the input is checked, hide the first icon (unchecked state)
1271
- // when the input is not checked, hide the second icon (checked state)
1272
- .rmd-hidden-input:checked #{$unchecked-icon-selector},
1273
- .rmd-hidden-input:not(:checked) #{$checked-icon-selector} {
1274
- opacity: 0;
1275
- position: absolute;
1276
- }
1224
+ &:not(:disabled):hover {
1225
+ cursor: pointer;
1277
1226
  }
1278
1227
  }
1279
1228
  }
1280
1229
  }
1281
1230
 
1282
- @mixin switch-styles {
1283
- .rmd-switch {
1284
- padding: $switch-track-vertical-padding $switch-track-horizontal-padding;
1285
-
1286
- &--clickable:hover {
1287
- cursor: pointer;
1288
- }
1231
+ @mixin input-toggle-styles($disable-layer: false) {
1232
+ @include utils.optional-layer(form, $disable-layer) {
1233
+ .rmd-input-toggle {
1234
+ @include interaction.surface(
1235
+ $focus-selector:
1236
+ if(
1237
+ utils.$disable-has-selectors or utils.$disable-focus-visible,
1238
+ "&:focus-within",
1239
+ "&:has(:focus-visible)"
1240
+ ),
1241
+ $keyboard-only-focus: utils.$disable-has-selectors or
1242
+ utils.$disable-focus-visible,
1243
+ $disabled-selector: "&--disabled",
1244
+ $higher-contrast: false
1245
+ );
1246
+ @include icon.set-var(color, currentcolor);
1289
1247
 
1290
- &--current-color,
1291
- &--current-color .rmd-switch__input:checked + .rmd-switch__ball {
1292
- @include set-var(switch-ball-background-color, currentcolor);
1293
- }
1248
+ align-items: center;
1249
+ border-radius: $input-toggle-border-radius;
1250
+ display: inline-flex;
1251
+ flex-shrink: 0;
1252
+ justify-content: center;
1253
+ padding: $input-toggle-padding;
1294
1254
 
1295
- &__input {
1296
- @if utils.$disable-focus-visible {
1297
- @include utils.keyboard-only {
1298
- &:focus + .rmd-switch__ball::before {
1299
- @include interaction.focus-styles;
1300
- }
1301
- }
1302
- } @else {
1303
- &:focus-visible + .rmd-switch__ball::before {
1304
- @include interaction.focus-styles;
1305
- }
1255
+ &--em {
1256
+ @include icon.set-var(size, 1em);
1306
1257
  }
1307
1258
 
1308
- &:disabled + .rmd-switch__ball {
1309
- cursor: auto;
1259
+ &--active {
1260
+ @include use-var(color, active-color);
1261
+ }
1310
1262
 
1311
- &:hover::before {
1312
- @include interaction.set-var(background-color, transparent);
1263
+ @if $input-toggle-small-size {
1264
+ &--small {
1265
+ font-size: $input-toggle-small-size;
1313
1266
  }
1314
1267
  }
1315
- }
1316
1268
 
1317
- &__track {
1318
- @if not $disable-switch-circular-progress {
1319
- @include progress.set-var(
1320
- circular-stroke-width,
1321
- $switch-circular-progress-width
1322
- );
1323
- @include progress.set-var(
1324
- circular-size,
1325
- $switch-circular-progress-size
1326
- );
1327
- }
1328
- @if not $disable-switch-icon {
1329
- @include icon.set-var(size, $switch-icon-size);
1269
+ @if $input-toggle-dense-size {
1270
+ &--dense {
1271
+ font-size: $input-toggle-dense-size;
1272
+ }
1330
1273
  }
1331
- @include use-var(background-color, switch-track-background-color);
1332
1274
 
1333
- border-radius: $switch-track-border-radius;
1334
- height: $switch-track-height;
1335
- position: relative;
1336
- transition: background-color transition.$linear-duration
1337
- transition.$linear-timing-function;
1338
- width: $switch-track-width;
1339
-
1340
- &--disabled {
1341
- opacity: $switch-disabled-opacity;
1275
+ @if $input-toggle-normal-size {
1276
+ &--normal {
1277
+ font-size: $input-toggle-normal-size;
1278
+ }
1342
1279
  }
1343
- }
1344
-
1345
- &__ball {
1346
- // The focus and disabled states are handled by the `.rmd-switch__input`'s
1347
- // :focus and :disabled' states instead.
1348
- @include interaction.surface(
1349
- $focus-selector: null,
1350
- $disabled-selector: null,
1351
- $clickable: false
1352
- );
1353
- @include utils.auto-rtl(left, calc(-50% + #{$switch-ball-offset}));
1354
1280
 
1355
- align-items: center;
1356
- border-radius: $switch-ball-border-radius;
1357
- display: flex;
1358
- height: $switch-ball-size * 2;
1359
- justify-content: center;
1360
- top: calc(-50% - #{$switch-ball-size - $switch-track-height});
1361
- transition-duration: transition.$linear-duration;
1362
- transition-property: background-color, transform;
1363
- transition-timing-function: transition.$linear-timing-function;
1364
- width: $switch-ball-size * 2;
1365
- z-index: 1;
1366
-
1367
- &::after {
1368
- @include use-var(background-color, switch-ball-background-color);
1369
-
1370
- border-radius: inherit;
1371
- box-shadow: box-shadows.box-shadow(1);
1372
- content: "";
1373
- height: $switch-ball-size;
1374
- left: 25%;
1375
- pointer-events: none;
1376
- position: absolute;
1377
- top: 25%;
1378
- width: $switch-ball-size;
1379
- z-index: 0;
1281
+ @if $input-toggle-large-size {
1282
+ &--large {
1283
+ font-size: $input-toggle-large-size;
1284
+ }
1380
1285
  }
1381
1286
 
1382
- $active-selector: ".rmd-switch__input:checked + &" +
1383
- if($disable-menu-item-switch, "", ", &--active");
1287
+ @if not $disable-uncontrolled-input-toggles {
1288
+ &--uncontrolled {
1289
+ $icon-color-selector: ".rmd-hidden-input:where(:checked:not(:disabled)) ~ .rmd-icon";
1290
+ $unchecked-icon-selector: "~ :nth-child(-n + 1 of .rmd-icon)";
1291
+ $checked-icon-selector: "~ :nth-child(n + 2 of .rmd-icon)";
1292
+ // make sure the active color from the label also applies to the icon when
1293
+ // checked
1294
+ .rmd-label--active & #{$icon-color-selector} {
1295
+ @include use-var(color, focus-color);
1296
+ }
1384
1297
 
1385
- #{$active-selector} {
1386
- $offset: $switch-ball-size + $switch-ball-offset;
1298
+ // make sure the error color applies to the icon when checked
1299
+ &:where(:not(.rmd-error-color)) #{$icon-color-selector} {
1300
+ @include use-var(color, active-color);
1301
+ }
1387
1302
 
1388
- @include utils.rtl {
1389
- transform: translateX(-$offset);
1303
+ // when the input is checked, hide the first icon (unchecked state)
1304
+ // when the input is not checked, hide the second icon (checked state)
1305
+ .rmd-hidden-input:checked #{$unchecked-icon-selector},
1306
+ .rmd-hidden-input:not(:checked) #{$checked-icon-selector} {
1307
+ opacity: 0;
1308
+ position: absolute;
1309
+ }
1390
1310
  }
1391
- @include set-var(switch-ball-background-color, get-var(active-color));
1392
-
1393
- transform: translateX($offset);
1394
1311
  }
1395
1312
  }
1396
1313
  }
1397
1314
  }
1398
1315
 
1399
- @mixin menu-item-input-toggle-styles {
1400
- .rmd-menu-item-input-toggle {
1401
- @if not $disable-menu-item-radio or not $disable-menu-item-switch {
1402
- &__icon {
1403
- // remove the padding since the icon isn't the click target anymore.
1404
- padding: 0;
1316
+ @mixin switch-styles($disable-layer: false) {
1317
+ @include utils.optional-layer(form, $disable-layer) {
1318
+ .rmd-switch {
1319
+ padding: $switch-track-vertical-padding $switch-track-horizontal-padding;
1405
1320
 
1406
- // disable the hover states since it's handled by the ListItem instead
1407
- &::before {
1408
- content: none;
1409
- }
1321
+ &--clickable:hover {
1322
+ cursor: pointer;
1410
1323
  }
1411
- }
1412
1324
 
1413
- @if not $disable-menu-item-switch {
1414
- // this makes it so that the spacing between the switch and the text
1415
- // aligns with other menu items/icons
1416
- &__track {
1417
- @include icon.set-var(size, $switch-track-width);
1325
+ &--current-color,
1326
+ &--current-color .rmd-switch__input:checked + .rmd-switch__ball {
1327
+ @include set-var(switch-ball-background-color, currentcolor);
1418
1328
  }
1419
1329
 
1420
- // decrease the ball size and remove the hover states since it's handled
1421
- // by the ListItem instead. without decreasing the ball size, horizontal
1422
- // scrollbars will appear when the switch is checked
1423
- &__ball {
1424
- @include utils.auto-rtl(left, -$switch-ball-offset);
1330
+ &__input {
1331
+ @if utils.$disable-focus-visible {
1332
+ @include utils.keyboard-only {
1333
+ &:focus + .rmd-switch__ball::before {
1334
+ @include interaction.focus-styles;
1335
+ }
1336
+ }
1337
+ } @else {
1338
+ &:focus-visible + .rmd-switch__ball::before {
1339
+ @include interaction.focus-styles;
1340
+ }
1341
+ }
1425
1342
 
1426
- height: $switch-ball-size;
1427
- top: calc(50% - $switch-ball-size * 0.5);
1428
- width: $switch-ball-size;
1343
+ &:disabled + .rmd-switch__ball {
1344
+ cursor: auto;
1429
1345
 
1430
- &::before {
1431
- content: none;
1346
+ &:hover::before {
1347
+ @include interaction.set-var(background-color, transparent);
1348
+ }
1432
1349
  }
1350
+ }
1433
1351
 
1434
- &::after {
1435
- inset: 0;
1352
+ &__track {
1353
+ @if not $disable-switch-circular-progress {
1354
+ @include progress.set-var(
1355
+ circular-stroke-width,
1356
+ $switch-circular-progress-width
1357
+ );
1358
+ @include progress.set-var(
1359
+ circular-size,
1360
+ $switch-circular-progress-size
1361
+ );
1436
1362
  }
1437
- }
1438
- }
1439
- }
1440
- }
1363
+ @if not $disable-switch-icon {
1364
+ @include icon.set-var(size, $switch-icon-size);
1365
+ }
1366
+ @include use-var(background-color, switch-track-background-color);
1441
1367
 
1442
- @mixin slider-styles {
1443
- .rmd-slider-container {
1444
- @if $slider-container-addon-spacing and
1445
- $slider-container-addon-spacing !=
1446
- icon.$spacing
1447
- {
1448
- @include icon.set-var(spacing, $slider-container-addon-spacing);
1449
- }
1368
+ border-radius: $switch-track-border-radius;
1369
+ height: $switch-track-height;
1370
+ position: relative;
1371
+ transition: background-color transition.$linear-duration
1372
+ transition.$linear-timing-function;
1373
+ width: $switch-track-width;
1450
1374
 
1451
- @include icon.use-var(gap, spacing);
1375
+ &--disabled {
1376
+ opacity: $switch-disabled-opacity;
1377
+ }
1378
+ }
1452
1379
 
1453
- align-items: center;
1380
+ &__ball {
1381
+ // The focus and disabled states are handled by the `.rmd-switch__input`'s
1382
+ // :focus and :disabled' states instead.
1383
+ @include interaction.surface(
1384
+ $focus-selector: null,
1385
+ $disabled-selector: null,
1386
+ $clickable: false
1387
+ );
1388
+ @include utils.auto-rtl(left, calc(-50% + #{$switch-ball-offset}));
1454
1389
 
1455
- @if not $disable-horizontal-slider {
1456
- &--h {
1390
+ align-items: center;
1391
+ border-radius: $switch-ball-border-radius;
1457
1392
  display: flex;
1458
- width: 100%;
1459
- }
1393
+ height: $switch-ball-size * 2;
1394
+ justify-content: center;
1395
+ top: calc(-50% - #{$switch-ball-size - $switch-track-height});
1396
+ transition-duration: transition.$linear-duration;
1397
+ transition-property: background-color, transform;
1398
+ transition-timing-function: transition.$linear-timing-function;
1399
+ width: $switch-ball-size * 2;
1400
+ z-index: 1;
1460
1401
 
1461
- &--pad-left {
1462
- padding-left: $slider-container-padding;
1463
- }
1402
+ &::after {
1403
+ @include use-var(background-color, switch-ball-background-color);
1464
1404
 
1465
- &--pad-right {
1466
- padding-right: $slider-container-padding;
1467
- }
1468
- }
1405
+ border-radius: inherit;
1406
+ box-shadow: box-shadows.box-shadow(1);
1407
+ content: "";
1408
+ height: $switch-ball-size;
1409
+ left: 25%;
1410
+ pointer-events: none;
1411
+ position: absolute;
1412
+ top: 25%;
1413
+ width: $switch-ball-size;
1414
+ z-index: 0;
1415
+ }
1469
1416
 
1470
- @if not $disable-vertical-slider {
1471
- &--v {
1472
- display: inline-flex;
1473
- flex-direction: column-reverse;
1474
- }
1417
+ $active-selector: ".rmd-switch__input:checked + &" +
1418
+ if($disable-menu-item-switch, "", ", &--active");
1475
1419
 
1476
- &--pad-top {
1477
- padding-top: $slider-container-padding;
1478
- }
1420
+ #{$active-selector} {
1421
+ $offset: $switch-ball-size + $switch-ball-offset;
1479
1422
 
1480
- &--pad-bottom {
1481
- padding-bottom: $slider-container-padding;
1482
- }
1483
- }
1484
- }
1485
-
1486
- .rmd-slider-track {
1487
- position: relative;
1423
+ @include utils.rtl {
1424
+ transform: translateX(-$offset);
1425
+ }
1426
+ @include set-var(switch-ball-background-color, get-var(active-color));
1488
1427
 
1489
- &::before,
1490
- &::after {
1491
- @if $slider-track-color {
1492
- @include use-var(background-color, slider-color);
1428
+ transform: translateX($offset);
1429
+ }
1493
1430
  }
1494
-
1495
- content: "";
1496
- pointer-events: none;
1497
- position: absolute;
1498
1431
  }
1432
+ }
1433
+ }
1499
1434
 
1500
- &::before {
1501
- @if not $slider-track-color {
1502
- @include use-var(background-color, slider-inactive-color);
1503
- }
1504
-
1505
- opacity: $slider-track-inactive-opacity;
1506
- z-index: $slider-track-inactive-z-index;
1507
- }
1435
+ @mixin menu-item-input-toggle-styles($disable-layer: false) {
1436
+ @include utils.optional-layer(form, $disable-layer) {
1437
+ .rmd-menu-item-input-toggle {
1438
+ @if not $disable-menu-item-radio or not $disable-menu-item-switch {
1439
+ &__icon {
1440
+ // remove the padding since the icon isn't the click target anymore.
1441
+ padding: 0;
1508
1442
 
1509
- &::after {
1510
- @if not $slider-track-color {
1511
- @include use-var(background-color, slider-active-color);
1443
+ // disable the hover states since it's handled by the ListItem instead
1444
+ &::before {
1445
+ content: none;
1446
+ }
1447
+ }
1512
1448
  }
1513
1449
 
1514
- opacity: $slider-track-active-opacity;
1515
- z-index: $slider-track-active-z-index;
1516
- }
1450
+ @if not $disable-menu-item-switch {
1451
+ // this makes it so that the spacing between the switch and the text
1452
+ // aligns with other menu items/icons
1453
+ &__track {
1454
+ @include icon.set-var(size, $switch-track-width);
1455
+ }
1517
1456
 
1518
- &--hoverable:hover {
1519
- cursor: pointer;
1520
- }
1457
+ // decrease the ball size and remove the hover states since it's handled
1458
+ // by the ListItem instead. without decreasing the ball size, horizontal
1459
+ // scrollbars will appear when the switch is checked
1460
+ &__ball {
1461
+ @include utils.auto-rtl(left, -$switch-ball-offset);
1521
1462
 
1522
- &--animate::after {
1523
- transition-duration: $slider-transition-duration;
1524
- transition-timing-function: $slider-transition-timing-function;
1525
- }
1463
+ height: $switch-ball-size;
1464
+ top: calc(50% - $switch-ball-size * 0.5);
1465
+ width: $switch-ball-size;
1526
1466
 
1527
- @if $slider-track-color {
1528
- &--disabled {
1529
- @include set-var(slider-color, $slider-track-disabled-color);
1530
-
1531
- @if $slider-track-inactive-opacity {
1532
1467
  &::before {
1533
- opacity: 1;
1468
+ content: none;
1534
1469
  }
1535
- }
1536
1470
 
1537
- &::after {
1538
- @include set-var(slider-active-size, 0px);
1539
- @if $slider-track-active-opacity {
1540
- opacity: 1;
1471
+ &::after {
1472
+ inset: 0;
1541
1473
  }
1542
1474
  }
1543
1475
  }
1544
1476
  }
1477
+ }
1478
+ }
1545
1479
 
1546
- @if not $disable-horizontal-slider {
1547
- &--h {
1548
- @include use-var(height, slider-size);
1480
+ @mixin slider-styles($disable-layer: false) {
1481
+ @include utils.optional-layer(form, $disable-layer) {
1482
+ .rmd-slider-container {
1483
+ @if $slider-container-addon-spacing and
1484
+ $slider-container-addon-spacing !=
1485
+ icon.$spacing
1486
+ {
1487
+ @include icon.set-var(spacing, $slider-container-addon-spacing);
1488
+ }
1549
1489
 
1550
- align-items: center;
1551
- display: flex;
1552
- width: 100%;
1490
+ @include icon.use-var(gap, spacing);
1553
1491
 
1554
- &::before {
1555
- @include use-var(height, slider-inactive-size);
1492
+ align-items: center;
1556
1493
 
1494
+ @if not $disable-horizontal-slider {
1495
+ &--h {
1496
+ display: flex;
1557
1497
  width: 100%;
1558
1498
  }
1559
1499
 
1560
- &::after {
1561
- @include use-var(height, slider-active-size);
1500
+ &--pad-left {
1501
+ padding-left: $slider-container-padding;
1562
1502
  }
1563
- }
1564
1503
 
1565
- &--h1::after {
1566
- @include utils.auto-rtl(left, 0);
1567
- @include use-var(max-width, slider-offset-1);
1568
-
1569
- transition-property: max-width;
1570
- width: 100%;
1504
+ &--pad-right {
1505
+ padding-right: $slider-container-padding;
1506
+ }
1571
1507
  }
1572
1508
 
1573
- @if not $disable-range-slider {
1574
- &--h2::after {
1575
- @include utils.rtl {
1576
- left: calc(100% - get-var(slider-offset-2));
1577
- right: get-var(slider-offset-1);
1578
- }
1509
+ @if not $disable-vertical-slider {
1510
+ &--v {
1511
+ display: inline-flex;
1512
+ flex-direction: column-reverse;
1513
+ }
1514
+
1515
+ &--pad-top {
1516
+ padding-top: $slider-container-padding;
1517
+ }
1579
1518
 
1580
- left: get-var(slider-offset-1);
1581
- right: calc(100% - get-var(slider-offset-2));
1582
- transition-property: left, right;
1583
- will-change: left, right;
1519
+ &--pad-bottom {
1520
+ padding-bottom: $slider-container-padding;
1584
1521
  }
1585
1522
  }
1586
1523
  }
1587
1524
 
1588
- @if not $disable-vertical-slider {
1589
- &--v {
1590
- @include use-var(height, slider-vertical-size);
1591
- @include use-var(width, slider-size);
1525
+ .rmd-slider-track {
1526
+ position: relative;
1592
1527
 
1593
- display: inline-flex;
1594
- justify-content: center;
1528
+ &::before,
1529
+ &::after {
1530
+ @if $slider-track-color {
1531
+ @include use-var(background-color, slider-color);
1532
+ }
1595
1533
 
1596
- &::before {
1597
- @include use-var(width, slider-inactive-size);
1534
+ content: "";
1535
+ pointer-events: none;
1536
+ position: absolute;
1537
+ }
1598
1538
 
1599
- height: 100%;
1539
+ &::before {
1540
+ @if not $slider-track-color {
1541
+ @include use-var(background-color, slider-inactive-color);
1600
1542
  }
1601
1543
 
1602
- &::after {
1603
- @include use-var(width, slider-active-size);
1544
+ opacity: $slider-track-inactive-opacity;
1545
+ z-index: $slider-track-inactive-z-index;
1546
+ }
1604
1547
 
1605
- bottom: 0;
1548
+ &::after {
1549
+ @if not $slider-track-color {
1550
+ @include use-var(background-color, slider-active-color);
1606
1551
  }
1552
+
1553
+ opacity: $slider-track-active-opacity;
1554
+ z-index: $slider-track-active-z-index;
1607
1555
  }
1608
1556
 
1609
- // one thumb track horizontal styles
1610
- &--v1::after {
1611
- @include use-var(max-height, slider-offset-1);
1557
+ &--hoverable:hover {
1558
+ cursor: pointer;
1559
+ }
1612
1560
 
1613
- height: 100%;
1614
- transition-property: max-height;
1561
+ &--animate::after {
1562
+ transition-duration: $slider-transition-duration;
1563
+ transition-timing-function: $slider-transition-timing-function;
1615
1564
  }
1616
1565
 
1617
- @if not $disable-range-slider {
1618
- // two thumb track horizontal styles
1619
- &--v2::after {
1620
- @include use-var(bottom, slider-offset-1);
1566
+ @if $slider-track-color {
1567
+ &--disabled {
1568
+ @include set-var(slider-color, $slider-track-disabled-color);
1569
+
1570
+ @if $slider-track-inactive-opacity {
1571
+ &::before {
1572
+ opacity: 1;
1573
+ }
1574
+ }
1621
1575
 
1622
- top: calc(100% - #{get-var(slider-offset-2)});
1623
- transition-property: bottom, top;
1624
- will-change: bottom, top;
1576
+ &::after {
1577
+ @include set-var(slider-active-size, 0px);
1578
+ @if $slider-track-active-opacity {
1579
+ opacity: 1;
1580
+ }
1581
+ }
1625
1582
  }
1626
1583
  }
1627
- }
1628
- }
1629
1584
 
1630
- .rmd-slider-thumb {
1631
- @include use-var(
1632
- background-color,
1633
- if($slider-track-color, slider-color, slider-active-color)
1634
- );
1585
+ @if not $disable-horizontal-slider {
1586
+ &--h {
1587
+ @include use-var(height, slider-size);
1635
1588
 
1636
- border-radius: $slider-thumb-border-radius;
1637
- height: $slider-thumb-size;
1638
- outline-style: none;
1639
- position: absolute;
1640
- width: $slider-thumb-size;
1641
- z-index: $slider-thumb-z-index;
1589
+ align-items: center;
1590
+ display: flex;
1591
+ width: 100%;
1642
1592
 
1643
- &::after {
1644
- @include utils.pseudo-element($z-index: null);
1593
+ &::before {
1594
+ @include use-var(height, slider-inactive-size);
1645
1595
 
1646
- background-color: inherit;
1647
- opacity: $slider-thumb-bubble-opacity;
1648
- transition: transform $slider-transition-duration
1649
- $slider-transition-timing-function;
1650
- }
1596
+ width: 100%;
1597
+ }
1651
1598
 
1652
- @if utils.$disable-focus-visible {
1653
- @include utils.keyboard-only {
1654
- &:focus::after {
1655
- transform: scale($slider-thumb-focus-scale);
1599
+ &::after {
1600
+ @include use-var(height, slider-active-size);
1601
+ }
1656
1602
  }
1657
- }
1658
- } @else {
1659
- &:focus-visible::after {
1660
- transform: scale($slider-thumb-focus-scale);
1661
- }
1662
- }
1663
-
1664
- @include utils.mouse-hover(false) {
1665
- &:hover::after,
1666
- &--active::after,
1667
- &--active:hover::after {
1668
- transform: scale($slider-thumb-active-scale);
1669
- }
1670
- }
1671
1603
 
1672
- &--animate {
1673
- transition-duration: $slider-transition-duration;
1674
- transition-timing-function: $slider-transition-timing-function;
1675
- }
1604
+ &--h1::after {
1605
+ @include utils.auto-rtl(left, 0);
1606
+ @include use-var(max-width, slider-offset-1);
1676
1607
 
1677
- &--disabled {
1678
- background-color: $slider-thumb-disabled-color;
1608
+ transition-property: max-width;
1609
+ width: 100%;
1610
+ }
1679
1611
 
1680
- // prevent hover effects like the "bubble"
1681
- pointer-events: none;
1682
- }
1612
+ @if not $disable-range-slider {
1613
+ &--h2::after {
1614
+ @include utils.rtl {
1615
+ left: calc(100% - get-var(slider-offset-2));
1616
+ right: get-var(slider-offset-1);
1617
+ }
1618
+
1619
+ left: get-var(slider-offset-1);
1620
+ right: calc(100% - get-var(slider-offset-2));
1621
+ transition-property: left, right;
1622
+ will-change: left, right;
1623
+ }
1624
+ }
1625
+ }
1683
1626
 
1684
- &--mask {
1685
- @include theme.theme-use-var(background-color);
1627
+ @if not $disable-vertical-slider {
1628
+ &--v {
1629
+ @include use-var(height, slider-vertical-size);
1630
+ @include use-var(width, slider-size);
1686
1631
 
1687
- border-radius: 0;
1688
- }
1632
+ display: inline-flex;
1633
+ justify-content: center;
1689
1634
 
1690
- @if not $disable-horizontal-slider {
1691
- &--h {
1692
- @include utils.rtl {
1693
- transform: translateX(50%);
1694
- transition-property: right;
1695
- }
1635
+ &::before {
1636
+ @include use-var(width, slider-inactive-size);
1696
1637
 
1697
- transform: translateX(-50%);
1698
- transition-property: left;
1699
- }
1638
+ height: 100%;
1639
+ }
1700
1640
 
1701
- &--h1 {
1702
- @include utils.auto-rtl(left, get-var(slider-offset-1));
1703
- }
1641
+ &::after {
1642
+ @include use-var(width, slider-active-size);
1704
1643
 
1705
- @if not $disable-range-slider {
1706
- &--h2 {
1707
- @include utils.auto-rtl(left, get-var(slider-offset-2));
1644
+ bottom: 0;
1645
+ }
1708
1646
  }
1709
- }
1710
1647
 
1711
- &--disabled-h {
1712
- @include utils.rtl {
1713
- transform: translateX(50%) scale($slider-thumb-disabled-scale);
1648
+ // one thumb track horizontal styles
1649
+ &--v1::after {
1650
+ @include use-var(max-height, slider-offset-1);
1651
+
1652
+ height: 100%;
1653
+ transition-property: max-height;
1714
1654
  }
1715
1655
 
1716
- transform: translateX(-50%) scale($slider-thumb-disabled-scale);
1717
- }
1656
+ @if not $disable-range-slider {
1657
+ // two thumb track horizontal styles
1658
+ &--v2::after {
1659
+ @include use-var(bottom, slider-offset-1);
1718
1660
 
1719
- &--mask-h {
1720
- @include utils.rtl {
1721
- transform: translateX(50%) scale($slider-thumb-mask-scale);
1661
+ top: calc(100% - #{get-var(slider-offset-2)});
1662
+ transition-property: bottom, top;
1663
+ will-change: bottom, top;
1664
+ }
1722
1665
  }
1723
-
1724
- transform: translateX(-50%) scale($slider-thumb-mask-scale);
1725
1666
  }
1726
1667
  }
1727
1668
 
1728
- @if not $disable-vertical-slider {
1729
- &--v {
1730
- // want the thumb to be aligned so that the center is at the current value.
1731
- // without this transformation, the thumb's bottom side would be aligned
1732
- // with the current value
1733
- transform: translateY(50%);
1734
- transition-property: bottom;
1735
- }
1669
+ .rmd-slider-thumb {
1670
+ @include use-var(
1671
+ background-color,
1672
+ if($slider-track-color, slider-color, slider-active-color)
1673
+ );
1674
+
1675
+ border-radius: $slider-thumb-border-radius;
1676
+ height: $slider-thumb-size;
1677
+ outline-style: none;
1678
+ position: absolute;
1679
+ width: $slider-thumb-size;
1680
+ z-index: $slider-thumb-z-index;
1681
+
1682
+ &::after {
1683
+ @include utils.pseudo-element($z-index: null);
1736
1684
 
1737
- &--v1 {
1738
- @include use-var(bottom, slider-offset-1);
1685
+ background-color: inherit;
1686
+ opacity: $slider-thumb-bubble-opacity;
1687
+ transition: transform $slider-transition-duration
1688
+ $slider-transition-timing-function;
1739
1689
  }
1740
1690
 
1741
- @if not $disable-range-slider {
1742
- &--v2 {
1743
- @include use-var(bottom, slider-offset-2);
1691
+ @if utils.$disable-focus-visible {
1692
+ @include utils.keyboard-only {
1693
+ &:focus::after {
1694
+ transform: scale($slider-thumb-focus-scale);
1695
+ }
1696
+ }
1697
+ } @else {
1698
+ &:focus-visible::after {
1699
+ transform: scale($slider-thumb-focus-scale);
1744
1700
  }
1745
1701
  }
1746
1702
 
1747
- &--disabled-v {
1748
- transform: translateY(50%) scale($slider-thumb-disabled-scale);
1703
+ @include utils.mouse-hover(false) {
1704
+ &:hover::after,
1705
+ &--active::after,
1706
+ &--active:hover::after {
1707
+ transform: scale($slider-thumb-active-scale);
1708
+ }
1749
1709
  }
1750
1710
 
1751
- &--mask-v {
1752
- transform: translateY(50%) scale($slider-thumb-mask-scale);
1711
+ &--animate {
1712
+ transition-duration: $slider-transition-duration;
1713
+ transition-timing-function: $slider-transition-timing-function;
1753
1714
  }
1754
- }
1755
-
1756
- &__input {
1757
- appearance: none;
1758
- height: 0;
1759
- opacity: 0;
1760
- pointer-events: none;
1761
- width: 0;
1762
- }
1763
- }
1764
1715
 
1765
- @if not $disable-discrete-slider {
1766
- .rmd-slider-tooltip {
1767
- opacity: 1;
1768
- position: absolute;
1769
- z-index: $slider-tooltip-z-index;
1716
+ &--disabled {
1717
+ background-color: $slider-thumb-disabled-color;
1770
1718
 
1771
- // this is used to generate the triangle
1772
- &::after {
1773
- border: $slider-tooltip-caret-size solid transparent;
1774
- content: "";
1775
- position: absolute;
1719
+ // prevent hover effects like the "bubble"
1720
+ pointer-events: none;
1776
1721
  }
1777
1722
 
1778
- &--animate {
1779
- transition: transform
1780
- $slider-transition-duration
1781
- $slider-transition-timing-function;
1723
+ &--mask {
1724
+ @include theme.theme-use-var(background-color);
1725
+
1726
+ border-radius: 0;
1782
1727
  }
1783
1728
 
1784
1729
  @if not $disable-horizontal-slider {
1785
1730
  &--h {
1786
1731
  @include utils.rtl {
1787
- @include set-var(slider-tooltip-translate, 50%);
1732
+ transform: translateX(50%);
1733
+ transition-property: right;
1788
1734
  }
1789
1735
 
1790
- top: $slider-tooltip-offset;
1791
- transform: translateX(get-var(slider-tooltip-translate))
1792
- scale(get-var(slider-tooltip-scale));
1736
+ transform: translateX(-50%);
1737
+ transition-property: left;
1738
+ }
1793
1739
 
1794
- &::after {
1795
- @include tooltip.use-var(border-top-color, background-color);
1740
+ &--h1 {
1741
+ @include utils.auto-rtl(left, get-var(slider-offset-1));
1742
+ }
1796
1743
 
1797
- left: 50%;
1798
- top: 100%;
1799
- transform: translateX(get-var(slider-tooltip-translate));
1744
+ @if not $disable-range-slider {
1745
+ &--h2 {
1746
+ @include utils.auto-rtl(left, get-var(slider-offset-2));
1800
1747
  }
1801
1748
  }
1802
1749
 
1803
- &--h-off {
1804
- @include set-var(slider-tooltip-scale, 0);
1750
+ &--disabled-h {
1751
+ @include utils.rtl {
1752
+ transform: translateX(50%) scale($slider-thumb-disabled-scale);
1753
+ }
1754
+
1755
+ transform: translateX(-50%) scale($slider-thumb-disabled-scale);
1805
1756
  }
1806
1757
 
1807
- // have to "duplicate" these styles since the `--h-off` would override the
1808
- // `--h` styles due to css order.
1809
- &--h-on {
1810
- @include set-var(slider-tooltip-scale, 1);
1758
+ &--mask-h {
1759
+ @include utils.rtl {
1760
+ transform: translateX(50%) scale($slider-thumb-mask-scale);
1761
+ }
1762
+
1763
+ transform: translateX(-50%) scale($slider-thumb-mask-scale);
1811
1764
  }
1812
1765
  }
1813
1766
 
1814
1767
  @if not $disable-vertical-slider {
1815
1768
  &--v {
1816
- // going to force rendering always to the left even in RTL languages
1817
- left: $slider-tooltip-offset;
1818
- transform: translateY(50%) scale(1);
1769
+ // want the thumb to be aligned so that the center is at the current value.
1770
+ // without this transformation, the thumb's bottom side would be aligned
1771
+ // with the current value
1772
+ transform: translateY(50%);
1773
+ transition-property: bottom;
1774
+ }
1819
1775
 
1820
- &::after {
1821
- @include tooltip.use-var(border-left-color, background-color);
1776
+ &--v1 {
1777
+ @include use-var(bottom, slider-offset-1);
1778
+ }
1822
1779
 
1823
- left: 100%;
1824
- top: 50%;
1825
- transform: translateY(-50%);
1780
+ @if not $disable-range-slider {
1781
+ &--v2 {
1782
+ @include use-var(bottom, slider-offset-2);
1826
1783
  }
1827
1784
  }
1828
1785
 
1829
- &--v-off {
1830
- transform: translateY(50%) scale(0);
1786
+ &--disabled-v {
1787
+ transform: translateY(50%) scale($slider-thumb-disabled-scale);
1831
1788
  }
1832
1789
 
1833
- // have to "duplicate" these styles since the `--v-off` would override the
1834
- // `--v` styles due to css order.
1835
- &--v-on {
1836
- transform: translateY(50%) scale(1);
1790
+ &--mask-v {
1791
+ transform: translateY(50%) scale($slider-thumb-mask-scale);
1837
1792
  }
1838
1793
  }
1794
+
1795
+ &__input {
1796
+ appearance: none;
1797
+ height: 0;
1798
+ opacity: 0;
1799
+ pointer-events: none;
1800
+ width: 0;
1801
+ }
1839
1802
  }
1840
- }
1841
1803
 
1842
- @if not $disable-discrete-slider-marks {
1843
- .rmd-slider-mark {
1844
- border-radius: $slider-mark-border-radius;
1845
- position: absolute;
1804
+ @if not $disable-discrete-slider {
1805
+ .rmd-slider-tooltip {
1806
+ opacity: 1;
1807
+ position: absolute;
1808
+ z-index: $slider-tooltip-z-index;
1846
1809
 
1847
- &--inactive {
1848
- @include use-var(background-color, slider-mark-inactive-color);
1849
- @include use-var(opacity, slider-mark-inactive-opacity);
1810
+ // this is used to generate the triangle
1811
+ &::after {
1812
+ border: $slider-tooltip-caret-size solid transparent;
1813
+ content: "";
1814
+ position: absolute;
1815
+ }
1850
1816
 
1851
- z-index: $slider-mark-inactive-z-index;
1852
- }
1817
+ &--animate {
1818
+ transition: transform
1819
+ $slider-transition-duration
1820
+ $slider-transition-timing-function;
1821
+ }
1853
1822
 
1854
- &--active {
1855
- @include use-var(background-color, slider-mark-active-color);
1856
- @include use-var(opacity, slider-mark-active-opacity);
1823
+ @if not $disable-horizontal-slider {
1824
+ &--h {
1825
+ @include utils.rtl {
1826
+ @include set-var(slider-tooltip-translate, 50%);
1827
+ }
1857
1828
 
1858
- z-index: $slider-mark-active-z-index;
1859
- }
1829
+ top: $slider-tooltip-offset;
1830
+ transform: translateX(get-var(slider-tooltip-translate))
1831
+ scale(get-var(slider-tooltip-scale));
1860
1832
 
1861
- @if not $disable-horizontal-slider {
1862
- &--h {
1863
- @include utils.auto-rtl(left, get-var(slider-mark-offset));
1833
+ &::after {
1834
+ @include tooltip.use-var(border-top-color, background-color);
1835
+
1836
+ left: 50%;
1837
+ top: 100%;
1838
+ transform: translateX(get-var(slider-tooltip-translate));
1839
+ }
1840
+ }
1841
+
1842
+ &--h-off {
1843
+ @include set-var(slider-tooltip-scale, 0);
1844
+ }
1864
1845
 
1865
- height: $slider-mark-height;
1866
- top: 50%;
1867
- transform: translateY(-50%);
1868
- width: $slider-mark-width;
1846
+ // have to "duplicate" these styles since the `--h-off` would override the
1847
+ // `--h` styles due to css order.
1848
+ &--h-on {
1849
+ @include set-var(slider-tooltip-scale, 1);
1850
+ }
1869
1851
  }
1870
- }
1871
1852
 
1872
- @if not $disable-vertical-slider {
1873
- &--v {
1874
- bottom: get-var(slider-mark-offset);
1875
- height: $slider-mark-width;
1876
- transform: translateY(50%);
1877
- width: $slider-mark-height;
1853
+ @if not $disable-vertical-slider {
1854
+ &--v {
1855
+ // going to force rendering always to the left even in RTL languages
1856
+ left: $slider-tooltip-offset;
1857
+ transform: translateY(50%) scale(1);
1858
+
1859
+ &::after {
1860
+ @include tooltip.use-var(border-left-color, background-color);
1861
+
1862
+ left: 100%;
1863
+ top: 50%;
1864
+ transform: translateY(-50%);
1865
+ }
1866
+ }
1867
+
1868
+ &--v-off {
1869
+ transform: translateY(50%) scale(0);
1870
+ }
1871
+
1872
+ // have to "duplicate" these styles since the `--v-off` would override the
1873
+ // `--v` styles due to css order.
1874
+ &--v-on {
1875
+ transform: translateY(50%) scale(1);
1876
+ }
1878
1877
  }
1879
1878
  }
1880
1879
  }
1881
- }
1882
1880
 
1883
- @if not $disable-discrete-slider-marks-labels {
1884
- .rmd-slider-mark-label {
1885
- position: absolute;
1881
+ @if not $disable-discrete-slider-marks {
1882
+ .rmd-slider-mark {
1883
+ border-radius: $slider-mark-border-radius;
1884
+ position: absolute;
1886
1885
 
1887
- @if not $disable-horizontal-slider {
1888
- &--h {
1889
- @include utils.rtl {
1890
- @include use-var(right, slider-mark-offset);
1886
+ &--inactive {
1887
+ @include use-var(background-color, slider-mark-inactive-color);
1888
+ @include use-var(opacity, slider-mark-inactive-opacity);
1891
1889
 
1892
- left: auto;
1893
- transform: translateX(50%);
1890
+ z-index: $slider-mark-inactive-z-index;
1891
+ }
1892
+
1893
+ &--active {
1894
+ @include use-var(background-color, slider-mark-active-color);
1895
+ @include use-var(opacity, slider-mark-active-opacity);
1896
+
1897
+ z-index: $slider-mark-active-z-index;
1898
+ }
1899
+
1900
+ @if not $disable-horizontal-slider {
1901
+ &--h {
1902
+ @include utils.auto-rtl(left, get-var(slider-mark-offset));
1903
+
1904
+ height: $slider-mark-height;
1905
+ top: 50%;
1906
+ transform: translateY(-50%);
1907
+ width: $slider-mark-width;
1894
1908
  }
1895
- @include use-var(left, slider-mark-offset);
1909
+ }
1896
1910
 
1897
- top: 100%;
1898
- transform: translateX(-50%);
1911
+ @if not $disable-vertical-slider {
1912
+ &--v {
1913
+ bottom: get-var(slider-mark-offset);
1914
+ height: $slider-mark-width;
1915
+ transform: translateY(50%);
1916
+ width: $slider-mark-height;
1917
+ }
1899
1918
  }
1900
1919
  }
1920
+ }
1901
1921
 
1902
- @if not $disable-vertical-slider {
1903
- &--v {
1904
- @include utils.auto-rtl(left, 100%);
1922
+ @if not $disable-discrete-slider-marks-labels {
1923
+ .rmd-slider-mark-label {
1924
+ position: absolute;
1925
+
1926
+ @if not $disable-horizontal-slider {
1927
+ &--h {
1928
+ @include utils.rtl {
1929
+ @include use-var(right, slider-mark-offset);
1930
+
1931
+ left: auto;
1932
+ transform: translateX(50%);
1933
+ }
1934
+ @include use-var(left, slider-mark-offset);
1905
1935
 
1906
- top: get-var(slider-mark-offset);
1907
- transform: translateY(-50%);
1936
+ top: 100%;
1937
+ transform: translateX(-50%);
1938
+ }
1939
+ }
1940
+
1941
+ @if not $disable-vertical-slider {
1942
+ &--v {
1943
+ @include utils.auto-rtl(left, 100%);
1944
+
1945
+ top: get-var(slider-mark-offset);
1946
+ transform: translateY(-50%);
1947
+ }
1908
1948
  }
1909
1949
  }
1910
1950
  }
@@ -1998,91 +2038,98 @@ $variables: (
1998
2038
  }
1999
2039
  }
2000
2040
 
2001
- @mixin styles {
2002
- @include theme.default-system-theme {
2003
- @include use-dark-theme;
2004
- }
2041
+ @mixin styles($disable-layer: false) {
2042
+ @if not $disable-everything {
2043
+ @include utils.optional-layer(form, $disable-layer) {
2044
+ @include theme.default-system-theme {
2045
+ @include use-dark-theme;
2046
+ }
2047
+
2048
+ @if not $disable-fieldset {
2049
+ .rmd-fieldset {
2050
+ &--unstyled {
2051
+ border: 0;
2052
+ margin: 0;
2053
+ min-width: 0; // just so it can shrink correctly in flex or grid
2054
+ padding: 0;
2055
+ }
2005
2056
 
2006
- @if not $disable-fieldset {
2007
- .rmd-fieldset {
2008
- &--unstyled {
2009
- border: 0;
2010
- margin: 0;
2011
- min-width: 0; // just so it can shrink correctly in flex or grid
2012
- padding: 0;
2057
+ &--full-width {
2058
+ flex: 1 1 auto;
2059
+ width: 100%;
2060
+ }
2061
+ }
2013
2062
  }
2014
2063
 
2015
- &--full-width {
2016
- flex: 1 1 auto;
2017
- width: 100%;
2064
+ @if not $disable-label {
2065
+ @include label-styles(true);
2018
2066
  }
2019
- }
2020
- }
2021
-
2022
- @if not $disable-label {
2023
- @include label-styles;
2024
- }
2025
2067
 
2026
- @if not $disable-file-input {
2027
- @include file-input-styles;
2028
- }
2068
+ @if not $disable-file-input {
2069
+ @include file-input-styles(true);
2070
+ }
2029
2071
 
2030
- @if not $disable-message {
2031
- @include form-message-styles;
2032
- }
2072
+ @if not $disable-message {
2073
+ @include form-message-styles(true);
2074
+ }
2033
2075
 
2034
- @if not $_disable-text-field-container {
2035
- @include text-field-container-styles;
2036
- }
2076
+ @if not $_disable-text-field-container {
2077
+ @include text-field-container-styles(true);
2078
+ }
2037
2079
 
2038
- @if not $disable-text-field or not $disable-password or not $disable-textarea
2039
- {
2040
- @include text-field-styles;
2041
- }
2080
+ @if not
2081
+ $disable-text-field or not
2082
+ $disable-password or not
2083
+ $disable-textarea
2084
+ {
2085
+ @include text-field-styles(true);
2086
+ }
2042
2087
 
2043
- @if not $disable-password {
2044
- @include password-styles;
2045
- }
2088
+ @if not $disable-password {
2089
+ @include password-styles(true);
2090
+ }
2046
2091
 
2047
- @if not $disable-textarea {
2048
- @include textarea-container-styles;
2049
- @include textarea-styles;
2050
- }
2092
+ @if not $disable-textarea {
2093
+ @include textarea-container-styles(true);
2094
+ @include textarea-styles(true);
2095
+ }
2051
2096
 
2052
- @if not $disable-select {
2053
- @include select-styles;
2054
- }
2097
+ @if not $disable-select {
2098
+ @include select-styles(true);
2099
+ }
2055
2100
 
2056
- @if not $disable-option {
2057
- @include option-styles;
2058
- }
2101
+ @if not $disable-option {
2102
+ @include option-styles(true);
2103
+ }
2059
2104
 
2060
- @if not $disable-native-select {
2061
- @include native-select-styles;
2062
- }
2105
+ @if not $disable-native-select {
2106
+ @include native-select-styles(true);
2107
+ }
2063
2108
 
2064
- @if not $disable-text-field-addon {
2065
- @include text-field-addon-styles;
2066
- }
2109
+ @if not $disable-text-field-addon {
2110
+ @include text-field-addon-styles(true);
2111
+ }
2067
2112
 
2068
- @if not $disable-checkbox or not $disable-radio or not $disable-switch {
2069
- @include hidden-input-styles;
2070
- @include input-toggle-styles;
2071
- }
2113
+ @if not $disable-checkbox or not $disable-radio or not $disable-switch {
2114
+ @include hidden-input-styles(true);
2115
+ @include input-toggle-styles(true);
2116
+ }
2072
2117
 
2073
- @if not $disable-switch {
2074
- @include switch-styles;
2075
- }
2118
+ @if not $disable-switch {
2119
+ @include switch-styles(true);
2120
+ }
2076
2121
 
2077
- @if not
2078
- $disable-menu-item-checkbox or not
2079
- $disable-menu-item-radio or not
2080
- $disable-menu-item-switch
2081
- {
2082
- @include menu-item-input-toggle-styles;
2083
- }
2122
+ @if not
2123
+ $disable-menu-item-checkbox or not
2124
+ $disable-menu-item-radio or not
2125
+ $disable-menu-item-switch
2126
+ {
2127
+ @include menu-item-input-toggle-styles(true);
2128
+ }
2084
2129
 
2085
- @if not $disable-slider {
2086
- @include slider-styles;
2130
+ @if not $disable-slider {
2131
+ @include slider-styles(true);
2132
+ }
2133
+ }
2087
2134
  }
2088
2135
  }