Skip to content

Commit

Permalink
fix(material/button): fix color tokens of raised buttons (#27904)
Browse files Browse the repository at this point in the history
* fix bug where the raised button is accidentally using
  the flat button color tokens
  • Loading branch information
wagnermaciel authored Oct 6, 2023
1 parent c6bc738 commit 1de6a3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/material/button/_button-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,13 @@
$surface,
$on-surface
);
$primary-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $primary, $on-primary);
$accent-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $accent, $on-accent);
$warn-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $error, $on-error);
$primary-color-tokens: tokens-mdc-button-protected.get-color-tokens(
$theme,
$primary,
$on-primary
);
$accent-color-tokens: tokens-mdc-button-protected.get-color-tokens($theme, $accent, $on-accent);
$warn-color-tokens: tokens-mdc-button-protected.get-color-tokens($theme, $error, $on-error);

&.mat-unthemed {
@include mdc-button-protected-theme.theme($default-color-tokens);
Expand Down
2 changes: 1 addition & 1 deletion src/material/core/tokens/m2/mdc/_button-protected.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $prefix: (mdc, button-protected);
pressed-state-layer-color: $on-primary,
label-text-color: if($on-color, $on-color, inherit),
disabled-container-color: rgba($on-surface, 0.12),
disabled-label-text-color: rgba($on-surface, 0.38)
disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38))
);
}

Expand Down

0 comments on commit 1de6a3a

Please sign in to comment.