Re: [css3-grid-layout] relationship between 'grid-column', 'grid-column-position' and 'grid-column-span'

On Wed, Nov 7, 2012 at 4:30 AM, Kang-Hao (Kenny) Lu <kanghaol@oupeng.com> wrote:
> The spec says
>
>    # The ‘grid-column-position’ and ‘grid-column-span’ properties
>    # can be simultaneously specified with the ‘grid-column’ shorthand
>    # property.
>
> , but what would 'grid-column: "undefined1" "undefined2";' get expanded to?
>
> It would expect 'grid-column-position' to have 'undefined1' but what
> about 'grid-column-span'? The initial value '1'? But what happens when
> "undefined2" and "undefined1" are defined later?

Huh?  This is well-defined - you get "grid-column-span:
'undefined2';". (In the current draft syntax.)

What makes you think it would be something different?  It appears that
you think whether or not a grid-line is defined will have an effect on
the shorthand expansion.  This is not the case.

> This does't seem to match the notion of shorthand property in CSS 2.1.
> Perhaps 'grid-column' only becomes a shorthand when computed values are
> determined? If so, this needs to be clarified.

That doesn't work.  Shorthands are expanded before the cascade.  You
can potentially make it *not* a shorthand, but rather a property that
is consulted by other properties at computed-value time (similar to
align-items and align-self), but there's no need to do that here.


> Also,
>
>   # EXAMPLE 17
>   #
>   # <style type="text/css">
>   # #item {
>   #    /* the following two property definitions are equivalent */
>   #    /* both place the item between the first and third line */
>   #    /* which is covering the first and second row of the Grid */
>   #    grid-row-position: 1 3;
>   #    grid-row-position: 1; grid-row-span: 2;
>   # }
>   # </style>
>
> but the grammar has
>
>   # Name:       grid-row-position
>   # Value:      <integer> | <string> | <identifier> | auto
>
> , so I guess something is wrong.

Yes, clearly the example meant to say "grid-row: 1 3;" in the first line.

~TJ

Received on Wednesday, 7 November 2012 18:31:14 UTC