Skip to content

Commit 4685269

Browse files
committed
fix(material/button): remove concrete icon button theme styles
1 parent 50b8270 commit 4685269

File tree

1 file changed

+4
-35
lines changed

1 file changed

+4
-35
lines changed

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

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -67,43 +67,12 @@
6767
}
6868

6969
@mixin density($theme) {
70+
$tokens: m2-icon-button.get-density-tokens($theme);
7071
@if inspection.get-theme-version($theme) == 1 {
71-
@include token-utils.values(map.get(m3-icon-button.get-tokens($theme), density));
72-
} @else {
73-
$icon-size: 24px;
74-
$density-scale: inspection.get-theme-density($theme);
75-
$size-map: (
76-
0: 48px,
77-
-1: 44px,
78-
-2: 40px,
79-
-3: 36px,
80-
-4: 32px,
81-
-5: 28px,
82-
);
83-
$calculated-size: map.get($size-map, $density-scale);
84-
85-
@include token-utils.values(
86-
m2-icon-button.get-density-tokens(
87-
$theme, $exclude: (icon-button-state-layer-size))
88-
);
89-
90-
// Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
91-
.mat-mdc-icon-button.mat-mdc-button-base {
92-
// Match the styles that used to be present. This is necessary for backwards
93-
// compat to match the previous implementations selector count (two classes).
94-
--mdc-icon-button-state-layer-size: #{$calculated-size};
95-
--mat-icon-button-state-layer-size: #{$calculated-size};
96-
97-
// TODO: Switch calculated-size to "var(--mat-icon-button-state-layer-size)"
98-
// Currently fails validation because the variable is "undefined"
99-
// in the sass stack.
100-
// TODO: Switch icon-size to "var(--mat-icon-button-icon-size)". Currently
101-
// fails validation because the variable is "undefined" in the sass stack.
102-
width: var(--mat-icon-button-state-layer-size);
103-
height: var(--mat-icon-button-state-layer-size);
104-
padding: math.div($calculated-size - $icon-size, 2);
105-
}
72+
$tokens: map.get(m3-icon-button.get-tokens($theme), density);
10673
}
74+
75+
@include token-utils.values($tokens);
10776
}
10877

10978
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.

0 commit comments

Comments
 (0)