| 
1 | 1 | @use '../core/m2/palette' as m2-palette;  | 
2 |  | -@use '../core/style/sass-utils';  | 
3 | 2 | @use '../core/theming/inspection';  | 
4 | 3 | @use '../core/theming/theming';  | 
5 | 4 | @use '../core/tokens/m2-utils';  | 
 | 
35 | 34 |   // internally. For now we fall back to the old hardcoded behavior only for internal apps.  | 
36 | 35 |   $on-surface: if($is-dark, #fff, #000);  | 
37 | 36 |   $text-color-base: if(m2-utils.$private-is-internal-build, $on-surface,  | 
38 |  | -    inspection.get-theme-color($theme, foreground, text, 1));  | 
 | 37 | +    inspection.get-theme-color($theme, foreground, base));  | 
39 | 38 |   $disabled-text-color-base: if(m2-utils.$private-is-internal-build, $on-surface,  | 
40 |  | -    inspection.get-theme-color($theme, foreground, disabled-text, 1));  | 
 | 39 | +    inspection.get-theme-color($theme, foreground, base));  | 
41 | 40 |   $divider-base: if(m2-utils.$private-is-internal-build, $on-surface,  | 
42 | 41 |     inspection.get-theme-color($theme, foreground, base));  | 
43 | 42 | 
 
  | 
 | 43 | +  $disabled: inspection.get-theme-color($theme, foreground, base, 0.38);  | 
 | 44 | + | 
44 | 45 |   @return map.merge($color-tokens, (  | 
45 | 46 |     // MDC has a token for the enabled placeholder, but not for the disabled one.  | 
46 | 47 |     form-field-disabled-input-text-placeholder-color:  | 
 | 
80 | 81 |     form-field-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),  | 
81 | 82 |     form-field-filled-container-color: _variable-safe-mix($on-surface, $surface, 4%),  | 
82 | 83 |     form-field-filled-disabled-container-color: _variable-safe-mix($on-surface, $surface, 2%),  | 
83 |  | -    form-field-filled-label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 84 | +    form-field-filled-label-text-color: inspection.get-theme-color($theme, foreground, base, 0.6),  | 
84 | 85 |     form-field-filled-hover-label-text-color:  | 
85 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 86 | +        inspection.get-theme-color($theme, foreground, base, 0.6),  | 
86 | 87 |     form-field-filled-disabled-label-text-color:  | 
87 |  | -        sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),  | 
 | 88 | +        inspection.get-theme-color($theme, foreground, base, 0.38),  | 
88 | 89 |     form-field-filled-input-text-color:  | 
89 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.87),  | 
 | 90 | +        inspection.get-theme-color($theme, foreground, base, 0.87),  | 
90 | 91 |     form-field-filled-disabled-input-text-color:  | 
91 |  | -        sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),  | 
 | 92 | +        inspection.get-theme-color($theme, foreground, base, 0.38),  | 
92 | 93 |     form-field-filled-input-text-placeholder-color:  | 
93 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 94 | +        inspection.get-theme-color($theme, foreground, base, 0.6),  | 
94 | 95 |     form-field-filled-error-hover-label-text-color: $warn-color,  | 
95 | 96 |     form-field-filled-error-focus-label-text-color: $warn-color,  | 
96 | 97 |     form-field-filled-error-label-text-color: $warn-color,  | 
97 | 98 |     form-field-filled-error-caret-color: $warn-color,  | 
98 | 99 |     form-field-filled-active-indicator-color:  | 
99 |  | -        sass-utils.safe-color-change($divider-base, $alpha: 0.42),  | 
 | 100 | +        inspection.get-theme-color($theme, foreground, base, 0.42),  | 
100 | 101 |     form-field-filled-disabled-active-indicator-color:  | 
101 |  | -        sass-utils.safe-color-change($divider-base, $alpha: 0.06),  | 
 | 102 | +        inspection.get-theme-color($theme, foreground, base, 0.06),  | 
102 | 103 |     form-field-filled-hover-active-indicator-color:  | 
103 |  | -        sass-utils.safe-color-change($divider-base, $alpha: 0.87),  | 
 | 104 | +        inspection.get-theme-color($theme, foreground, base, 0.87),  | 
104 | 105 |     form-field-filled-error-active-indicator-color: $warn-color,  | 
105 | 106 |     form-field-filled-error-focus-active-indicator-color: $warn-color,  | 
106 | 107 |     form-field-filled-error-hover-active-indicator-color: $warn-color,  | 
107 | 108 |     form-field-outlined-label-text-color:  | 
108 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 109 | +        inspection.get-theme-color($theme, foreground, base, 0.6),  | 
109 | 110 |     form-field-outlined-hover-label-text-color:  | 
110 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 111 | +        inspection.get-theme-color($theme, foreground, base, 0.6),  | 
111 | 112 |     form-field-outlined-disabled-label-text-color:  | 
112 |  | -        sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),  | 
 | 113 | +        inspection.get-theme-color($theme, foreground, base, 0.38),  | 
113 | 114 |     form-field-outlined-input-text-color:  | 
114 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.87),  | 
 | 115 | +        inspection.get-theme-color($theme, foreground, base, 0.87),  | 
115 | 116 |     form-field-outlined-disabled-input-text-color:  | 
116 |  | -        sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),  | 
 | 117 | +        inspection.get-theme-color($theme, foreground, base, 0.38),  | 
117 | 118 |     form-field-outlined-input-text-placeholder-color:  | 
118 |  | -        sass-utils.safe-color-change($text-color-base, $alpha: 0.6),  | 
 | 119 | +        inspection.get-theme-color($theme, foreground, base, 0.6),  | 
119 | 120 |     form-field-outlined-error-caret-color: $warn-color,  | 
120 | 121 |     form-field-outlined-error-focus-label-text-color: $warn-color,  | 
121 | 122 |     form-field-outlined-error-label-text-color: $warn-color,  | 
122 | 123 |     form-field-outlined-error-hover-label-text-color: $warn-color,  | 
123 |  | -    form-field-outlined-outline-color: sass-utils.safe-color-change($divider-base, $alpha: 0.38),  | 
 | 124 | +    form-field-outlined-outline-color: inspection.get-theme-color($theme, foreground, base, 0.38),  | 
124 | 125 |     form-field-outlined-disabled-outline-color:  | 
125 |  | -        sass-utils.safe-color-change($divider-base, $alpha: 0.06),  | 
 | 126 | +        inspection.get-theme-color($theme, foreground, base, 0.06),  | 
126 | 127 |     form-field-outlined-hover-outline-color:  | 
127 |  | -        sass-utils.safe-color-change($divider-base, $alpha: 0.87),  | 
 | 128 | +        inspection.get-theme-color($theme, foreground, base, 0.87),  | 
128 | 129 |     form-field-outlined-error-focus-outline-color: $warn-color,  | 
129 | 130 |     form-field-outlined-error-hover-outline-color: $warn-color,  | 
130 | 131 |     form-field-outlined-error-outline-color: $warn-color,  | 
 | 
141 | 142 | // Generates the mapping for the properties that change based on the form field color.  | 
142 | 143 | @function private-get-color-palette-color-tokens($theme, $palette-name) {  | 
143 | 144 |   $palette-color: inspection.get-theme-color($theme, $palette-name);  | 
 | 145 | +  $text-color: inspection.get-theme-color($theme, $palette-name, 0.87);  | 
144 | 146 | 
 
  | 
145 | 147 |   @return (  | 
146 |  | -    form-field-focus-select-arrow-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87),  | 
 | 148 | +    form-field-focus-select-arrow-color: $text-color,  | 
147 | 149 |     form-field-filled-caret-color: $palette-color,  | 
148 | 150 |     form-field-filled-focus-active-indicator-color: $palette-color,  | 
149 |  | -    form-field-filled-focus-label-text-color:  | 
150 |  | -        sass-utils.safe-color-change($palette-color, $alpha: 0.87),  | 
 | 151 | +    form-field-filled-focus-label-text-color: $text-color,  | 
151 | 152 |     form-field-outlined-caret-color: $palette-color,  | 
152 | 153 |     form-field-outlined-focus-outline-color: $palette-color,  | 
153 |  | -    form-field-outlined-focus-label-text-color:  | 
154 |  | -        sass-utils.safe-color-change($palette-color, $alpha: 0.87),  | 
 | 154 | +    form-field-outlined-focus-label-text-color: $text-color,  | 
155 | 155 |   );  | 
156 | 156 | }  | 
157 | 157 | 
 
  | 
 | 
0 commit comments