Skip to content

Commit

Permalink
fix(material/button): Move unthemable icon button tokens to theme mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
amysorto committed Aug 2, 2023
1 parent b13c6aa commit 6250bd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/material/button/_icon-button-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@use '@material/density/functions' as mdc-density-functions;
@use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme;
@use '@material/theme/theme-color' as mdc-theme-color;
@use '../core/style/sass-utils';
@use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button;

@use './button-theme-private';
Expand Down Expand Up @@ -111,6 +112,11 @@ $_icon-size: 24px;
$density: theming.get-density-config($theme);
$typography: theming.get-typography-config($theme);

// Add default values for tokens not related to color, typography, or density.
@include sass-utils.current-selector-or-root() {
@include mdc-icon-button-theme.theme(tokens-mdc-icon-button.get-unthemable-tokens());
}

@if $color != null {
@include color($color);
}
Expand Down
3 changes: 0 additions & 3 deletions src/material/button/icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
.mat-mdc-icon-button {
// Add the official slots for the MDC component.
@include mdc-icon-button-theme.theme-styles($token-slots);

// Add default values for tokens that aren't outputted by the theming API.
@include mdc-icon-button-theme.theme(m2-mdc-icon-button.get-unthemable-tokens());
}
}

Expand Down

0 comments on commit 6250bd9

Please sign in to comment.