Feature summary (what you would like to be able to do and where):
I'd like to be able to use constructs like calc( var( --foo, 2px ) + 1px) inside template styles.
To clarify, i am only proposing being able to use css variables in calc(). My idea is that they would be set in inline styles as part of template parameters and not in templatestyles.
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I was writing a complex template involving css animations. I wanted the start point of the animation to be a parameter to the template. I had to make a lot of rules for potential common parameter values. It would be nice if i could just write in the template <div style="--start: {{{start|123}}}"> rest of template </div> and use that in template styles instead of setting a different class for each possible parameter and having separate rules.
To make it concrete: https://commons.wikimedia.org/wiki/Template:Cubemap_player is the template.
https://commons.wikimedia.org/wiki/Special:PrefixIndex/Template:Cubemap_player is all the different css i had to write to make it semi-parameterized.
Benefits (why should this be implemented?):
I believe this provides 95% of the benefits of T200632 without the concerns Tim raised in T200632#10594645 . Calc() would force this to be limited to just numeric and dimensional values (and technically relative colours). You wouldn't be able to use idents, strings etc. You could maybe use numeric functions in it, but that seems a much lower surface area. I think its unlikely that css would introduce a numeric valued function that is a security concern.
At the same time i think this covers most parameterization needs. Ident values tend to be a limited set of values that dont really need to be parameterized. Other than colours i suspect the vast majority of parameterized values will be numbers or dimensional.
For reference: https://developer.mozilla.org/en-US/docs/Web/CSS/calc