Do we really want functions in CSS? I guess that ship has sailed a while ago, since CSS reached Turing completeness.
/* Define a function: */
@function --gradient-to-transparent(--color, --direction: bottom) {
result: linear-gradient(
to var(--direction),
var(--color),
transparent;
);
}
Why not provide better integration with JavaScript, to make this kind of acrobatics unnecessary.
Because JavaScript requires… a lot. A virtual machine, script parsing, etc. Making that a requirement before you even display any content on the page would be a regression.