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

Hm, if we go with "it's just a declaration list, that only accepts custom properties", maybe it would be more sensible then to make the return value a (non-dashed) property as well:

```css
@function --foo(--arg1: 1) {
  --arg2: sin(var(--arg1));
  --arg1: 2;
  return: calc(var(--arg1) + var(--arg2));
}
```

The syntax is straightforward, then, and it automatically suggests how it works to have multiple instances of it - the last valid one wins. And if you've provided a return type, we can parse that value and properly reject unknown things, so you can use CSS's normal fallback rules to use new features when they exist and fall back to older stuff otherwise.

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


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

Received on Tuesday, 6 February 2024 17:55:04 UTC