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

This is exciting to see! I just used Masonry for a project this past week. While it works quite well and is pretty performant, it is pretty hacky using absolute positioning, wanting to know the aspect ratios of objects beforehand for smoother layout, and having to recalculate everything on resize. I'm looking forward to having a generally available native option one of these days.




There is way to create masonry without specifying x,y position of every element though. https://codepen.io/mmis1000/pen/gOyZJqE

Adding a new element still need dimension of the element and a bit JavaScript.(The whole page use < 100loc unobfuscated JavaScript) But resizing can be handled by css naturally.

I think the issue here is most people don't really have a good way to specify how masonry should work. And thus don't have a good implementation either.


Me, too. I like masonry layout too much to wait for CSS to solve the problem, so I've been waiting to remove the last 1.3KB of Javascript from my home page since 2019.

Thank you to everyone who is making this happen.




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

Search: