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

[css-variables] cycle() and variables

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 16 Jul 2012 13:46:59 -0400
Message-ID: <50045393.7000003@inkedblade.net>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
On 05/06/2012 10:20 AM, Tab Atkins Jr. wrote:
> On Wed, May 2, 2012 at 9:51 AM, L. David Baron<dbaron@dbaron.org>  wrote:
>> On Wednesday 2012-04-25 08:44 -0700, L. David Baron wrote:
>>> It does solve this case in combination with variables, though, and
>>> I think that's a better solution than making cycle() more complex.
>>> For example:
>>>    table {
>>>      var-cycling-background: cycle(white, gray);
>>>      background: var(cycling-background);
>>>    }
>> Actually, I don't think this works, because the thing that's
>> inherited with variables is syntactic rather than semantic so the
>> cycle() behavior wouldn't get applied until it's used.
> Yup, you're right.  Bad on me for not catching this.
> I see two possible solution, then:
> 1) Go back to the function containing an explicit identifier, and
> selecting the index based on how many ancestors use that identifier,
> or
> 2) Create some way to force variable evaluation.  You'd need to supply
> a property context somehow.

You could define that certain global functions within variables are
evaluated at computed value time on the variable, e.g. cycle() might be
more useful in general if it's operating at that level than when expanded.
attr() is another interesting case in this respect: you might want an
attr() function that evaluates where the variable is declared.

Received on Monday, 16 July 2012 17:47:36 UTC

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