Re: [css-grid] [Collapsed Grid Items] [ISSUE 2]

Hi Rego,

On 2015-01-22 16:04, Manuel Rego Casasnovas wrote:
> Hi,
>
> On 21/01/15 14:03, Mikel Zorrilla wrote:
>> Dear CSS Grid editors,
>
> I'm not an editor, but an implementor of CSS Grid Layout. Anyway I'll
> share my thoughts. :-)
>
>> Our idea is based on having the items ranked with a priority, depending
>> their position in the layout. The priority will be allocated going over the
>> layout matrix from left to right and from top to down. In the following
>> example:
>
> I guess you mean here "their position in the DOM tree".
>
>> [image: Imágenes integradas 1]
>> If we remove one of them, the Collapsed Grid mechanism will allocate the
>> items depending their priority, the first empty place where there is enough
>> space for that item going over the layout matrix from left to right and
>> from top to down.
>>
>> For example, if we remove number 4:
>>
>> [image: Imágenes integradas 2]
>> If we remove number 2:
>> [image: Imágenes integradas 3]
>> If we remove number 3:
>> [image: Imágenes integradas 4]
>
> If I'm getting it properly, this is more or less what's provided by
> auto-placement feature.
> If you have "grid-auto-flow: row;" (which is the default) and all the
> items are auto-positioned, you'll have the behavior that you're
> explaining when you add/remove items from the grid.

I was the one who pointed Mikel to "Collapsed Grid Items" in the CSS 
Grid Layout Module spec, but now realize that I misunderstood the 
purpose of that feature.

We are looking for a way to place items in a grid automatically, which 
indeed matches what "grid-auto-flow" has to offer (the "dense" value 
could be a better fit in our case), and for a way to adjust the grid 
when items are removed from or added to the grid.

I thought that's what "Collapsed Grid Items" was about, but a mere 
"display: none;" should cover that need, actually! Sorry about the 
confusion.

Collapsing would only be useful if we wanted to preserve e.g. the width 
of an item we remove to avoid wobbling effects when the item is added 
back to the grid afterwards, as happens in expandable navigation menus.

>
> In case you want to experiment with it, auto-placement is already
> implemented in Chromium/Blink (enabling the feature flag) and WebKit
> Nightlies (using -webkit prefix).

Thanks for the info!

Francois.

Received on Friday, 23 January 2015 10:41:24 UTC