Closed wc-matteo closed 8 years ago
these are two issues in one.
-
to the beginning of a function name is actually renaming the function to call.
margin: -ms(1)rem
is equivalent to saying margin: hamsandwich-ms(1)rem
Thank you for your answer.
A work around would be to add the step you want as a negative value in the scale itself.
And how would I do that? Currently, I'm binding the scale to some CSS vars (i.e. --ms1, --ms2, etc.).
I don't get the 'rename function to call with -
' bit...
First, is it so according to the CSS spec or PostCSS? And second, are you saying that the character -
and every character before it is effectively ignored from the parser when determining a function name? If so, what's the point?
Anyway, the PostcSS processor for var()
supports the minus in front of it just fine.
I think this issue is an important one to solve; consequently, it should stay open.
Just as an example: when using columns with padding
and box-sizing: border-box
, you'll usually want to apply a negative margin equal to column padding
to the container.
As an aside, I read that you were against a default unit for ms()
. I found that rem
is the default though; what made you change your mind?
Input
margin: 0 -ms(1)rem;
Output
margin: 0 1rem;
Expected
margin: 0 -1rem;
Even worse:
Input
margin: 0 -ms(1)rem -ms(1)rem;
Output
margin: 0 -ms(1;
Expected
margin: 0 -1rem -1rem;