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

[Tabs] Use flat buttons for tabs #3051

Merged
merged 1 commit into from
Feb 1, 2016
Merged

Conversation

onumossn
Copy link
Contributor

Use flat buttons for tab buttons to more closely comply with material design specs.

  • All caps text
  • Add ripples
  • Unfocused tab color: #fff 70%

@mbrookes mbrookes changed the title Use flat buttons for tabs [Tabs] Use flat buttons for tabs Jan 26, 2016
@oliviertassinari
Copy link
Member

@onumossn That will make the Tabs follow more closely the material specification 👍.

@oliviertassinari oliviertassinari added the design: material This is about Material Design, please involve a visual or UX designer in the process label Jan 26, 2016
<div
{...other}
style={this.prepareStyles(styles)}
<FlatButton
Copy link
Member

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 oliviertassinari added PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Jan 26, 2016
@mbrookes
Copy link
Member

@oliviertassinari How is this going to accommodate the changes being introduced in #3042?

@oliviertassinari
Copy link
Member

Well, we will have a merge conflict on this PR.

@mbrookes
Copy link
Member

Not just a merge conflict - FlatButton / EnhancedButton don't support the 'icon over text' layout.

@oliviertassinari
Copy link
Member

Not just a merge conflict - FlatButton / EnhancedButton don't support the 'icon over text' layout.

I wasn't aware of this issue.

@onumossn
Copy link
Contributor Author

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.

@mbrookes
Copy link
Member

@onumossn - yes, sorry, you are correct. Thanks for testing.

@oliviertassinari
Copy link
Member

@onumossn We have just merged #3042. Could you rebase?

@onumossn onumossn force-pushed the rippled-tabs branch 2 times, most recently from 6deed43 to a3cede4 Compare January 28, 2016 03:44
@onumossn
Copy link
Contributor Author

Rebased

@alitaheri alitaheri added PR: Needs Review and removed PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Jan 28, 2016
@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

*needed

@alitaheri
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

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

Can we add it back?
capture d ecran 2016-01-28 a 11 37 12

@oliviertassinari oliviertassinari added PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Jan 28, 2016
@oliviertassinari
Copy link
Member

I agree, I like this PR 😍.

@onumossn
Copy link
Contributor Author

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.

@alitaheri alitaheri removed the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Jan 30, 2016
@alitaheri
Copy link
Member

Thanks a lot @onumossn Me and @oliviertassinari Will take a last look. Awesome work 👍 👍

@alitaheri
Copy link
Member

👍 here. @oliviertassinari merge if it's alright.

@oliviertassinari
Copy link
Member

@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,
Copy link
Member

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.

@oliviertassinari oliviertassinari added PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Review Accepted labels Jan 30, 2016
@onumossn
Copy link
Contributor Author

onumossn commented Feb 1, 2016

Updated and rebased. Why is line-height used instead of height anyway?

@newoga newoga added PR: Needs Review and removed PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Feb 1, 2016
@newoga
Copy link
Contributor

newoga commented Feb 1, 2016

Updated and rebased. Why is line-height used instead of height anyway?

I think since that <FlatButton /> just has text, the lineHeight is used to make sure it's vertically centered properly.

@newoga
Copy link
Contributor

newoga commented Feb 1, 2016

@oliviertassinari @alitaheri Seems like you both okayed this so I'll merge it.

newoga added a commit that referenced this pull request Feb 1, 2016
[Tabs] Use flat buttons for tabs
@newoga newoga merged commit 5f47b3d into mui:master Feb 1, 2016
@newoga
Copy link
Contributor

newoga commented Feb 1, 2016

Thanks much @onumossn!

@maartenbusstra
Copy link

Can I tap into the FlatButton, and disable the ripple somehow? This kind of screwed my navigation bar.

@alitaheri
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants