W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css-grid] Dense Packing (Masonry algorithm)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 22 Jul 2013 09:34:54 -0700
Message-ID: <CAAWBYDD6nXeYnjwBC692d9b=ik_tTq4KTvNQmM3SL6U0+GV=sw@mail.gmail.com>
To: Henrik Andersson <henke@henke37.cjb.net>
Cc: Fran├žois REMY <francois.remy.dev@outlook.com>, "www-style@w3.org" <www-style@w3.org>
On Sat, Jul 20, 2013 at 1:53 AM, Henrik Andersson <henke@henke37.cjb.net> wrote:
> Tab Atkins Jr. writes:
>> As a further note, while the classic Masonry jQuery plugin used sparse
>> packing, there have been many requests over the years for dense
>> packing, and several variants that do it.  I can't find the recent JS
>> library that does dense packing that I was looking at previously, but
>> it looks quite nice.
> You are right in that Masonry doesn't really do dense layout like described
> here. But at the same time, it doesn't do sparse layout either. It adds to
> the bottom of the shortest column. This gives similar results to dense grid
> layout if the items always have a multiple of the grid height.

Right, Masonry is halfway between the two - it packs sparsely, but in
such a way as to minimize the bottom edge.

However, I've seen JS libraries that do true dense packing.

> I can't think of a CSS layout that does what I just described here. Is there
> one? If not, should there be one?

Possibly!  It would be an interesting feature to consider for Grid L2
- allow items to just flow compactly in one axis rather than aligning
to the grid lines?  Definitely not a feature for the current level,
though.  ^_^

Received on Monday, 22 July 2013 16:35:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC