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

Vertically centering rows #49

Closed
zsherman opened this issue Dec 29, 2016 · 10 comments
Closed

Vertically centering rows #49

zsherman opened this issue Dec 29, 2016 · 10 comments

Comments

@zsherman
Copy link

Is there a recommended way to do this or should we just specify whatever styles directly on the <Page> component?

@AriTheElk
Copy link
Owner

AriTheElk commented Dec 29, 2016

The way to officially handle this within flexbox is by using the justify-content property. I ported this property to hedron in the form of the justifyContent component property (outlined here on the wiki).

Here's an example of justifyContent in action. Let me know if this answers your question 😄

@AriTheElk
Copy link
Owner

Admittedly, I need to work on ramping up the wiki documentation. If you're not familiar with the flexbox system, it would be fairly obscure what the properties outlined in the wiki actually do. Seeing as the whole point of hedron is to abstract away the complicated flex stuff, I really need to document them better.

justifyContent sets the flex-align on the vertical axis, alignContent sets the flex-align on the horizontal axis. The values they accept are stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit

@zsherman
Copy link
Author

Oh yeah I'm familiar with flexbox, I was asking about centering rows within a page, not just centering inside the rows themselves.

@zsherman
Copy link
Author

For now I just added my own flex styles in a style object but it would be nice if you could add flex attrs to the <Page> component

@AriTheElk
Copy link
Owner

Ah, sorry for misunderstanding. Yeah that's a valid workaround; would definitely be nice to add that feature, so thanks for the suggestion! Any ideas on what an ideal API would look like for you?

@zsherman
Copy link
Author

Cool no worries, thanks for the library!

Thought the way http://roylee0704.github.io/react-flexbox-grid/ handles it was quite good/obvious.

@AriTheElk
Copy link
Owner

Thanks, I'll check it out 👍

@AriTheElk
Copy link
Owner

I have officially added this to the roadmap, feel free to drop by on #50 with any additional input/suggestions you might have before I begin the implementation 😄

@zsherman
Copy link
Author

thanks @garetmckinley, will do!

@AriTheElk
Copy link
Owner

This is resolved in v1. Alignment, in general, is now much more flexible and the Page component has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

2 participants