Search code examples
sasscompass-sass

Subtraction not working in compass scss


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?


Solution

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

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