Re: CSS3-box: margin-outside and the cascade

Ian Hickson wrote:
> 
> During the CSSWG meeting last week, David Baron came up with an ingenious
> scheme to solve this. However, the point is pretty moot since, for now, it
> has been decided to drop the BASE (before/after/start/end) properties to
> avoid property glut. (To convert CSS2.1 to BASE would require the addition
> of 34 new properties and 26 new keywords, and CSS3 makes this even worse.)

Quite understandable. But please keep 'text-align' start/end at least.

> The theory goes that in practice, stylesheets written for ltr documents
> don't Just Work for rtl documents as well.

I guess my stylesheets don't count as "in practice", then. *grin*

> FWIW, David's proposal was:
.....
> Then to determine what margin value to use for the left side, you look
> at the relevant *-source property, which would be decided based on the
> 'writing-mode' property (a shorthand which also sets 'direction'). For
> example, in top-to-bottom left-to-right text like English, you look at
> the 'margin-tb-lr-left-source' property, and find it is set to 'start'
> (since the 'margin-start' rule overrode the 'margin-left' rule) and so
> you use 'margin-start-value'. In right-to-left bottom-to-top text, you
> would look at 'margin-rl-tb-left-source', and find that that is set to
> 'left' so you use 'margin-left-value'.
> 
> It's a remarkably neat scheme.

Yes, and easy to use, though looking at the explanation makes me dizzy. :)

I'd be happy with just a "box-flip: directional || none" that makes
left == start, right == end, top == before, and bottom == after. It
avoids having to use a preprocessor or duplication to internationalize
stylesheets.

Could expand that to account for Coises' proposal:

  side-flip,                             - left/right/top/bottom properties
  margin-flip,                           - margin properties
  border-flip,                           - border properties
  padding-flip,                          - padding properties
  box-flip:                              - shortcut affecting all four
            none | (directional || mirror)
                                     \ mirrors left/right margins on even pages
                                      (left/right after directional takes effect)
  initial:  none
  inherited: ?

You can't use this in a UA stylesheet, though.

~fantasai

Received on Monday, 2 September 2002 18:04:28 UTC