3 ms·
The reasons I sometimes use grid over flex: - You can align things in 2D space, not just along a single axis (like flex). Great for the top level layout of a s
by emadda 3y ago
The reasons I sometimes use grid over flex:
- You can align things in 2D space, not just along a single axis (like flex). Great for the top level layout of a site/UI.
- You can have white space. I often create white space (empty grid cell) in my UI so I can add UI elements there if needed later on. Works well with elements that are conditionally rendered, as these will change flex layouts but elements assigned to a grid cell will not move.