Skip to content

fix(material/button): remove internal-only M2 styles #31017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions src/material/button/_m2-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ $prefix: (mat, button);
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;

// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
$outline: if(m2-utils.$private-is-internal-build,
rgba(if($is-dark, #fff, #000), 0.12),
inspection.get-theme-color($theme, foreground, divider)
);

$outline: inspection.get-theme-color($theme, foreground, divider);
@return (
filled-container-color: inspection.get-theme-color($theme, background, card),
filled-disabled-container-color:
Expand Down Expand Up @@ -125,19 +118,6 @@ $prefix: (mat, button);
$label-text-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$ripple-opacity: 0.1;

// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
@if (m2-utils.$private-is-internal-build or
meta.type-of($contrast-color) != 'color') {
$is-dark: inspection.get-theme-type($theme) == dark;
$container-color: inspection.get-theme-color($theme, $palette-name);
$contrast-tone: m2-utils.contrast-tone($container-color, $is-dark);
$color: if($contrast-tone == 'dark', #000, #fff);
$state-layer-color: $color;
$ripple-color: rgba($color, 0.1);
$label-text-color: if($contrast-tone == 'dark', #000, #fff);
}

// outlined-outline-color:
// TODO: we shouldn't have to set this since it's the same as the non-palette version, however
// there are a bunch of tests internally that depend on it. We should remove this and clean
Expand Down
Loading