0

I am doing some calculations with in my mixins and need to return a value in %.

@include breakpoint(sm) {
    padding-left: ($content-block) + %;
    padding-right: ($content-block) + %;
}

This is supposed to return 10% but when running Compass, I get the following error:

error scss/main.scss (Line 265 of scss/_mixins.scss: Invalid CSS after "...l ox--xs) + ": expected expression (e.g. 1px, bold), was "%;")

Any idea on how to make this work?

  • To add a unit to a number, do something like this: `padding-left: ($content-block) * 1%;`. https://stackoverflow.com/a/13905609/3469273 – mfluehr Jul 15 '19 at 16:55
  • Possible duplicate of [Append unit type to the result of a calculation](https://stackoverflow.com/questions/13905407/append-unit-type-to-the-result-of-a-calculation) – mfluehr Jul 15 '19 at 16:55

0 Answers0