Re: New ::first-page pseudo-element

On Oct 25, 2011, at 8:58 AM, Håkon Wium Lie wrote:

> Michael Day wrote:
> 
>> We've had user requests for the ability to switch from one column layout 
>> on the first page, to two column layout on the second and subsequent pages.
>> 
>> To achieve this we have implemented a new ::first-page pseudo-element, 
>> similar to the existing ::first-line pseudo-element, that can be used to 
>> adjust a subset of CSS properties for an element on the first page that 
>> it appears. 
> 
> This seems like a natural new member in the family of pseudo-elements. 
> 
>> For example:
>> 
>>     div.chapter { columns: 2 }
>>     div.chapter::first-page { columns: 1 }

Why pseudo-elements? Isn't this more like a pseudo-class? The boxes for pages and columns are already generated, so in my mind it's more like you're matching an existing object than creating a new one.

I actually really like the region styling syntax as a way of styling objects differently inside pages, columns or regions. In WebKit I'm wanting to just re-implement pages and columns as special cases of regions, so that everything is just a region.

So the above example could be more like:

@region :nth-page(1)
{
	div.chapter { columns: 2 }
}

Similarly you could have an nth-column pseudo-class as well.

@region :nth-column(3)
{
	div.chapter { background-color: blue; color: white }
}

I just really want to see us have a coherent picture for regions, multi-column and printing. My opinion is that pages and columns should be auto-generated regions created according to the rules of their layout systems, and they should support capabilities like region styling by being addressable via pseudo-element or pseudo-class selectors.

dave
(hyatt@apple.com)

Received on Thursday, 27 October 2011 16:35:49 UTC