News for hackers. Stuff that matters.
Re:CSS Grid Areas by emadda on Friday August 16, 2024 @07:08AM (#41265226)
One thing flex cannot do well is white space: how do you leave a gap of content without spacer divs?

This becomes more complicated when the number of divs is dynamic as flex determines position based on siblings. With grid you already have defined the “layout”, and you are just placing the div into the correct position.

Grid does that in both axis too. So although you may be able to kind of replicate the 1d version with flex, it becomes much harder to align in 2D.

I wrote an article about this: https://cssprinciples.com/3/grid/

Re:CSS Grid Areas by jdthedisciple on Saturday August 17, 2024 @05:07AM (#41272951)
gap works with flexbox I believe

    .flex {
      display: flex;
      gap: 8px;
    }
Re:CSS Grid Areas by emadda on Saturday August 17, 2024 @10:24AM (#41274820)
I mean gaps of white space that are part of the design and could possibly host content for different app states (not uniformly distributed between flex items).