Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Chris’ Corner: Even Grids

CodePen·@HashtagPLUS·about 1 month ago
#fu7yhwly
#docs#aspect#layout#grid#problem#photo
Reading 0:00
15s threshold

It’s always interesting observing multiple people attack the same problem. Sometimes they aren’t even aware of each other. Like how Isaac Newton invented calculus in the mid 1660’s in England, then Gottfried Leibniz did the same a decade or so later, independently (or so it is said). I just read Ibrahim Bendebka’s recent take on Flexbox Masonry Layout . This approach is thick with mathematics, which I cannot pretend to fully understand. I understand the requirements, though, as it’s having a bunch of elements with  known aspect ratios  laid out into rows that cleanly fill the horizontal space. You don’t get that behavior by default, so it requires using aspect-ratio that you calculate and then also apply to flex-grow , so it requires understanding the flexbox model pretty deeply. Late last year, Ian Kilpatrick came across the same exact idea in  Exploiting flex-grow for an Image Gallery,  and I really have no idea whether Ibrahim and Ian know of each other.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More