Skip to content
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(Button): do not shrink button when there is only one icon #1577

Merged
merged 2 commits into from
May 20, 2024

Conversation

teleginzhenya
Copy link
Contributor

@teleginzhenya teleginzhenya commented May 13, 2024

Resetting plugin makes button with only icon shrink (#1529). Started to happen after flex refactoring (#1452)

Related issue #1529

@teleginzhenya teleginzhenya requested a review from amje as a code owner May 13, 2024 09:51
@teleginzhenya teleginzhenya requested a review from korvin89 May 13, 2024 09:51
@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

@korvin89
Copy link
Contributor

@teleginzhenya Could you add test for this case?

@teleginzhenya
Copy link
Contributor Author

teleginzhenya commented May 13, 2024

@korvin89 sure, I did in separate pr #1579 (to see the difference here)

@teleginzhenya teleginzhenya force-pushed the feature/fix-only-icon-button-shrink branch from 3dec613 to bd38edc Compare May 13, 2024 11:19
@@ -34,6 +34,7 @@ $block: '.#{variables.$ns}button';
color 0.15s linear;
transform: scale(1);
display: inline-flex;
flex-shrink: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the cause of the problem. The problem is in the negative margins of .g-button__icon element. Setting flex-shrink to 0 would break user layouts relying on flex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right
Fixed here 9047cd0
Test is here #1579

@teleginzhenya teleginzhenya force-pushed the feature/fix-only-icon-button-shrink branch from 9047cd0 to 52889cb Compare May 20, 2024 07:49
@teleginzhenya teleginzhenya merged commit 98fd95f into main May 20, 2024
5 checks passed
@teleginzhenya teleginzhenya deleted the feature/fix-only-icon-button-shrink branch May 20, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants