From e5b809539e01e5a9eb475a4955ff3c026b884a66 Mon Sep 17 00:00:00 2001 From: Amy Sorto <8575252+amysorto@users.noreply.github.com> Date: Wed, 2 Aug 2023 21:23:02 +0000 Subject: [PATCH] fix(material/button): Move unthemable icon button tokens to theme mixin Though these tokens are not currently affected by the theme, in the future they will be affected by the design system used for theming (M2 or M3) --- src/material/button/_icon-button-theme.scss | 6 +++++- src/material/button/icon-button.scss | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/material/button/_icon-button-theme.scss b/src/material/button/_icon-button-theme.scss index 1b4c835c1d4e..ed9032a66b9e 100644 --- a/src/material/button/_icon-button-theme.scss +++ b/src/material/button/_icon-button-theme.scss @@ -2,6 +2,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'; @@ -24,7 +25,10 @@ $_icon-size: 24px; } @mixin base($theme) { - // TODO(mmalerba): Move icon button base tokens here + // 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()); + } } @mixin color($theme) { diff --git a/src/material/button/icon-button.scss b/src/material/button/icon-button.scss index 95a40ba69d24..5cff811c9e28 100644 --- a/src/material/button/icon-button.scss +++ b/src/material/button/icon-button.scss @@ -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()); } }