W3C home > Mailing lists > Public > www-style@w3.org > February 2013

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

From: François REMY <francois.remy.dev@outlook.com>
Date: Tue, 19 Feb 2013 22:33:22 +0100
Message-ID: <DUB002-W81D58954D47031879E9A53A5F50@phx.gbl>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, "www-style@w3.org" <www-style@w3.org>
> > To me, the best solution is still { var-foo: xyz; var-bar: get(var-foo||fallback); }
> The last thing on earth I want is CCSS: Cryptic Cascading
> StyleSheets. The above is cryptic. I disagree with the proposed
> change.

Thanks for your sincerity. However I have a hard time understanding how "cryptic" the syntax is, especially when you look at the overloaded use of the comma.

    selector {
        var-custom-bgs: url(a), url(b);
        background: var(custom-bgs, url(c), url(d));


    selector {
        var-custom-bgs: url(a), url(b);
        background: get(var-custom-bgs || url(a), url(b));

The double pipe (||) is universally recognized as the 'or' symbol, and this is exactly what it will be used for as most of the times. The 'get' name is really doing just what it's saying it does: getting the value of 'var-custom-bgs' or using 'url(a), url(b)' as a fallback value.

It also solve the issue of this thread (which did come up often: that the same identifier should be used while getting and setting a variable). At the same time, it's not suffering of Tab's issue that it should be clear from the syntax that a variable cannot be used as a property name.

Anyway, I'm not going to enumerate all of the advantages here, I've a better idea than to keep this thread going on and on. I hate feeling stuck in a swamp and I agree with you this thread certainly looks like one. 		 	   		  
Received on Tuesday, 19 February 2013 21:33:50 UTC

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