less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Error evaluating function `darken` using grunt-less

Open mehany opened this issue 9 years ago • 2 comments

I get the following error when i compile bootsrap less files. I am using grunt to run my less task

>> RuntimeError: error evaluating function `darken`: color.toHSL is not a function in src/css/less/bootstrap/variables.less on line 36, column 25:
>> 35 //** Link hover color set via `darken()` function.
>> 36 @link-hover-color:      darken(@link-color, 15%);
>> 37 //** Link hover decoration.

Grunt task

module.exports = {
  development: {
    options: {
    },
    files: { // destination file and source file
      "dist/css/bootstrap/bootstrap.css": "src/css/less/bootstrap/bootstrap.less",
    }
   }
  }
}

when i use the cmd it compiles the files

 lessc src/css/less/bootstrap/bootstrap.less dist/css/bootstrap/bootstrap.css

A similar issue was reported here but it seems to be irrelevant.

The fix I currently have is this, but I think the issue is somewhere else!

@link-hover-color:      darken(#337ab7, 15%);

Is this a grunt issue? a less and grunt issue? Please feel free to ask about my setup if the above is not enough to help

mehany avatar Dec 07 '16 01:12 mehany

The error simply means that a value of the @link-color is not really a color, so just check your code. (Or at least provide more information, otherwise it's just about "some unknown code is not working").

seven-phases-max avatar Dec 07 '16 09:12 seven-phases-max

Closing due to inactivity.

seven-phases-max avatar May 23 '17 16:05 seven-phases-max