Search code examples
ruby-on-railscsslessparse-errorless-rails

Error when using mix function in LESS in rails


Using the less-rails gem.

Using the following code to mix two colours:

@base: #ffdc52;
@add: #195742;
.colour{
    color: mix(@base, @add);
}

getting the following error:

Less::ParseError: error evaluating function `mix`: Cannot read property 'value' of undefined

Solution

  • mix needs three parameters:

    mix: function (color1, color2, weight) {
        var p = weight.value / 100.0;
        ...
    },