I need to define a width in my SCSS code as so:
#example { width: $currentWidth + 349 !important; }
Where $currentWidth
is defined by the loop.
However, Sass always ends up concatenating the two numbers instead of doing the arithmetic.
I have also tried:
width: #{$currentWidth + 349}px !important;
Which still results in concatenation.
I'm wondering what I'm doing wrong? I know this is incredibly basic, but I also can't seem to find good information on how Sass handles arithmetic
Assuming $currentWidth
is an integer.
SASS:
$currentWidth: 30; #example { width: unquote( ($currentWidth + 349) + 'px ' + !important ); }
CSS OUTPUT:
#example { width: 379px !important; }
You can test it here:
http://sass-lang.com/try.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With