-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
[Tabs] Use flat buttons for tabs #3051
Conversation
b24ea42
to
1fd1d86
Compare
@onumossn That will make the |
<div | ||
{...other} | ||
style={this.prepareStyles(styles)} | ||
<FlatButton |
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.
Can we use a <EnhancedButton />
instead?
@oliviertassinari How is this going to accommodate the changes being introduced in #3042? |
Well, we will have a merge conflict on this PR. |
Not just a merge conflict - FlatButton / EnhancedButton don't support the 'icon over text' layout. |
I wasn't aware of this issue. |
Updated it to use EnhancedButton, and tried adding the code from #3042 to see if it would have any negative impacts, and it seemed to work fine. However, there may be minor merge conflicts, but they can be easily resolved. Also, I moved the transform(0,0,0) for ripples to work correctly from the specific implementations of buttons to the EnhancedButton. I don't understand the lack of support. If it is used as container component like the div that was there, the children can be positioned and behave however they like within the container, so 'icon over text' should be work fine as long as both the icon and text are children. |
@onumossn - yes, sorry, you are correct. Thanks for testing. |
6deed43
to
a3cede4
Compare
Rebased |
@@ -285,6 +285,13 @@ const EnhancedButton = React.createClass({ | |||
cursor: disabled ? 'default' : 'pointer', | |||
textDecoration: 'none', | |||
outline: 'none', | |||
/* | |||
This is need so that ripples do not bleed |
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.
*needed
Other than that it's great 👍 👍 Thanks a lot 😁 |
paddingTop: (icon && !label) ? 4 : 0, | ||
height: (label && icon) ? 72 : 48, | ||
color: textColor, | ||
outline: 'none', | ||
fontSize: 14, |
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 agree, I like this PR 😍. |
Does this look ok? I updated padding to have left and right padding, and set top and bottom padding to 0. It doesn't seem the conditional top padding is necessary with enhanced buttons. Let me know if you feel that it is necessary and I will put it back in. |
Thanks a lot @onumossn Me and @oliviertassinari Will take a last look. Awesome work 👍 👍 |
👍 here. @oliviertassinari merge if it's alright. |
@onumossn Thanks! Can you squash down the commit? I think that we can merge then 👍. |
@@ -266,13 +266,10 @@ const FlatButton = React.createClass({ | |||
position: 'relative', | |||
overflow: 'hidden', | |||
backgroundColor: hovered ? buttonHoverColor : buttonBackgroundColor, | |||
lineHeight: buttonHeight + 'px', | |||
height: buttonHeight, |
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.
Since we are no longer using the FlatButton. I think that we can remove this change.
36f1249
to
5d848a8
Compare
Updated and rebased. Why is line-height used instead of height anyway? |
I think since that |
@oliviertassinari @alitaheri Seems like you both okayed this so I'll merge it. |
[Tabs] Use flat buttons for tabs
Thanks much @onumossn! |
Can I tap into the FlatButton, and disable the ripple somehow? This kind of screwed my navigation bar. |
Yes we should improve the customization for this. I also broke my close button since buttons cannot nest buttons. I'm trying to figure out the best way to achieve this. |
Use flat buttons for tab buttons to more closely comply with material design specs.