W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: [css-variables] Different syntax for variable definition and use

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Wed, 29 Aug 2012 00:33:11 +0200
Message-ID: <EB17F826ABE84855A009E95B36E24355@FREMYD2>
To: "Jens O. Meiert" <jens@meiert.com>, <www-style@w3.org>
|  What is the benefit in declaring and using variables—the same
|  variables—in such different ways? Are we not contracting a serious
|  “development usability” problem?
|
|  Why does the variable name need to be part of the declaration?

You're not alone worrying about this (and other things). The fact is, 
however, that most CSS WG members dropped the ball on [css-variables]'s 
syntax and decided to concentrate on features exclusively, and I continue to 
fear that the current state of the specification will lead to its 
'dissolution' (aka restrict its use as a 'hack' to solve other css problems, 
instead of an innovative css thing).

Meanwhile, valid concerns hinder the use of $ as a token for "CSS Variables" 
(aka custom properties). I proposed other solutions and invited more people 
to propose alternatives, but it seems like few people are interested by the 
subject anymore... most are simply bored to be ignored, or they fear to 
enter an 'endless' discussion. Or something else, I don't know.

BTW, while I am at it, what would you think of my latest proposal?

    html {
        my-link-color: blue;
        my-link-hover-color: red;
        my-link-decoration: underline;
    }

    .hidden-links {
        my-link-color: inherit;
        my-link-hover-color: blue;
        my-link-decoration: none;
    }

    a {
        color: self.my-link-color;
        text-decoration: self.my-link-decoration;
    }

    a:hover {
        color: self.my-link-hover-color;
    }

    /* variations includes:

            self.property :
                specified property value, inherited valud, or invalid

            declared.property :
                specified property value, or invalid

            parent.property :
                like self.property, but in the scope of the parent element

    */

Regards,
François 
Received on Tuesday, 28 August 2012 22:33:27 GMT

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