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

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 UTC