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
    $defaultValue = 100px; // default value
    $randomValue = 120px; // This can be any value
    
    @if ($randomValue > $defaultValue) {
        $defaultValue = $randomValue + $anotherVariable;
    }


    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...♫

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!