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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 24 Feb 2013 10:58:30 -0800
Message-ID: <CAAWBYDB-TAoKKpKPpixhUH1Pgq_pRi0xmAD4bBPX0N13ML6DAg@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: François REMY <francois.remy.dev@outlook.com>, www-style list <www-style@w3.org>
On Sun, Feb 24, 2013 at 6:45 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 24/02/2013 15:12, François REMY a écrit :
>> The reality check is however that it doesn't work very well. Consider:
>>
>>      selector {
>>          var-index: 1;
>>      }
>>
>>      selector {
>>          var-position: attr(data-js-computed-position);
>>          var-position: calc(3 * var(index)) !type(length);
>>      }
>>
>> It's impossible to validate var-position at parse time.
>
>
> I think you’d also need a type constraint on the var-index declaration in
> this example.

No, that wouldn't work - you can't guarantee *which* var-index you'll
get, or even if you'll get one at all.  I don't think you can
type-check a custom property that uses a variable at all.

> But yeah, I see your general point: this mechanism might not be enough,
> short of defining dozens of keywords for all variants of ranges of accepted
> values.

Nah, it's easy.  Just accept all property names, and a handful of
convenience types for common things like "length" and "image".

~TJ
Received on Sunday, 24 February 2013 18:59:17 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:06 GMT