W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: [css3-writing-modes] a third option for implementing logical properties

From: Håkon Wium Lie <howcome@opera.com>
Date: Mon, 25 Oct 2010 00:32:47 +0200
Message-ID: <19652.46095.448940.92473@gargle.gargle.HOWL>
To: David Hyatt <hyatt@apple.com>
Cc: Håkon Wium Lie <howcome@opera.com>, John Daggett <jdaggett@mozilla.com>, "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
Also sprach David Hyatt:

 > What about allowing named sub-blocks within a declaration block?
 > Then everything could cascade properly. Maybe via a new @-rule.
 > @writing-mode p {
 > 	horizontal {
 > 		margin: 1em 0;
 > 	}
 > 	vertical {
 > 		margin: 0 1em;
 > 	}
 > }

Hmm. So, you're branching based on the computed value of
'writing-mode'? In principle, you could use the same syntax for other
properties, e.g.:

  @font-style p {
    italic {
      color: red;
    normal {
      color: blue;

(Not that I would encourage it.)

I'm not sure we need per-element switches, though. I think the use
case is more for different document modes. For example, a button on a
Japanese tablet that toggles between vertical and horizontal layout.
Or for a default style sheet that works both for a latin and
arabic/hebrew. As such, using a media query makes sense -- it would
query which mode the document is in:

@media (dir: ltr) { 
  body { margin: 10px 20px 30px 40px }

@media (dir: rtl) { 
  body { margin: 10px 40px 30px 20px }

 > I understand the desire to avoid an explosion of properties though.

Good :-)

              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Sunday, 24 October 2010 22:33:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:40 UTC