W3C home > Mailing lists > Public > www-style@w3.org > October 2010

[css3-writing-modes], option #4, use of CSS constants

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Mon, 25 Oct 2010 21:35:08 -0700
Message-ID: <BAY141-DS589563A4593DC2E9C7705F8420@phx.gbl>
To: <www-style@w3.org>
CSS constants is a generic way of adding "virtual properties and values".

So if we would have CSS constants then anyone will able to declare 
the following:

@media writing-direction(ttb)
{
   @const margin-start: margin-top;
   @const margin-end: margin-bottom;
}
@media writing-direction(ltr)
{
   @const margin-start: margin-left;
   @const margin-end: margin-right;
}
@media writing-direction(rtl)
{
   @const margin-start: margin-right;
   @const margin-end: margin-left;
}

div 
{
   @margin-start: 20px; /* declaration of 'logical' properties */
   @margin-end: 10px;
}

constants in CSS have its own value and are useful in many 
other cases too.

Pros:

1) Given option does not require creation of any new attributes.
@margin-start and @margin-end are just "conditional aliases" of
margin-left and margin-right. 

2) We don't need to worry in the spec about particular names -
authors may choose anything they like.

3) This will support any other forms of "property virtualization",
even those we don't know yet.

3) @const's are very useful by themselves.

Contras:

1) @const'ants need to be added to CSS.


Hope all of this makes sense.

-- 
Andrew Fedoniouk

http://terrainformatica.com
 
Received on Tuesday, 26 October 2010 04:35:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:33 GMT