W3C home > Mailing lists > Public > www-style@w3.org > October 2009

Re: [css3-layout] shorthand for slot construction

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 18 Oct 2009 09:53:07 -0500
Message-ID: <dd0fbad0910180753y563d3afct41e73abc824085e9@mail.gmail.com>
To: Stephen Hay <haymail@gmail.com>
Cc: Www-style <www-style@w3.org>
On Sun, Oct 18, 2009 at 3:56 AM, Stephen Hay <haymail@gmail.com> wrote:
> Hi all,
>
> The only real criticism I've heard regarding Template Layout, is the
> whole ASCII art thing. While the comparison of the syntax with ASCII
> art is flimsy at best, I'm assuming that some feel that brevity could
> be introduced in some cases.
>
> While:
>
> #example {
>    display: "aaaaaaaaaa.b"
>             "cccccccccccc" }
>
> can be useful, especially for "drawing" things like GUI components,
> would a shorthand be possible?
>
> Is something like:
>
> #example {
>    display: "a[10].b"
>             "c[12]" }
>
> conceivable, or would it even be useful? Admittedly, this throws the
> visual aspect (which I tend to like) out the window, but because it's
> just a shorthand, authors are still free to use the longer form.

What's the *purpose* of it, though?  The only reason to ever use a
string like in your first example is if you actually *need* that level
of detail with things being placed all over the page with odd offsets
from each other.  There's no reason to do so if all you want is to
express sizing.

#example {
  display: "a.b"
           "ccc"
           10* * *;

...oh.  Wait.  ::looks up the current draft::  Full support for flex
units doesn't appear to exist in the current draft for whatever
reason.

Now, in this particular instance, since all of the lengths are flexes,
you can replace them with %s (use "83.3% 8.3% 8.3%").  But that's not
possible if one of the columns (often the spacer column in your
example) is an absolute length.  (Well, you could use relatively
complex calc() hacking, like "calc((100% - 2em) * 10 / 11)", but let's
not be silly.)

So I think this problem really boils down to just "Template Layout
needs to support proper flex units".

(As you note, the rest of the "Eugh, ASCII art?" complaint is flimsy
at best, and not worth addressing.)

~TJ
Received on Sunday, 18 October 2009 15:00:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:21 GMT