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

> would it help if they just used a different syntax so they couldn't easily be confused?

I really liked the idea to recall the arguments via `arg(--foo)` — this way they won't conflict with the variables. Also: what if by separating them and making sure arguments resolve before variables, we could allow doing things like `var(arg(--foo))`? Was dreaming about something like this for a while.

Kinda related to this, 

> 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. 🙂

Other than conditions, a thing to really consider when talking about mixins and functions is an ability to retrieve values from lists and maps. If there was an ability to define all the tokens as a single (or several) map or record, the downsides for the `using` could be much smaller, as you could just put the whole map there (even though I still not sure if there is any _use_ for it).

-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9938#issuecomment-1961826630 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:49:16 UTC