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

Re: [css4-pseudo] multiple and nested pseudo-element ordering

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 24 Apr 2013 10:59:42 -0700
Message-ID: <CAAWBYDBdrZfTQp09nFtDcnb7BxVjRe+oonKQ3EE5=ZxTD=SjJw@mail.gmail.com>
To: "Sam L'ecuyer" <sam@cateches.is>
Cc: www-style list <www-style@w3.org>
On Tue, Apr 23, 2013 at 10:05 PM, Sam L'ecuyer <sam@cateches.is> wrote:
> Essentially, I'd *expect* that to output `Stock Prices Climb P premium V
> video` with the icon fonts applied.  However, I have two pseudo-elements of
> ordinal "1" and two of ordinal "2" so an implementation may want to output
> `Stock Prices Climb P V premium video`.

Yup, that doesn't work, because we can't treat each *rule* as defining
a different pseudo-element, because you may style the same
pseudo-element in multiple rules (for example, applying a :hover
rule).  The number there isn't just the ordinal, it's the *identity*.

> Perhaps, this should be overcome by
> changing the selectors to
>
> ..headline[data-content-level="premium"]::after(1)
> ..headline[data-content-level="premium"]::after(2)
> ..headline[data-content-type="video"]::after(3)
> ..headline[data-content-type="video"]::after(4)

Yes, you have to do something like this, and you have to simply be
aware of what level each thing is at.  There's no real way to deal
with this. :/

~TJ
Received on Wednesday, 24 April 2013 18:00:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 24 April 2013 18:00:33 UTC