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

[Tab] Fix the justify content when there is only one child #4023

Merged
merged 1 commit into from
Apr 18, 2016
Merged

[Tab] Fix the justify content when there is only one child #4023

merged 1 commit into from
Apr 18, 2016

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Apr 17, 2016

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

We shouldn't be using justifyContent: 'space-between' when there is only one child. As we can see here, the element is rendered at the top.
I'm using justifyContent: 'center' instead and I'm added a margin to have a fine control of the spacing.
capture d ecran 2016-04-17 a 21 03 08

@oliviertassinari oliviertassinari added PR: Needs Review design: material This is about Material Design, please involve a visual or UX designer in the process labels Apr 17, 2016
@nathanmarks
Copy link
Member

@oliviertassinari would space-around make more sense for the default in this situation?

@oliviertassinari
Copy link
Member Author

@nathanmarks Well, let me try with space-around.

@oliviertassinari
Copy link
Member Author

@nathanmarks You are going to like this much better (I do at least). I'm using center now.

padding: 12,
paddingBottom: (props.label && props.icon) ? 7 : 12,
justifyContent: 'center',
height: (props.label && props.icon) ? 72 : 48,
Copy link
Member Author

Choose a reason for hiding this comment

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

72 and 48 are the official height.

@nathanmarks
Copy link
Member

@oliviertassinari even better -- there's no reason not to create the margin in between them with the spec numbers. The flex spreading is unpredictable.

@oliviertassinari
Copy link
Member Author

there's no reason not to create the margin in between them with the spec numbers.

Indeed, it's already done ;).

@nathanmarks nathanmarks merged commit 850c04a into mui:master Apr 18, 2016
@oliviertassinari oliviertassinari deleted the tabs-fix-justify-content branch April 18, 2016 06:01
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.

2 participants