- From: Håkon Wium Lie <howcome@opera.com>
- Date: Wed, 9 Jul 2008 14:48:26 +0200
- To: fantasai <fantasai.lists@inkedblade.net>
- Cc: www-style@w3.org
Also sprach fantasai: > > div.chapter { page: chapter } > > h2 { string-set: title content() } > > @page chapter:left { @top-left { content: string(title) }} > > @page chapter:first { @top-left { content: none }} > > > > This code feels right to me, but it wouldn't work as long as 'page' is > > inherited (because 'chapter:first' in practice would match all pages). > > It looks very elegant, but it's not backwards compatible. :( > :first right now is defined to only apply to the first page of the > document. CSS 2.1 says that 'Authors may also specify style for the first page of a document with the :first pseudo-class' [1]: @page :first { ... } However, CSS 2.1 doesn't describe the behavior when :first is combined with a page name, e.g.: @page chapter:first { ... } So, I think CSS3 is free to define what this should mean. The current WD [2] even includes syntax examples (in example V and VI) that combines these: @page CompanyLetterHead:first { ... } /* identifier and pseudo page. */ @page artsy:first { } /* f=1 g=1 h=0 -> specificity = 110 */ It wouldn't make much sense to have them there if any use of :first is limited to the first page in the document. Therefore, I suggest that we explicitly state that :first can have effect on other pages as well. However, unless we change 'page' from being inherited to being non-inherited, this feature would be useless; in practice the :first would apply to all pages. Therefore, I also suggest that we change 'page' from being inherited to not being inherited. I don't think the change would affect any documents in the wild. [1] http://www.w3.org/TR/CSS21/page.html#page-selectors [2] http://www.w3.org/TR/2006/WD-css3-page-20061010 -h&kon Håkon Wium Lie CTO °þe®ª howcome@opera.com http://people.opera.com/howcome
Received on Wednesday, 9 July 2008 12:49:15 UTC