W3C home > Mailing lists > Public > www-style@w3.org > November 2014

Re: Proposal : Adding an "opposite" value to "text-align" property

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 3 Nov 2014 11:00:05 -0800
Message-ID: <CAAWBYDCmc=5ncoNAvCwDXcdbHwpma9J_JZJ4C_vmNC_+Sixosw@mail.gmail.com>
To: "Aharon (Vladimir) Lanin" <aharon@google.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, Jean-Baptiste Cordina <jbcordina@gmail.com>, W3C style mailing list <www-style@w3.org>
On Mon, Nov 3, 2014 at 10:46 AM, Aharon (Vladimir) Lanin
<aharon@google.com> wrote:
> The use case for text-align: opposite seems to be dealing with RTL
> languages. Given the availability of text-align: start and text-align: end,
> I don't understand the need for opposite.

To be more specific, just rewrite the original example:

>> > my-component {
>> > text-align : left;
>> > }
>> >
>> > [dir=rtl] my-component {
>> > text-align: right;
>> > }
>> >
>> > my-component .read-more {
>> > text-align : opposite; // if parent has text-align: left then opposite =
>> > right else if parent has text-align: right the opposite = left
>> > }

into:

my-component {
  text-align: start;
}

my-component .read-more {
  text-align: end;
}

~TJ
Received on Monday, 3 November 2014 19:00:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:26 UTC