-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/commercetools/ui-kit/okjn8zaac |
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.
Should we have a visual snap for it?
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) |
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 a leftover because there is no isMouseOver
prop here.
: getTextColor(props.tone, true, overwrittenVars)}; | ||
} | ||
span + span { | ||
margin-left: ${vars.spacingXs}; |
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.
Almost the same as using an Inline
spacings component, but we can't use flexbox here.
635dafe
to
8587652
Compare
8587652
to
476a4bb
Compare
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.
VRT looks good 👌
UKIT-95
Summary
This PR adjusts the
FlatButton
to allow breaking the text into multiple lines when the element is not abutton
, 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:

After:
