SCSS conditionals

  • Hello everybody,


    I'm creating a style and I'd like to compare 2 variables, I don't how to do it and all my attempts have produced an error. I'm not sure about the syntax either:


    CSS
    1. $defaultValue = 100px; // default value
    2. $randomValue = 120px; // This can be any value
    3. @if ($randomValue > $defaultValue) {
    4. $defaultValue = $randomValue + $anotherVariable;
    5. }


    Regards

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • Solved by using colon : instead of equal sign = to assign the new value to the variable.

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫