Open
Description
@kizu pointed out that the following behavior is surprising:
@function --f(--arg <color>) {
result: if(
style(--arg: red): green;
else: black;
);
}
/* --f(#f00) => black*/
At the time if()
is resolved, we are treating --arg
as an untyped local (step 11 of evaluate a custom function), which means we don't interpret the right hand side of style(--arg: red)
as a <color>
, and therefore rgb(255, 0, 0)
!= red
.
Grouping parameters in with (untyped) locals seemed reasonable to me originally, but given the example, I think --arg <color>
should act as a "local registration" within the function (also affecting any locals named --arg
). @tabatkins, @mirisuzanne: what do you think?