T
9

Grid vs flexbox for actual layouts not just rows

I keep seeing people online say flexbox can do everything grid does if you just nest it right, but after rebuilding a dashboard layout last month I think that's nonsense. Grid handled the 2D spacing and alignment in like 10 lines while my flexbox version needed extra wrappers and calc() hacks that broke on mobile. Has anyone else found grid just wins for anything that isn't a straight row or column?
2 comments

Log in to join the discussion

Log In
2 Comments
fiona_murray
Troy nailed it, flexbox makes you fight the browser for every little thing. Grid just clicks into place, no extra wrappers or calc spaghetti needed. The two dimensional thing is a game changer, you map out columns and rows at once. Flexbox is great for simple stuff but anything with overlapping elements or fixed sidebars? Grid all the way.
5
troy_butler7
Wait hold up you actually tried to rebuild a full dashboard with nothing but flexbox? That sounds like a nightmare honestly, I've been there and the calc hacks alone made me want to throw my laptop. Grid just maps out the whole layout at once while flexbox makes you fight the browser for every corner case.
4