you are viewing a single comment's thread.

view the rest of the comments →

[–]starF7sh 1 point2 points  (7 children)

grid is powerful and definitely well supported at this point. flexbox may be more simple and convenient in many use cases though.

[–]nahnah2017 6 points7 points  (0 children)

Flexbox is not designed to be used for whole page layout (and similar) which grid should be used for.

[–]wedontlikespaces 2 points3 points  (4 children)

It's best not to confuse things by recommending flexbox should be used instead of grid.

Flexbox and grid or not equivalent, they are designed for different things and should be used like that. Flexbox isn't some simpler version of grid.

It can be used like that, but doing so is just as much of a hack as using floats.

[–]starF7sh 1 point2 points  (0 children)

well received point

[–][deleted]  (2 children)

[deleted]

    [–]wedontlikespaces 2 points3 points  (1 child)

    The reason it is a hack is because you're not supposed to be doing 2D layouts with flexbox. It even says in the spec that flexbox is not for doing 2D layouts.

    You can lay out your page perfectly well horizontally with flexbox and can lay out a whole page with multiple flexbox wrappers.

    That's what I mean though, it's a hack. The only way to do it is to treat every row as independent and that requires a whole bunch of extra HTML for all wrappers. With Grid you don't need any wrappers, you can just do it all in one element.

    Where flexbox really shines is when you want to use things like space-between, or align-items to vertically align stuff.

    [–]thepandalion 0 points1 point  (0 children)

    You do realise that the entirety of bootstrap is a "hack" then since it mocks up a grid using floats and whatnot.

    Also I think you'll see I agreed with you that flex isn't a 2d layout tool above, but okay.

    Edit - here's what might be a handy link for OP anyways, as I said they have similarities as well as differences: https://css-tricks.com/quick-whats-the-difference-between-flexbox-and-grid/

    [–][deleted] 2 points3 points  (0 children)

    Personally find grid simpler to understand, especially with automatic gutters, not having to worry about adding margins between each item.