RE: [css3-text-layout] New editor's draft - margin-before/after/start/end etc.

Also sprach Sylvain Galineau:

 > > There are only physical values in my examples. This code:
 > > 
 > >   p { margin: 10px 20px }
 > >   p:lang(ja) {
 > >     writing-mode: tb-rl;
 > >     margin: 20px 10px;
 > >   }
 > > 
 > > illustrates how you can achieve automatic switching of values (as in,
 > > "I'd like 10px margins before and after, and 20px margins at the start
 > > and end") without introducing new properties/values.
 > 
 > I'm still not sure I understand. How margin values are interpreted is already 
 > defined. 

Yes.

 > The 20px part applies to top/bottom while the 10px part applies
 > to right and left.

Only for Japanese text. For other languages, top/bottom margins are
10px and left/right margins are 20px.

 > So if you rotate made top/right/bottom/left for the margin
 > shorthand based on writing-mode, what happens to the longhands e.g.
 > margin-left ?

I don't understand your question. There is no rotation in my examples.
All properties and values stay physical. The example simply set
different values for Japanese and other languages. Written in
longhand, the examples are:

  p { 
     margin-top: 10px;
     margin-right: 20px 
     margin-bottom: 10px;
     margin-left: 20px 
  }

  p:lang(ja) {
     writing-mode: tb-rl;
     margin-top: 20px;
     margin-right: 10px 
     margin-bottom: 20px;
     margin-left: 10px 
  }

 > > So, I'm saying that the problem has a solution today.
 > 
 > Well, yes. IE does this already it can't be bad, right ?

:-)

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Friday, 28 May 2010 18:01:04 UTC