W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: Parentheses-free pseudo-elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 15 Jul 2013 21:22:40 -0500
Message-ID: <CAAWBYDARixqjJ+knomuOxPy-C_xOzKo04=VfCODhg+oxzwPndw@mail.gmail.com>
To: Fran├žois REMY <francois.remy.dev@outlook.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Mon, Jul 15, 2013 at 6:16 PM, Fran├žois REMY
<francois.remy.dev@outlook.com> wrote:
> TL/DR: With the use of Shadow DOM, I start seeing parametric pseudo-elements all over the place. This is great, but if those pseudo-elements use parentheses, they will not compose well with the nested rule proposal that are greatly needed to reduce the overhead those pseudo-elements introduce.
>
> I therefore propose that parentheses around a pseudo-element should not be required if the pseudo-element is last in chain, which I think will be the case for most shadow-dom-related pseudo-elements, as well as region-related ones.
>
> In fact, I'm strongly arguing for the parentheses-free syntax in all cases where it is known beforehand that no other pseudo-element would make sense after the parametric one.
>
>
>
> This make it possible to write things like:
>
>     ::distributed figure { ... }
>     ::distributed ... ... ...
>
> ==
>
>     ::distributed {{
>         figure { ... }
>         ... ... ...
>     }}
>
>
> and
>
>
>     #my-region::region figure { ... }
>     #my-region::region ... ... ...
>
> ==
>
>     #my-region::region {{
>         figure { ... }
>         ... ... ...
>     }}
>
> (where an isolated {}-island inside a selector triggers in-rule selector nesting)

The Shadow DOM pseudos have already switched to this (the spec may not
have caught up to it, yet), and Alan was planning to switch ::region
as well, as soon as Shadow DOM's switch was confirmed and sure.

> PS: By the way, did someone beside Tab had a look at the {so-called} ":host(selector) pseudo-class" {previously known as the ":context()" pseudo-class}? It seems really crazy to me and not functionally belonging to the "pseudo-class family". If not, please have a look here:
>
>     https://www.w3.org/Bugs/Public/show_bug.cgi?id=22390
>
> and start a new thread if you feel the same as me

How is it possibly not a pseudo-class?  It's an additional filter
applied to the host element, based on information not obtainable via
normal selectors.

~TJ
Received on Tuesday, 16 July 2013 02:23:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC