Search code examples
csssasscompilationfont-sizescout-sass

Sass + scout variable with em gives 0em


I try to create a variable to content padding of my web site.

$petitPaddingMargin: 0.625em; /* 10/16 */

When I use for exemple :

main{
    padding:$petitPaddingMargin;
}

it render :

main{
    padding:0em;
}

I use scout app for compile my scss file. How can I do to render the good number?


Solution

  • Depending on the version and type of Sass you are compiling with, it doesn't like decimal values and will ignore everything after the period.

    You'll have to write your value like this

    $petitPaddingMargin: 10em / 16;
    

    Source: https://github.com/scout-app/scout-app/issues/111