Re: [css3-page][css3-mediaqueries] Changing element styles on page breaks (was: Page size conflicts)

Le 21/02/2012 01:44, Simon Sapin a écrit :
> I first thought this was a loophole due to unforeseen interactions
> between the 'size' property and media queries. But if this is a feature
> we want, the behavior need to be spec’ed much more precisely.

If styling elements differently on different pages is a feature, going 
through media queries to do it is quite contrived. I can already see 
authors doing this:

     @page { size: 210mm 297mm }
     h1 { page: chapter-title }
     /* I don’t really want to change the page size */
     @page chapter-title { size: 209.99mm 297mm }
     @media print and (width: 209.99mm) {
         p { /* Style for text on first page of the chapter */ }
     }

Why not go all the way and allow full element selectors in @page?

     @page { size: 210mm 297mm }
     h1 { page: chapter-title }
     @page chapter-title {
         p { /* Style for text on first page of the chapter */ }
     }

The semantics would be similar to regions, but there is a syntax problem 
to disambiguate @page properties and type selectors.

This is a big feature, and I wouldn’t want it to delay what is already 
in css3-page (especially margin boxes.) So how about this keeping full 
selectors for level 4? In that case, I’m not sure how should level 3 
behave for "changing" media queries...

Regards,
-- 
Simon Sapin

Received on Tuesday, 21 February 2012 02:11:27 UTC