Re: [csswg-drafts] [css-mixins] Improve ergonomics of `using` by allowing wildcards (#10954)

I don't think what we decide here has any relevance for closures later, actually. Functions as we're defining them simply *do not have a meaningful lexical scope* - they're defined at the stylesheet level, which doesn't contain anything except global state; importantly it doesn't contain *any* custom properties. So all non-global references *must* be either lexical *from arguments*, or dynamic from the calling environment (the element the value is being set on); that's the only choice.

If we ever introduced closures (property-level function definitions, rather than global), we could, if we chose, distinguish between lexical variables (drawn from the element the function was defined on) and dynamic (drawn from the element the function is executed on). I imagine we'd reuse this `using` syntax, then, to specify values that are captured at definition time, and everything else (arguments, and any unspecified variables) take from the calling context, as global functions do.

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


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

Received on Thursday, 24 October 2024 23:05:22 UTC