Skip to content

Commit 556eeb1

Browse files
authored
fix(material/button): Move unthemable icon button tokens to theme mixin (#27570)
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)
1 parent 92c701f commit 556eeb1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/material/button/_icon-button-theme.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@use '@material/density/functions' as mdc-density-functions;
33
@use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme;
44
@use '@material/theme/theme-color' as mdc-theme-color;
5+
@use '../core/style/sass-utils';
56
@use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button;
67

78
@use './button-theme-private';
@@ -24,7 +25,10 @@ $_icon-size: 24px;
2425
}
2526

2627
@mixin base($theme) {
27-
// TODO(mmalerba): Move icon button base tokens here
28+
// Add default values for tokens not related to color, typography, or density.
29+
@include sass-utils.current-selector-or-root() {
30+
@include mdc-icon-button-theme.theme(tokens-mdc-icon-button.get-unthemable-tokens());
31+
}
2832
}
2933

3034
@mixin color($theme) {

src/material/button/icon-button.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
.mat-mdc-icon-button {
1818
// Add the official slots for the MDC component.
1919
@include mdc-icon-button-theme.theme-styles($token-slots);
20-
21-
// Add default values for tokens that aren't outputted by the theming API.
22-
@include mdc-icon-button-theme.theme(m2-mdc-icon-button.get-unthemable-tokens());
2320
}
2421
}
2522

0 commit comments

Comments
 (0)