Re: [css-grid] Positioned items and grid lines

On Tue, Apr 26, 2016 at 8:19 AM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
> Hi,
>
> I've been talking to Mats Palmgren in a Firefox bug [1] about the
> expected behavior of positioned items in some special situations.
>
> The first example is the one we discussed a while ago in this list [2].
> But let's use a new version in this mail:
> <div style="display: grid; grid: 100px / 100px 50px;
>             width: 300px; padding: 0px 50px; position: relative;">
>   <div style="position: absolute; grid-column: auto / 1;">item1</div>
>   <div style="position: absolute; grid-column: 3 / auto;">item2</div>
> </div>
>
> IMHO, the items should be placed like this:
> * item1: From 0px to 50px (left padding).
> * item2: From 200px to 400px (empty part of the content box + right
> padding).
>
> However Mats doesn't agree with the position of "item2", he thinks it
> should be: From 350px to 400px (right padding).
> I'd like to confirm the expected behavior as this contradicts what Tab
> replied to me in the old thread [3].

It sounds like Mats is considering the space between the last explicit
grid line and the edge of the content box to be a "grid gap", like
what's created by the grid-*-gap properties?  I'm not sure where's
they're getting that from.  The "0th track" that exists on either side
of the grid for abspos positioning purposes goes stretches from the
last implicit grid line to the padding edge; it doesn't just occupy
the padding area.

In other words, your reasoning is correct.

> On top of that, I'd like to clarify what happens when we use content
> alignment. For example if we set "justify-content: space-evenly;" on the
> previous grid.
>
> Again I think the items should be placed:
> * item1: From 0px to 100px (left padding + distribution offset).
> * item2: From 300px to 400px (distribution offset + right padding).
>
> In this case Mats doesn't agree in any of those. He thinks that "item1"
> should be from 0px to 50px (left padding) and "item2" from 350px to
> 400px (right padding).
> It'd be nice to clarify this situation too.

You're right again.  I'm not sure what needs to be clarified, because
I have no idea what part of the spec is making Mats think that the 0th
track only fills the padding area.

~TJ

Received on Tuesday, 26 April 2016 18:51:50 UTC