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

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
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Sunday, 24 October 2010 22:33:38 UTC