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

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 UTC