Skip to content

Commit 589ea59

Browse files
andrewseguinAndrew Seguin
and
Andrew Seguin
authored
fix(material/button): remove internal-only M2 styles (#31018)
* fix(material/button): remove internal-only M2 styles * fix(material/button): lint * refactor: lint --------- Co-authored-by: Andrew Seguin <andrewseguin@google.com>
1 parent ec66685 commit 589ea59

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

src/material/button/_m2-fab.scss

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@use 'sass:meta';
2-
@use '../core/tokens/m2-utils';
31
@use '../core/theming/theming';
42
@use '../core/theming/inspection';
53
@use '../core/style/elevation';
@@ -61,28 +59,10 @@
6159

6260
// Generates the mapping for the properties that change based on the FAB palette color.
6361
@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;
6962
$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-
}
63+
$foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
64+
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
65+
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
8666

8767
@return (
8868
fab-container-color: inspection.get-theme-color($theme, $palette-name, default),

0 commit comments

Comments
 (0)