Skip to content

Commit d324696

Browse files
authored
fix(material/button): match focus indicator shape to FAB (#33527)
Updates the FAB's focus indicator to match the shape of the button. Relates to #33517.
1 parent bab9b08 commit d324696

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎src/material/button/fab.scss‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
@use './m3-fab';
77

88
$fallbacks: m3-fab.get-tokens();
9+
$indicator-border-width: focus-indicators-private.$default-border-width;
10+
$border-width: var(--mat-focus-indicator-border-width, #{$indicator-border-width});
11+
$indicator-offset: calc(#{$border-width} + 2px);
912

1013
.mat-mdc-fab-base {
1114
@include vendor-prefixes.user-select(none);
@@ -81,10 +84,9 @@ $fallbacks: m3-fab.get-tokens();
8184
}
8285

8386
.mat-focus-indicator::before {
84-
$default-border-width: focus-indicators-private.$default-border-width;
85-
$border-width: var(--mat-focus-indicator-border-width, #{$default-border-width});
86-
$offset: calc(#{$border-width} + 2px);
87-
margin: calc(#{$offset} * -1);
87+
margin: calc(#{$indicator-offset} * -1);
88+
border-radius: calc(#{token-utils.slot(fab-container-shape, $fallbacks)} +
89+
#{$indicator-offset});
8890
}
8991

9092
@include button-base.mat-private-button-disabled {
@@ -149,6 +151,11 @@ $fallbacks: m3-fab.get-tokens();
149151
box-shadow: token-utils.slot(fab-small-pressed-container-elevation-shadow, $fallbacks);
150152
}
151153

154+
.mat-focus-indicator::before {
155+
border-radius: calc(#{token-utils.slot(fab-small-container-shape, $fallbacks)} +
156+
#{$indicator-offset});
157+
}
158+
152159
@include button-base.mat-private-button-disabled {
153160
color: token-utils.slot(fab-small-disabled-state-foreground-color, $fallbacks);
154161
background-color: token-utils.slot(fab-small-disabled-state-container-color, $fallbacks);

0 commit comments

Comments
 (0)