Re: background-position and bidi in CSS 2.1

Daniel Glazman wrote:
> 
> Andrew Fedoniouk wrote:
> 
>> I've tried. That created significantly more problems than solutions.
>> Anyway in most cases you even cannot reuse the same image for rtl
>> case - it needs to be changed.
>>
>> In my opinion for RTL support in CSS significantly more valuable
>> would be an introduction of :rtl pseudo-class. It is "on" when
>> nearest container of the element with dir attribute has value of the
>> dir attribute equal to "rtl".
> 
> Yes but it does not solve the problem I detailed. Background
> positioning in currently significantly weaker in rtl.

The solution is to introduce the way to define background-position
origins using right and bottom sides.

This makes sense not only for RTL but is very useful in general.
Take a look here:
http://www.terrainformatica.com/w3/sub-menu.png
Note the menu item with arrow that is defined in
markup as:
<menu>... <li>Third item ....</li></menu>
That arrow image has to be positioned with 4px shift from
the *right* side in *LTR* environment and with 4px shift
from the *left* side in RTL. Image by itself has to be
changed too.

Thus having background-position-right/bottom *and* the :rtl
pseudo-class:

1) will allow you to support RTL in background images;
2) will allow to define background image positions better
    for all other cases;
3) will eliminate need of introduction of bunch of
    margin-start/end, etc. attributes.

start/end values for image positions you propose fix particular
problem but not the case I've described above.


-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Sunday, 14 December 2008 19:24:48 UTC