roylee0704 / react-flexbox-grid

A set of React components implementing flexboxgrid with the power of CSS Modules.
http://roylee0704.github.io/react-flexbox-grid/
2.93k stars 206 forks source link

centered Grid #104

Closed lstkz closed 7 years ago

lstkz commented 7 years ago

What is the proper way to get a centered grid with max-width?

<Grid /> it sets max-width, but doesn't center, and there is no padding. <Grid fluid /> full width with paddings

at http://flexboxgrid.com/ they added an extra wrap class.

image

I solved it by creating a custom global class, and I use <Grid className="wrap"/>, but I think it should be supported directly by the component.

Any thoughts?

silvenon commented 7 years ago

We should add it as a prop then, yes. I wonder why it's missing from their documentation. So this should only work for <Grid fluid> or also for <Grid>?

lstkz commented 7 years ago

Only for <Grid>

silvenon commented 7 years ago

<Grid> does center, look.

react-flexbox-grid is meant to be strictly React bindings for flexboxgrid, not fix its shortcomings. .wrap is not a part of flexboxgrid, therefore should not be included.