3 ms·
Interesting, having used them both a lot I feel exactly the opposite way – I think grid's capabilities apply to more situations and suspect it will be the go-to
by exogen 8y ago
Interesting, having used them both a lot I feel exactly the opposite way – I think grid's capabilities apply to more situations and suspect it will be the go-to layout/alignment tool once it catches on more. Grid is the more powerful tool, I think the only feature it can't do that flexbox does is making wrapped items not line up (since grid, of course, wants to make them line up into a grid). Wanting items not to line up seems less common, doesn't it?
- chrismorgan 8y agoFlex is about single-dimensional layout, grid is about two-dimensional layout. Most layout scenarios that are in two dimensions can actually be solved with nested single-dimensional layout. Sometimes it’ll be easier to solve them with a proper two-dimensional layout, and I tend to prefer the markup that Grid lets me have, but I find two-dimensional layout that can’t be solved with nested single-dimensional layout to be uncommon. Also, most interface problems are actually single-dimensional. I think Grid will become more popular than it is, but never overtake Flexbox as most people’s go-to for layout, because Flexbox is normally enough, and Grid is too complex. I use it from time to time, and I have taken the trouble to know exactly what it’s capable of, so that I know when I should reach for it rather than Flexbox or something else or giving up, but I normally need to look up various properties when I go to use it. Meanwhile, most of what people want to achieve with Flexbox is just `display: flex;` plus `flex-direction`, `flex`, `align-items` and `justify-content`, and there are few enough knobs that you can essentially brute-force it without trouble—and the Flexbox Inspector makes it even easier, in a way that the Grid Inspector can’t really because Grid is just too powerful.