Re: [css-houdini-drafts] [css-properties-values-api] Substituting registered properties with var()

> (nit: as of TPAC, unregistered properties are substituted as 
strings, not lists of tokens).

No, this is inaccurate. (It would be *crazy wrong* taken literally as 
you said.) Untyped properties have their values *preserved* as literal
 strings, such that their serialization is identical to their input.  
They're definitely *substituted* as token streams, tho; otherwise you 
get very quirky parsing things where a single token can span across 
two var() substitutions.

Typed properties actually have typed values, tho, and get substituted 
as such. So your first and second examples should both be errors 
(height doesn't take numbers, animation-name doesn't take colors), 
your third should work as long as it's a correct number of lengths, 
and your fourth is fine.

The problem of url() resolution changing when the custom property 
switches from untyped to typed has already been brought up, and 
there's no good solution.  I think the naive answer (typed properties 
resolve based on the sheet they show up in, just like any other 
property taking a url) is obviously correct; anything else means that 
typed custom properties have subtle (read: likely to cause bugs) 
differences from built-in properties.  There's some potential bugs if 
people switch from untyped to typed, but that should hopefully go away
 as usage becomes greater.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at 
https://github.com/w3c/css-houdini-drafts/issues/321#issuecomment-252099356
 using your GitHub account

Received on Thursday, 6 October 2016 21:51:57 UTC