W3C home > Mailing lists > Public > www-style@w3.org > September 2002

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

From: fantasai <fantasai@escape.com>
Date: Mon, 02 Sep 2002 18:08:28 -0400
Message-ID: <3D73E15C.107C373B@escape.com>
To: www-style@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:16 GMT