Re: [csswg-drafts] Proposal: Custom CSS Functions & Mixins (#9350)

> @DarkWiiPlayer 
> is there any real benefit to parametrising mixins when they are used instead of setting custom properties on the element and using those from within the mixin?

The main one is that arguments don't have to be unique. If we have two mixins, where each wants to accept the same-named “variable” `--a`, it will result in a conflict, while if it is passed as an argument, there won't be a name conflict, as we define the arguments inside the mixin call.

An option could be to make all the arguments transparently accept variables, so if you want to pass it explicitly, you'd do it when you call the mixin, otherwise it will fall back to the inherited value of this variable on the element.

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


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

Received on Wednesday, 28 February 2024 08:12:13 UTC