|
|
|
|
|
by bob1029
137 days ago
|
|
This seems kind of redundant. I would just use flexbox for something like this. Grid is already an extremely rare item for me. I only ever use it when I need to control the overall layout for an app that has to work on a wide range of viewports. I'd never use grid just because it can do clever brickwork. |
|
Grid covers a lot of very subtle use cases that have historically required hacks like a list of select options where some can have icons on the left and some don't. You just need a subgrid that will automatically position every element in the select correctly to align them, regardless of whether there is an icon or not within the element in all select items. Previously you'd have to add a fixed width padding to the left and check if all the select items had icons. It also correctly scales the width and height of a row of items like cards where you want to ensure the alignment of headers, content, image etc depending on if that stuff is in there or not. You can have text missing and the card will still take up that size because your subgrid has defined it so. All of this needed JS, complex CSS hacks and so on. These aren't obscure features these are commonly used layouts that required a lot of time and effort to make it look nice.
[1] https://webkit.org/blog/17660/introducing-css-grid-lanes/