Re: [css3-writing-modes] Keyword alternatives to "logical"

David Hyatt <hyatt@apple.com> wrote on 2010/10/28 6:19:19
> On Oct 27, 2010, at 3:29 PM, MURAKAMI Shinyu wrote:
> 
> > 
> >    margin-top:    [before|end|after|start]? <margin-width>
> >    margin-right:  [before|end|after|start|outside|inside]? <margin-width>
> >    margin-bottom: [before|end|after|start]? <margin-width>
> >    margin-left:   [before|end|after|start|outside|inside]? <margin-width>
> > 
> 
> I really don't like adding logical keywords to properties that have physical names.  That just doesn't make any sense.
> 
> The reason logical keywords work nicely with shorthands like "margin" or "border-style" is that no directionality was implied by the name of the property.
> 

I understand.
I wrote in <http://lists.w3.org/Archives/Public/www-style/2010Oct/0775.html>:

 The shorthand syntax will be:

     margin: [beas|tobi]? && <margin-width>{1,4}
         | [before|end|after|start|outside|inside] <margin-width>

 The question is the timing of the logical (BEAS) to physical (TRBL)
 mapping using the computed values of writing mode properties.

 One idea is to define the "beas" notation as "direction dependent shorthand"
  (similar to "direction dependent aliases" the current editor's draft's
 logical properties are) and the mapping occur when shorthand resolving.


e.g., shorthand 'margin: start 1em' is resolved to 'margin-right: 1em' when direction is RTL.



If this "direction dependent shorthand" idea is not good, and adding many new properties is also not good, the remaining way will be to reuse existing properties with adding some keyword(s) to their value definition. e.g.,:

    margin-top:    beas? <margin-width>
    margin-right:  [beas|tobi]? <margin-width>
    margin-bottom: beas? <margin-width>
    margin-left:   [beas|tobi]? <margin-width>

And the shorthands are:
    margin: before <margin-width> => margin-top:    beas <margin-width>
    margin: end <margin-width>    => margin-right:  beas <margin-width>
    margin: after <margin-width>  => margin-bottom: beas <margin-width>
    margin: start <margin-width>  => margin-left:   beas <margin-width>
    margin: outside <margin-width> => margin-right: tobi <margin-width>
    margin: inside <margin-width>  => margin-left:  tobi <margin-width>
    margin: beas <margin-width>{1,4} => margin-top/right/bottom/left: beas <margin-width>
    margin: tobi <margin-width>{1,4} => margin-top/right/bottom/left: tobi <margin-width>

(The "beas" flag will disappear in the computed values, but the "tobi" will remain for inside/outside.)


-- 
MURAKAMI Shinyu
http://twitter.com/MurakamiShinyu
Antenna House Formatter:
http://www.antennahouse.com

Received on Thursday, 28 October 2010 05:21:49 UTC