You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does parsing arbitrary substitution values (var(), attr(), random-item()) has priority over parsing other substitution values (mix() and toggle())?
For example, is animation-duration: mix(50%; invalid; var(--end)) extra valid?
A mix() notation is invalid if it is not the sole value of the property; if either of its <declaration-value>s are invalid when specified as the entire value for the property the function is used in; or if the property using it is not animatable.
If a property contains one or more var() functions, and those functions are syntactically valid, the entire property’s grammar must be assumed to be valid at parse time.
invalid is an invalid value for animation-duration.
And it turns out that it must be different for toggle() (emphasize added):
The toggle() notation is not allowed to be nested; nor may it contain attr() or calc() notations.
edit
I think the text I cited above predates the current definition of attr(), var(), and any other arbitrary substitution value, so it does not mean that toggle() cannot be nested nor may it contain an arbitrary substitution value.
And I missed your point, that arbitrary substitution values like var() should take priority regardless of whether the value is invalid according to the grammar of the property or another substitution value like mix().
And since toggle(red; green) var(--custom) can be valid at computed value time if var(--custom) is substituted with an empty string, you are right.
Does parsing arbitrary substitution values (
var()
,attr()
,random-item()
) has priority over parsing other substitution values (mix()
andtoggle()
)?For example, is
animation-duration: mix(50%; invalid; var(--end)) extra
valid?https://w3c.github.io/csswg-drafts/css-values-4/#interpolate
https://w3c.github.io/csswg-drafts/css-variables-2/#using-variables
The text was updated successfully, but these errors were encountered: