Subtraction not working in compass scss

locrizak picture locrizak · Nov 3, 2011 · Viewed 14.2k times · Source

While ive been loving compass, I just ran to a confusing issue. I'm trying to subtract one from a value like this:

padding-left:($top-bar-padding*4)-1;
padding-left:($top-bar-padding*4-1);
padding-left:($top-bar-padding*4)-1px;
padding-left:($top-bar-padding*4-1px);

I've tried all of those and they all give me:

padding-left: 20px -1px;

It really puzzling me because I have this earlier in the .scss file and it is working fine:

padding:$top-bar-padding*2+2 $top-bar-padding*4;

Any insights on why this is happening?

Answer

locrizak picture locrizak · May 23, 2012

You need to have a space before and after the subtraction symbol like this:

($top-bar-padding*4 - 1)