I have a SASS variable:
$default-padding: 15px
I want to use this to set a CSS width property using the calc function.
I have various calculations to make based on the value of the $default-padding variable. For Example, the width would be 100% - (2 * $default-padding). As there is padding on the left and on the right.
I am trying to set a local variable (using Bourbon's strip-unit method):
$default-padding-left-and-right: #{(strip-unit($default-padding) * 2)}px;
I would expect the result of this variable to be 30px in this use case, and I want to use it in the following rule:
.popup {
width: calc(100% - #{$default-padding-left-and-right});
}
This doesn't work, the resultant CSS is:
.popup {
width: calc(100% - strip-unit(15px)px);
}
Any ideas what I'm doing wrong?