Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My breakthrough moment for grid UI development was realizing that all of my layout code for a component is contained in the parent – rather than spread around the children.

For example, in bootstrap or some other older layout framework every "column" would need to contain some class or id to style it correctly. So for a 3 column grid you would need to give each element a class setup of something like "column-third".

With grid, all that layout logic is moved into a single container "display: grid" element, making it so much easier to add/remove/edit grid items. Even padding is declared in the container element with the "grid-gap" property! It's a small improvement that has immensely increased my developer experience building grid-like UI.



And it makes sense. That is define the properties of the container, not the individual items within it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: