|
1 | 1 | @use '../core/m2/palette' as m2-palette; |
2 | | -@use '../core/style/sass-utils'; |
3 | 2 | @use '../core/tokens/m2-utils'; |
4 | 3 | @use '../core/theming/inspection'; |
5 | 4 | @use '../core/theming/theming'; |
|
30 | 29 | $warn-color: inspection.get-theme-color($theme, warn); |
31 | 30 | $color-tokens: private-get-color-palette-color-tokens($theme, primary); |
32 | 31 | $on-surface: if($is-dark, #fff, #000); |
33 | | - $text-color-base: inspection.get-theme-color($theme, system, on-surface); |
34 | | - $disabled-text-color-base: inspection.get-theme-color($theme, foreground, disabled-text, 1); |
35 | | - $divider-base: inspection.get-theme-color($theme, foreground, base); |
| 32 | + $disabled: inspection.get-theme-color($theme, foreground, base, 0.38); |
36 | 33 |
|
37 | 34 | @return map.merge($color-tokens, ( |
38 | 35 | // MDC has a token for the enabled placeholder, but not for the disabled one. |
|
73 | 70 | form-field-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity), |
74 | 71 | form-field-filled-container-color: _variable-safe-mix($on-surface, $surface, 4%), |
75 | 72 | form-field-filled-disabled-container-color: _variable-safe-mix($on-surface, $surface, 2%), |
76 | | - form-field-filled-label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 73 | + form-field-filled-label-text-color: inspection.get-theme-color($theme, foreground, base, 0.6), |
77 | 74 | form-field-filled-hover-label-text-color: |
78 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 75 | + inspection.get-theme-color($theme, foreground, base, 0.6), |
79 | 76 | form-field-filled-disabled-label-text-color: |
80 | | - sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38), |
| 77 | + inspection.get-theme-color($theme, foreground, base, 0.38), |
81 | 78 | form-field-filled-input-text-color: |
82 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.87), |
| 79 | + inspection.get-theme-color($theme, foreground, base, 0.87), |
83 | 80 | form-field-filled-disabled-input-text-color: |
84 | | - sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38), |
| 81 | + inspection.get-theme-color($theme, foreground, base, 0.38), |
85 | 82 | form-field-filled-input-text-placeholder-color: |
86 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 83 | + inspection.get-theme-color($theme, foreground, base, 0.6), |
87 | 84 | form-field-filled-error-hover-label-text-color: $warn-color, |
88 | 85 | form-field-filled-error-focus-label-text-color: $warn-color, |
89 | 86 | form-field-filled-error-label-text-color: $warn-color, |
90 | 87 | form-field-filled-error-caret-color: $warn-color, |
91 | 88 | form-field-filled-active-indicator-color: |
92 | | - sass-utils.safe-color-change($divider-base, $alpha: 0.42), |
| 89 | + inspection.get-theme-color($theme, foreground, base, 0.42), |
93 | 90 | form-field-filled-disabled-active-indicator-color: |
94 | | - sass-utils.safe-color-change($divider-base, $alpha: 0.06), |
| 91 | + inspection.get-theme-color($theme, foreground, base, 0.06), |
95 | 92 | form-field-filled-hover-active-indicator-color: |
96 | | - sass-utils.safe-color-change($divider-base, $alpha: 0.87), |
| 93 | + inspection.get-theme-color($theme, foreground, base, 0.87), |
97 | 94 | form-field-filled-error-active-indicator-color: $warn-color, |
98 | 95 | form-field-filled-error-focus-active-indicator-color: $warn-color, |
99 | 96 | form-field-filled-error-hover-active-indicator-color: $warn-color, |
100 | 97 | form-field-outlined-label-text-color: |
101 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 98 | + inspection.get-theme-color($theme, foreground, base, 0.6), |
102 | 99 | form-field-outlined-hover-label-text-color: |
103 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 100 | + inspection.get-theme-color($theme, foreground, base, 0.6), |
104 | 101 | form-field-outlined-disabled-label-text-color: |
105 | | - sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38), |
| 102 | + inspection.get-theme-color($theme, foreground, base, 0.38), |
106 | 103 | form-field-outlined-input-text-color: |
107 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.87), |
| 104 | + inspection.get-theme-color($theme, foreground, base, 0.87), |
108 | 105 | form-field-outlined-disabled-input-text-color: |
109 | | - sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38), |
| 106 | + inspection.get-theme-color($theme, foreground, base, 0.38), |
110 | 107 | form-field-outlined-input-text-placeholder-color: |
111 | | - sass-utils.safe-color-change($text-color-base, $alpha: 0.6), |
| 108 | + inspection.get-theme-color($theme, foreground, base, 0.6), |
112 | 109 | form-field-outlined-error-caret-color: $warn-color, |
113 | 110 | form-field-outlined-error-focus-label-text-color: $warn-color, |
114 | 111 | form-field-outlined-error-label-text-color: $warn-color, |
115 | 112 | form-field-outlined-error-hover-label-text-color: $warn-color, |
116 | | - form-field-outlined-outline-color: sass-utils.safe-color-change($divider-base, $alpha: 0.38), |
| 113 | + form-field-outlined-outline-color: inspection.get-theme-color($theme, foreground, base, 0.38), |
117 | 114 | form-field-outlined-disabled-outline-color: |
118 | | - sass-utils.safe-color-change($divider-base, $alpha: 0.06), |
| 115 | + inspection.get-theme-color($theme, foreground, base, 0.06), |
119 | 116 | form-field-outlined-hover-outline-color: |
120 | | - sass-utils.safe-color-change($divider-base, $alpha: 0.87), |
| 117 | + inspection.get-theme-color($theme, foreground, base, 0.87), |
121 | 118 | form-field-outlined-error-focus-outline-color: $warn-color, |
122 | 119 | form-field-outlined-error-hover-outline-color: $warn-color, |
123 | 120 | form-field-outlined-error-outline-color: $warn-color, |
|
134 | 131 | // Generates the mapping for the properties that change based on the form field color. |
135 | 132 | @function private-get-color-palette-color-tokens($theme, $palette-name) { |
136 | 133 | $palette-color: inspection.get-theme-color($theme, $palette-name); |
| 134 | + $text-color: inspection.get-theme-color($theme, $palette-name, 0.87); |
137 | 135 |
|
138 | 136 | @return ( |
139 | | - form-field-focus-select-arrow-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87), |
| 137 | + form-field-focus-select-arrow-color: $text-color, |
140 | 138 | form-field-filled-caret-color: $palette-color, |
141 | 139 | form-field-filled-focus-active-indicator-color: $palette-color, |
142 | | - form-field-filled-focus-label-text-color: |
143 | | - sass-utils.safe-color-change($palette-color, $alpha: 0.87), |
| 140 | + form-field-filled-focus-label-text-color: $text-color, |
144 | 141 | form-field-outlined-caret-color: $palette-color, |
145 | 142 | form-field-outlined-focus-outline-color: $palette-color, |
146 | | - form-field-outlined-focus-label-text-color: |
147 | | - sass-utils.safe-color-change($palette-color, $alpha: 0.87), |
| 143 | + form-field-outlined-focus-label-text-color: $text-color, |
148 | 144 | ); |
149 | 145 | } |
150 | 146 |
|
|
0 commit comments