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

Most functions in CSS will probably be simple and not use the parameters passed to them many times. Therefore, I think it would be fine to reference them by index number in a special array-like function, `arg()`. 
If authors want to have names parameters or default values they can still have them with normal custom properties. 

~~~~ css
@function --distance() {
--start: arg(1);
--end:   arg(2, 0px);
  value: 0px; /* default */
  value: abs(var(--start) - var(--end));
}
~~~~


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


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

Received on Friday, 9 February 2024 20:36:14 UTC