W3C home > Mailing lists > Public > www-style@w3.org > March 2008

[CSS3] ltr and rtl pseudo-class proposal

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 13 Mar 2008 20:07:03 -0700
Message-ID: <47D9EBD7.4030508@terrainformatica.com>
To: www-style@w3.org

I propose to add :ltr and :rtl pseudo classes to the Selector module.

These classes reflect value of nearest element with defined @dir 
attribute in child/parent chain of the element.

So if someone will define:
<body dir=rtl>
   ...
   <ul dir=ltr>
     <li>Some text</li>
   </ul>
</body>

then li element here can be styled appropriately:

li:rtl { padding-left: 0; padding-right: 10px;}
li:ltr { padding-left: 10px; padding-right: 0;}

The problem is that attribute selector [dir=rtl|ltr] tests
only the element itself but not its environment (parent chain).

Selectors like these:

  *[dir="ltr"] li,
  *[dir="rtl"] li { .... }

and their variations are not quite working for the markup above.

Or is there a better (e.g. more generic) way of achieving this?

(And yes, the same thing for ttb/btt values)

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Friday, 14 March 2008 03:07:46 GMT

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