Re: [csswg-drafts] [css-mixins] custom mixins & functions should have some access to custom properties on the calling element. How much? (#9938)

I think this needs to be discussed separately for mixins vs functions, since their use cases are different. While it could be argued both ways for both, I think the need for dynamic scope is higher with mixins.

Also, I do think there is a fundamental difference between incidental variables that happen to be defined somewhere in a subtree, and a website’s design system (typically defined in the `:root`): fonts, colors, spacings etc. I really hope mixins can have access to those without every mixin having to explicitly define dozens or even hundreds of properties in a `using` clause, which would render them practically unusable. 

We might want to consider a syntax that allows access to many properties en masse, that might make `using` more palatable, e.g. `--color-*` for all variables prefixed `--color-`, `--icon-*`, `--font-*` etc.,. And if we allow `--*` too, authors could opt-in to all custom variables on a case by case basis, rendering these debates moot. 🙂

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


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

Received on Friday, 23 February 2024 18:35:50 UTC