Re: [csswg-drafts] [css-values] Short-circuit if() evaluation (#11500)

@Loirooriol 

Assuming that you would have written, say, `if(t1: --expensive(); t2: v2)`, then pulling out the entire first clause into `--whole-clause: t1: --expensive();` means we evaluate `--expensive()` as part of resolving `--whole-clause`'s value. You don't leave substitution functions unevaluated.

@kizu 
> Note the “including in the fallback argument”.

Yeah, we'd *ideally* like to change that. ^_^ Since we're doing `if()`, all the use-cases in that post are subsumed with a *proper* tool rather than a clever hack. But web compat might prevent us from doing it, so `var()` would still eagerly evaluate its fallback.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 13 February 2025 22:10:30 UTC