W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [css3-layout] A shortcut with numbers instead of letters in a template

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 3 Dec 2011 10:08:04 -0800
Message-ID: <CAAWBYDAu_ViGS535igypxK4FxA8Y0M+mxSE2zs1fpa3CWk6vbQ@mail.gmail.com>
To: Anton Prowse <prowse@moonhenge.net>
Cc: www-style@w3.org
On Sat, Dec 3, 2011 at 1:02 AM, Anton Prowse <prowse@moonhenge.net> wrote:
> On 02/12/2011 17:42, Tab Atkins Jr. wrote:
>> I don't like that this makes spaces required in templates.
>
> Strictly, it doesn't:
>
>    BODY { display: ".1."
>                    "2.3"
>                    ".4." }
>
> is unambiguous.  Spaces are only required when two digits are adjacent.
>  Alternatively, we could say that "12" is never interpreted as twelve but
> always as one-two, thus restricting this shorthand to elements amongst the
> first nine children.

That latter suggestion is what I was thinking of.


>> Does this make multi-character slot names valid in general?
>
> I don't see why.

Well, if multi-digit slots are valid, and thus spaces between slots
are required, then there's no reason to restrict us to single-digit
slot names in general.


>> What happens if you use "1" in a template, but your first child has
>> "position: fixed;" or worse, "position: a;"?
>
> I think this shorthand can only apply to elements with position:auto.  A
> slot labelled "1" should not filled if the first-child has non-auto
> position.
>
> I can see why authors would find the shorthand attractive.  However, I don't
> like the fact that when inspecting an element's position property it's not
> possible to know whether the element participates in template layout or not
> (because the value is 'auto').  (Does CSS have other examples of an element
> being pulled into some layout context without that fact being possible to
> deduce just from inspecting the element?) One way of solving that would be
> to give such template elements a new keyword value of the 'position'
> property, eg position:template,

Yes, both Flexbox and Grid require you to inspect the parent to know
what the child's layout context is, at least in some situations.

Requiring "position:template" doesn't get you much over just requiring
"position: 1".

~TJ
Received on Saturday, 3 December 2011 18:08:59 GMT

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