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

Re: [css3-page][css-gcpm] Styling elements differently based on whether they appear on a left or right page

From: Lea Verou <lea@verou.me>
Date: Thu, 12 Sep 2013 00:56:32 +0200
Cc: Håkon Wium Lie <howcome@opera.com>, "Brad Kemper" <brad.kemper@gmail.com>, "Alan Stearns" <stearns@adobe.com>, "www-style list" <www-style@w3.org>
Message-Id: <0CECA637-C2F1-4AF5-AB4F-BE8CD92CA88B@verou.me>
To: "Simon Pieters" <simonp@opera.com>
On Sep 12, 2013, at 00:50, "Simon Pieters" <simonp@opera.com> wrote:

> On Thu, 12 Sep 2013 00:26:43 +0200, Lea Verou <lea@verou.me> wrote:
> 
> So the selector was
> 
> article::page(left) p
> 
> now consider
> [snip]

Actually, that’s a very good point, but not for the reason you posted it. This is not possible AT ALL if ::page() is a pseudoelement, as elements cannot be nested in pseudoelements: “the pseudo-element must appear after the compound selector that represents the subjects of the selector” [1]
However, it doesn’t make sense for it to be a pseudo-class either, for the reason I mentioned in my previous message. Therefore, it follows that the only possible solution is nesting if we want this kind of flexibility.
Unless we define the pseudo-class as "where the element starts" and use the existing :page() pseudos [2] for styling the rest of the fragments. But that’s really clumsy.

[1]: http://www.w3.org/TR/selectors4/#pseudo-elements
[2]: http://www.w3.org/TR/css3-gcpm/#selecting-columns-and-pages
Received on Wednesday, 11 September 2013 22:57:00 UTC

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