Re: [css3-layout] shorthand for slot construction

2009/10/18 Tab Atkins Jr. <jackalmage@gmail.com>
>
> On Sun, Oct 18, 2009 at 12:33 PM, Stephen Hay <haymail@gmail.com> wrote:
> > Tab Atkins Jr wrote:
> >> (I doubt that a general layout module would be very useful.  Different
> >> approaches are best for solving different layout problems, especially
> >> when you have such a focus on simplicity of authoring as CSS.  Generic
> >> approaches are generally substantially more complex.)
> >
> > Does this mean you see grid, flexbox and template all being
> > implemented and used for different things?
>
> Yes.
>
> > I see a great deal of
> > overlap between grid and template, because template can be used for
> > both grid and non-grid layout systems.
>
> Indeed.  I feel that Template is really just a layer of syntax sugar
> over Grid, with a bit of magic sprinkled on top.  As well, there are a
> few improvements to CSS I'd like to see that would reduce this magic
> to a minimum (the old flow-to proposal, or whatever we were calling
> it).  Grid is a general mechanism that may be easier to build
> templating systems and such on top of, but Template is easier for
> authors like me to use for most common cases.

Well, actually Template layout is completely different from Grid
(things flow in Template, they don't in Grid, for instance).
In fact we are seeing a lot of competitive layout models in current
CSS (in-flow, floating, abs positioning, tables), adding more new
layout modes does not seem productive. Instead we should evolve what
we have.
In particular, I believe that Grid should just be a new feature of
Absolute Positioning 3. In fact, look at normative text in current
css3-grid draft that defines generation of grid lines: one section out
of 6. And it says nothing about the actual use of "gr" (no, you cannot
use it every time you would use a <length>, could imagine font-size:
1gr?).
To me, restricting <grid> values to "top"/"left"/"bottom"/"right",
along with defining their meaning could be just fine; then you're left
with Absolute Positioning with syntax sugar, but it looks way cleaner
and could be still useful in union with other layout schemes and magic
grids

On the other side, look at Flexible Box first. Does it look familiar?
No I doesn't, because it uses a lot of new properties, a new "display"
value etc.
Are those new features? Not really, cause most of what you can do with
Flexible Box can also be done with Tables. Just replace box with
table, box-align with vertical-align on children, box-pack with
width:min-intrinsic and margin-left/-right: auto, box-flex with
percentages and box-orient with block-flow.
The remaining features are box-lines and box-flex-group. I believe the
former has been proposed for Tables 3, the latter can be introduced in
the better description of the automatic table-layout.

Third, the Template Layout. Again, new syntax (ASCII art and strange
use of position), new algorithms.
But what is Template Layout really? A table that is not included in
the markup, that's it!
Include the table, make the Flexible Box modifications to the tables
algorithm, put content inside the table and suddenly you don't need
Template Layout. But of course we cannot afford adding content to our
documents, and logical order does not follow visual order.
So keep Advanced Layout for creating this anonymous table out of
nothing, then use table algorithms, amended to take better care for
spanning columns and percentage heights, and GCPM 4 content flowing
system (which means move-to / flow-to / whatever instead of position)
to put stuff inside the anonymous cell.
This also means that strange flex units are not really needed, you
just go with percentages on width, height + min-width / min-height.
Actually, this would make the whole ascii art concept a bit less
useful (since you need to set the [min-/max-]width, [min-/max-]height
on the ::slot()). We could go back to the @template syntax in the 2007
version of css3-layout.

In conclusion, my opinion is go tables, go absolute positioning, go
percentages and go syntax sugar. New layout systems and algorithms are
not that needed, not in the 2009 world of full CSS2 support.

>
> > Thanks for your informative responses BTW.
>
> No problem!  Layout solutions are an interesting area in CSS to me.
>
> ~TJ
>

Giovanni

Received on Sunday, 18 October 2009 18:49:16 UTC