Re: [css3-variables] Fallback vs. "invalid at computed-value time"

On Sat, Feb 23, 2013 at 4:20 PM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 24/02/2013 01:16, Tab Atkins Jr. a écrit :
>> As I said above, implementors purposely didn't want multiple cascaded
>> values, so this is the intended effect for level 1.  It is likely that
>> authors will end up depending on this property, at least accidentally,
>> and so we wont' be able to change it in the future.
>
> That is sad.
>
> Is there an alternative for having similar fallbacks? @supports probably
> works, but it a bit heavy-weight.

Actually, going back to my "typing" idea in my previous message, we
can probably just invalidate the custom property itself, rather than
just make it define an invalid variable.  That way, something like the
following would work (again, purely hypothetical syntax):

var-bg: #333;
var-bg: conic-gradient(...) !type(image);
background: var(bg);

Again, by declaring at parse time how the custom property should be
parsed, we can regain the benefits of the fallback mechanism.  But
this is definitely level 2 stuff.

~TJ

Received on Sunday, 24 February 2013 03:50:57 UTC