Re: [css-variables] Is making a property negative via `-var(--width)` valid syntax?

On Fri, 2015-12-18 at 14:57 +0100, Simon Pieters wrote:
> 
[...]
> Yeah, that is a risk (hence "slippery slope"), but what other
> function would you want to negate, in practice?

sin(), cos(), sqrt(), atan(), min(), max(), log(), exp(), width-of(),
sock-size()... and of course nested calls to calc(). OK, these aren't
things you see in CSS that much today, but with transform() the trig
functions are suddenly a lot more useful...

If I define -liam-sock-size() as returning an integer, will I be able
to write --liam-sock-size()?

If conditionals were introduced as if(test, true-part, false-part)
people would want to write -if() too. And of course +calc() and +var()
should work too. But then why not
    max-width: 3em - 2px;
if -var() works?

Better to require the space than start special-casing things. Although
you could reasonably argue - is already special-cased, unfortunately,
but it's a single special case.

Liam

Received on Friday, 18 December 2015 22:48:37 UTC