-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(fab-button): position is correct with custom sizes #28195
Conversation
@include margin(($fab-size - $fab-small-size) * 0.5); | ||
@include margin($fab-button-small-margin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was always 8px, so I just made it its own variable
$fab-size: 56
$fab-small-size: 40
(56 - 40) * 0.5 = 16 * 0.5 = 8
min-height: $fab-size; | ||
min-width: $fab-small-size + ($fab-button-small-margin * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These evaluate to the same value. However, the purpose of this is so the list is aligned with the parent FAB button. I decided to make this a bit more verbose so its clear where 56px is coming from. I originally thought that this was a bug since small FAB buttons can be 40px until I realized we were trying to account for the small FAB button margin too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how you structured the test here, it's very elegant!
Issue number: resolves #22564
What is the current behavior?
Changing the size of the FAB button causes it to be positioned incorrectly. This was happening because we set position values based on the assumption that the default FAB button would always be 56px x 56px.
What is the new behavior?
Does this introduce a breaking change?
Other information
Dev build:
7.4.1-dev.11695395641.14897417