Re: [css3-grid-layout] [css3-layout] default layout of children

On Sunday 26 February 2012 06:22:11 Andrew Fedoniouk wrote:

> Just for the note:
> 
> I have flow:row() feature here:
> http://www.terrainformatica.com/w3/flex-layout/flex-layout.htm#flow-r
> ow
> 
> For example when I define template for the row as:
> 
> dl { flow:row(dt,dd); }
> 
> dt and dd elements in a <dl> list will be replaced in
> two columns grid - dt in first column, dd in second.
> 
> All elements inside the container that do not
> satisfy the template will take separate rows
> spanning all columns. That is simple and
> reliable I think.

I think the main problem is where the content of the grid element itself 
goes. You cannot set a property on it, because we don't have selectors 
that select the content (as opposed to the whole element).

If we have an answer to that, I think it will also be clear where child 
elements go.

I actually think that the current answer isn't bad at all: you define a 
default slot at the same time as you declare the grid. Not with a 
separate property, but simply as part of the value of the 'grid' 
property. Less verbose, and less risk of mistakes.

(That default slot is called '@' in the current draft, but Elika 
convinced me that '*' looks better, so now I'm advocating that symbol.)

The fallback to the first slot is just that: a fallback. If the author 
doesn't say where the content should go, there is no way the computer 
can infer it. Better in that case to do something that is clear and 
reliable. If it wasn't what the author intended, he only has to add his 
'*' somewhere, but at least he won't be confused as to what the computer 
is doing.

We could require that every template has to have a '*'. That would catch 
some errors early. I didn't do that in the current draft, because I can 
imagine that an author who is sure that there *is* no content other than 
what is explicitly flowed or positioned, finds it more esthetically 
pleasing to name the slots a b c instead of * a b.




Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Thursday, 1 March 2012 23:26:19 UTC