Skip to content

Commit

Permalink
fix(material-experimental/mdc-button): avoid shrinking FAB and icon b…
Browse files Browse the repository at this point in the history
…utton (#23532)

Fixes that the width of the FAB and icon button can collapse. We have something similar in the existing buttons already.

(cherry picked from commit c608df8)
  • Loading branch information
crisbeto authored and andrewseguin committed Sep 10, 2021
1 parent 886522c commit 5ca6311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/material-experimental/mdc-button/fab.scss
Expand Up @@ -11,6 +11,9 @@
@include button-base.mat-private-button-touch-target(true);
@include private.private-animation-noop();

// Prevent the button from shrinking since it's always supposed to be a circle.
flex-shrink: 0;

// MDC adds some styles to fab and mini-fab that conflict with some of our focus indicator
// styles and don't actually do anything. This undoes those conflicting styles.
&:not(.mdc-ripple-upgraded):focus::before {
Expand Down
3 changes: 3 additions & 0 deletions src/material-experimental/mdc-button/icon-button.scss
Expand Up @@ -15,6 +15,9 @@
// Border radius is inherited by ripple to know its shape. Set to 50% so the ripple is round.
border-radius: 50%;

// Prevent the button from shrinking since it's always supposed to be a circle.
flex-shrink: 0;

@include button-base.mat-private-button-disabled();
@include button-base.mat-private-button-touch-target(true);
@include private.private-animation-noop();
Expand Down

0 comments on commit 5ca6311

Please sign in to comment.