Skip to content

fix(material/button): add token for icon button shape #31223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/material/button/_m2-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@function get-unthemable-tokens() {
@return (
icon-button-icon-size: 24px,
icon-button-container-shape: 50%,
);
}

Expand Down
1 change: 1 addition & 0 deletions src/material/button/_m3-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$tokens: (
base: (
icon-button-icon-size: 24px,
icon-button-container-shape: map.get($system, corner-full),
),
color: (
icon-button-disabled-icon-color:
Expand Down
4 changes: 2 additions & 2 deletions src/material/button/icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $fallbacks: m3-icon-button.get-tokens();
overflow: visible;

// Border radius is inherited by ripple to know its shape. Set to 50% so the ripple is round.
border-radius: 50%;
border-radius: token-utils.slot(icon-button-container-shape, $fallbacks, $fallback: 50%);

// Prevent the button from shrinking since it's always supposed to be a circle.
flex-shrink: 0;
Expand Down Expand Up @@ -69,7 +69,7 @@ $fallbacks: m3-icon-button.get-tokens();
}

.mat-mdc-button-persistent-ripple {
border-radius: 50%;
border-radius: token-utils.slot(icon-button-container-shape, $fallbacks, $fallback: 50%);
}

// MDC used to include this and it seems like a lot of apps depend on it.
Expand Down
Loading