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(flat-button): icon size and position for multi-line anchors #1211

Merged
merged 7 commits into from
Dec 10, 2019

Conversation

jonnybel
Copy link
Contributor

@jonnybel jonnybel commented Dec 9, 2019

UKIT-95

Summary

This PR adjusts the FlatButton to allow breaking the text into multiple lines when the element is not a button, and changes the position and size of the icon, not allowing it to shrink and keeping it on the same line as the text.

Before:
image-2019-12-04-15-33-05-618

After:
image

@jonnybel jonnybel added the 🐛 Type: Bug Something isn't working label Dec 9, 2019
@jonnybel jonnybel self-assigned this Dec 9, 2019
@vercel
Copy link

vercel bot commented Dec 9, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/commercetools/ui-kit/okjn8zaac
🌍 Preview: https://ui-kit-git-ja-fix-linkbutton.commercetools.now.sh

Copy link
Contributor

@tdeekens tdeekens left a comment

Choose a reason for hiding this comment

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

Should we have a visual snap for it?

@jonnybel
Copy link
Contributor Author

jonnybel commented Dec 9, 2019

Yes, I'll add a test for this.

if (!props.icon) return null;

let iconColor = 'solid';
if (props.isDisabled) iconColor = 'neutral60';
else if (props.tone === 'primary') iconColor = 'primary';
else if (props.tone === 'secondary' && props.isMouseOver)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a leftover because there is no isMouseOver prop here.

: getTextColor(props.tone, true, overwrittenVars)};
}
span + span {
margin-left: ${vars.spacingXs};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Almost the same as using an Inline spacings component, but we can't use flexbox here.

Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

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

VRT looks good 👌

@kodiakhq kodiakhq bot merged commit 8604106 into master Dec 10, 2019
@kodiakhq kodiakhq bot deleted the ja-fix-linkbutton branch December 10, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants