|
61 | 61 |
|
62 | 62 | // Generates the mapping for the properties that change based on the FAB palette color. |
63 | 63 | @function private-get-color-palette-color-tokens($theme, $palette-name) { |
64 | | - // Ideally we would derive all values directly from the theme, but it causes a lot of regressions |
65 | | - // internally. For now we fall back to the old hardcoded behavior only for internal apps. |
66 | | - $foreground-color: null; |
67 | | - $state-layer-color: null; |
68 | | - $ripple-color: null; |
69 | 64 | $contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast); |
70 | | - |
71 | | - @if (m2-utils.$private-is-internal-build or |
72 | | - meta.type-of($contrast-color) != 'color') { |
73 | | - $is-dark: inspection.get-theme-type($theme) == dark; |
74 | | - $container-color: inspection.get-theme-color($theme, $palette-name); |
75 | | - $contrast-tone: m2-utils.contrast-tone($container-color, $is-dark); |
76 | | - $color: if($contrast-tone == 'dark', #000, #fff); |
77 | | - $foreground-color: $color; |
78 | | - $state-layer-color: $color; |
79 | | - $ripple-color: rgba($color, 0.1); |
80 | | - } |
81 | | - @else { |
82 | | - $foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1); |
83 | | - $state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1); |
84 | | - $ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1); |
85 | | - } |
| 65 | + $foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1); |
| 66 | + $state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1); |
| 67 | + $ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1); |
86 | 68 |
|
87 | 69 | @return ( |
88 | 70 | fab-container-color: inspection.get-theme-color($theme, $palette-name, default), |
|
0 commit comments