I finally added function to css-doodle, with the syntax I think is shortest:
--double(x): $(x * 2);
A variable-like structure but with () is treated as a function, Somehow I with CSS supports this natively.
Discussion
I finally added function to css-doodle, with the syntax I think is shortest:
--double(x): $(x * 2);
A variable-like structure but with () is treated as a function, Somehow I with CSS supports this natively.
@cheeaun Yes!
--double(x) is not a valid variable name in CSS though
@yuanchuan the spec requires "dashed-ident" (similar to web components naming somehow), so I guess those without dashes are "reserved" in some way? 🤔
@cheeaun the symbol () is not allowed
@yuanchuan this? https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@function
@function CSS at-rule - CSS | MDNMDNMDNMozilla