- From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
- Date: Mon, 25 Oct 2010 21:35:08 -0700
- 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 UTC