- From: Håkon Wium Lie <howcome@opera.com>
- Date: Wed, 9 Jun 2010 00:18:29 +0200
- To: MURAKAMI Shinyu <murakami@antenna.co.jp>
- Cc: Hakon Wium Lie <howcome@opera.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, John Daggett <jdaggett@mozilla.com>, Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
Also sprach MURAKAMI Shinyu: > > You can use 3) and 4) to write a default style sheet. E.g.: > > > > h1:lrt, h1:rtl { font-size: 2em; margin: .67em 0 } > > h1:ttb { font-size: 2em; margin: 0 .67em } > > > dir:lrt horizontal writing is supported and @dir has been set to 'lrt' > > dir:rtl horizontal writing is supported and @dir has been set to 'rtl' > > dir:ttb vertial writing is supported and the initial value of > > 'writing-mode' is 'tb-rl' > > See the following example: > > table { writing-mode: lr-tb } > ... > <h1>...</h1> > <table> > ... > <h1>...</h1> > ... > </table> > > When the initial value of 'writing-mode' is 'tb-rl', the h1:ttb > {margin: 0 .67em} is used. It is ok for the first h1, > but the second h1 inside the table, same h1:ttb {margin: 0 .67em} > is used although the writing mode is changed. > The results will be miserable. You just have to provide the values you prefer when switching directions. E.g.: table { writing-mode: lr-tb } table h1, table h2 { margin: ... } Anyway, the values provided in the default style sheet would probably not be correct when switching writing modes. Even in my horizonatal-only world, I tend to start my style sheets with these lines of code: h1, h2, h3, ul, ol, dl, li, blockquote { margin: 0; padding: 0; border: none } just to cleanse the palate. From there, one can easily specify the preferred values. > Another case, when the initial value of 'writing-mode' is 'lr-tb' > and {writing-mode: tb-rl} is specified in the author style sheet, > we expect :ttb { ... } of the default style sheet is enabled, > but the :ttb selector is not affected by the real writing-mode. Correct. Because we cannot make selectors depend on the value of properties. We could make things more automatic if we added a "ttb" value on @dir or some other hint about the preferred direction. But you seem to think this is not a good idea? -h&kon Håkon Wium Lie CTO °þe®ª howcome@opera.com http://people.opera.com/howcome
Received on Tuesday, 8 June 2010 22:19:19 UTC