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

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

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Tue, 26 Oct 2010 08:38:18 +0200
Message-ID: <FB065110C1404AC98A1B9BE06A3ADBA1@FREMY2>
To: "Andrew Fedoniouk" <news@terrainformatica.com>, <www-style@w3.org>
?The more the things go, the more new use-cases
are found for CSS variables. The only thing for which
we don't find anything about it is a concensus on
the subject :-)

For my part, I see another con for variables, though.

It's that it makes necessary (or at least more important)
to have a "framework" stylesheet which defines the
way an UA should understand the other stylesheets. Until
that file is analyzed, I don't think an UA can parse any
stylesheet properly, which delays the page load.

-----Message d'origine----- 
From: Andrew Fedoniouk 
Sent: Tuesday, October 26, 2010 6:35 AM 
To: www-style@w3.org 
Subject: [css3-writing-modes], option #4, use of CSS constants 

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;

   @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.


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.


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

Hope all of this makes sense.

Andrew Fedoniouk

Received on Tuesday, 26 October 2010 06:38:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:40 UTC