|
684 | 684 | /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
685 | 685 | /// @return {Map} A set of custom tokens for the mat-slider
|
686 | 686 | @function slider($systems, $exclude-hardcoded) {
|
687 |
| - $ripple-color: map.get($systems, md-sys-color, primary); |
688 |
| - $hover-ripple-color: mat.private-safe-color-change($ripple-color, $alpha: 0.05); |
689 |
| - $focus-ripple-color: mat.private-safe-color-change($ripple-color, $alpha: 0.2); |
690 |
| - |
691 |
| - @return ( |
692 |
| - ripple-color: $ripple-color, |
693 |
| - hover-state-layer-color: $hover-ripple-color, |
694 |
| - focus-state-layer-color: $focus-ripple-color, |
| 687 | + @return (( |
| 688 | + ripple-color: map.get($systems, md-sys-color, primary), |
| 689 | + hover-state-layer-color: mat.private-safe-color-change( |
| 690 | + map.get($systems, md-sys-color, primary), $alpha: 0.05), |
| 691 | + focus-state-layer-color: mat.private-safe-color-change( |
| 692 | + map.get($systems, md-sys-color, primary), $alpha: 0.2), |
695 | 693 | value-indicator-opacity: _hardcode(1, $exclude-hardcoded),
|
696 | 694 | value-indicator-padding: _hardcode(0, $exclude-hardcoded),
|
697 | 695 | value-indicator-width: _hardcode(28px, $exclude-hardcoded),
|
|
701 | 699 | value-indicator-text-transform: _hardcode(rotate(45deg), $exclude-hardcoded),
|
702 | 700 | value-indicator-container-transform:
|
703 | 701 | _hardcode(translateX(-50%) rotate(-45deg), $exclude-hardcoded)
|
704 |
| - ); |
| 702 | + ), ( |
| 703 | + // Color variants |
| 704 | + primary: (), // Default, no overrides needed |
| 705 | + secondary: ( |
| 706 | + ripple-color: map.get($systems, md-sys-color, secondary), |
| 707 | + hover-state-layer-color: mat.private-safe-color-change( |
| 708 | + map.get($systems, md-sys-color, secondary), $alpha: 0.05), |
| 709 | + focus-state-layer-color: mat.private-safe-color-change( |
| 710 | + map.get($systems, md-sys-color, secondary), $alpha: 0.2), |
| 711 | + ), |
| 712 | + teriatiary: ( |
| 713 | + ripple-color: map.get($systems, md-sys-color, tertiary), |
| 714 | + hover-state-layer-color: mat.private-safe-color-change( |
| 715 | + map.get($systems, md-sys-color, tertiary), $alpha: 0.05), |
| 716 | + focus-state-layer-color: mat.private-safe-color-change( |
| 717 | + map.get($systems, md-sys-color, tertiary), $alpha: 0.2), |
| 718 | + ), |
| 719 | + error: ( |
| 720 | + ripple-color: map.get($systems, md-sys-color, error), |
| 721 | + hover-state-layer-color: mat.private-safe-color-change( |
| 722 | + map.get($systems, md-sys-color, error), $alpha: 0.05), |
| 723 | + focus-state-layer-color: mat.private-safe-color-change( |
| 724 | + map.get($systems, md-sys-color, error), $alpha: 0.2), |
| 725 | + ), |
| 726 | + )); |
705 | 727 | }
|
706 | 728 |
|
707 | 729 | /// Generates custom tokens for the mat-snack-bar.
|
|
766 | 788 | /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
767 | 789 | /// @return {Map} A set of custom tokens for the mat-tab-header
|
768 | 790 | @function tab-header($systems, $exclude-hardcoded) {
|
769 |
| - @return mat.private-merge-all( |
| 791 | + @return (mat.private-merge-all( |
770 | 792 | _generate-typography-tokens($systems, label-text, title-small),
|
771 | 793 | (
|
772 | 794 | divider-color: map.get($systems, md-sys-color, surface-variant),
|
|
784 | 806 | active-focus-indicator-color: map.get($systems, md-sys-color, primary),
|
785 | 807 | active-hover-indicator-color: map.get($systems, md-sys-color, primary),
|
786 | 808 | ),
|
787 |
| - ); |
| 809 | + ), ( |
| 810 | + // Color variants |
| 811 | + primary: (), // Default, no overrides needed |
| 812 | + secondary: ( |
| 813 | + active-focus-indicator-color: map.get($systems, md-sys-color, secondary), |
| 814 | + active-hover-indicator-color: map.get($systems, md-sys-color, secondary), |
| 815 | + ), |
| 816 | + tertiary: ( |
| 817 | + active-focus-indicator-color: map.get($systems, md-sys-color, tertiary), |
| 818 | + active-hover-indicator-color: map.get($systems, md-sys-color, tertiary), |
| 819 | + ), |
| 820 | + error: ( |
| 821 | + active-focus-indicator-color: map.get($systems, md-sys-color, error), |
| 822 | + active-hover-indicator-color: map.get($systems, md-sys-color, error), |
| 823 | + ) |
| 824 | + )); |
788 | 825 | }
|
789 | 826 |
|
790 | 827 | /// Generates custom tokens for the mdc-tab-indicator. (MDC has a tab-indicator component, but they
|
|
794 | 831 | /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
795 | 832 | /// @return {Map} A set of custom tokens for the mdc-tab-indicator
|
796 | 833 | @function tab-indicator($systems, $exclude-hardcoded) {
|
797 |
| - @return ( |
| 834 | + @return (( |
798 | 835 | active-indicator-height: _hardcode(2px, $exclude-hardcoded),
|
799 | 836 | active-indicator-shape: _hardcode(0, $exclude-hardcoded),
|
800 | 837 | active-indicator-color: map.get($systems, md-sys-color, primary),
|
801 |
| - ); |
| 838 | + ), ( |
| 839 | + // Color variants |
| 840 | + primary: (), // Default, no overrides needed |
| 841 | + secondary: ( |
| 842 | + active-indicator-color: map.get($systems, md-sys-color, secondary), |
| 843 | + ), |
| 844 | + tertiary: ( |
| 845 | + active-indicator-color: map.get($systems, md-sys-color, tertiary), |
| 846 | + ), |
| 847 | + error: ( |
| 848 | + active-indicator-color: map.get($systems, md-sys-color, error), |
| 849 | + ) |
| 850 | + )); |
802 | 851 | }
|
803 | 852 |
|
804 | 853 | /// Generates custom tokens for the mat-table.
|
|
826 | 875 | /// @return {Map} A set of custom tokens for the mat-toolbar
|
827 | 876 | @function toolbar($systems, $exclude-hardcoded) {
|
828 | 877 | @return mat.private-merge-all(
|
829 |
| - _generate-typography-tokens($systems, title-text, title-large), |
830 |
| - ( |
831 |
| - container-background-color: map.get($systems, md-sys-color, surface), |
832 |
| - container-text-color: map.get($systems, md-sys-color, on-surface), |
833 |
| - ) |
| 878 | + _generate-typography-tokens($systems, title-text, title-large), |
| 879 | + ( |
| 880 | + container-background-color: map.get($systems, md-sys-color, surface), |
| 881 | + container-text-color: map.get($systems, md-sys-color, on-surface), |
| 882 | + ) |
834 | 883 | );
|
835 | 884 | }
|
836 | 885 |
|
|
896 | 945 | )
|
897 | 946 | );
|
898 | 947 | }
|
| 948 | + |
| 949 | +/// Generates custom token overrides for the mdc-slider color variants. |
| 950 | +/// @param {Map} $systems The MDC system tokens |
| 951 | +/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values |
| 952 | +/// @return {Map} A set of color variant token overrides for the mdc-slider |
| 953 | +@function mdc-slider-color-variants($systems, $exclude-hardcoded) { |
| 954 | + @return ( |
| 955 | + primary: (), // Default, no overrides needed |
| 956 | + secondary: ( |
| 957 | + active-track-color: map.get($systems, md-sys-color, secondary), |
| 958 | + focus-handle-color: map.get($systems, md-sys-color, secondary), |
| 959 | + focus-state-layer-color: map.get($systems, md-sys-color, secondary), |
| 960 | + handle-color: map.get($systems, md-sys-color, secondary), |
| 961 | + hover-handle-color: map.get($systems, md-sys-color, secondary), |
| 962 | + hover-state-layer-color: map.get($systems, md-sys-color, secondary), |
| 963 | + label-container-color: map.get($systems, md-sys-color, secondary), |
| 964 | + label-label-text-color: map.get($systems, md-sys-color, on-secondary), |
| 965 | + pressed-handle-color: map.get($systems, md-sys-color, secondary), |
| 966 | + pressed-state-layer-color: map.get($systems, md-sys-color, secondary), |
| 967 | + with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-secondary), |
| 968 | + with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-secondary), |
| 969 | + ), |
| 970 | + tertiary: ( |
| 971 | + active-track-color: map.get($systems, md-sys-color, tertiary), |
| 972 | + focus-handle-color: map.get($systems, md-sys-color, tertiary), |
| 973 | + focus-state-layer-color: map.get($systems, md-sys-color, tertiary), |
| 974 | + handle-color: map.get($systems, md-sys-color, tertiary), |
| 975 | + hover-handle-color: map.get($systems, md-sys-color, tertiary), |
| 976 | + hover-state-layer-color: map.get($systems, md-sys-color, tertiary), |
| 977 | + label-container-color: map.get($systems, md-sys-color, tertiary), |
| 978 | + label-label-text-color: map.get($systems, md-sys-color, on-tertiary), |
| 979 | + pressed-handle-color: map.get($systems, md-sys-color, tertiary), |
| 980 | + pressed-state-layer-color: map.get($systems, md-sys-color, tertiary), |
| 981 | + with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-tertiary), |
| 982 | + with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-tertiary), |
| 983 | + ), |
| 984 | + error: ( |
| 985 | + active-track-color: map.get($systems, md-sys-color, error), |
| 986 | + focus-handle-color: map.get($systems, md-sys-color, error), |
| 987 | + focus-state-layer-color: map.get($systems, md-sys-color, error), |
| 988 | + handle-color: map.get($systems, md-sys-color, error), |
| 989 | + hover-handle-color: map.get($systems, md-sys-color, error), |
| 990 | + hover-state-layer-color: map.get($systems, md-sys-color, error), |
| 991 | + label-container-color: map.get($systems, md-sys-color, error), |
| 992 | + label-label-text-color: map.get($systems, md-sys-color, on-error), |
| 993 | + pressed-handle-color: map.get($systems, md-sys-color, error), |
| 994 | + pressed-state-layer-color: map.get($systems, md-sys-color, error), |
| 995 | + with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-error), |
| 996 | + with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-error), |
| 997 | + ), |
| 998 | + ); |
| 999 | +} |
0 commit comments