Closed happyhunter7 closed 2 years ago
Ended up using modifyVars feature and now it works)))
A bit late but for anyone who's still looking for a solution for this, you need to construct a new Color
instance.
return new less.tree.Color(preparedColor, 1, originalColor);
To reproduce: I created a super simple plugin (getColor) that accepts an argument and returns the color of that argument. Everything works fine (The css is generated correctly and the plugin work)
But IF I'm trying to use the value (the color) returned by the plugin in some functions like
fade(...)
or other built-in Less functions it throws an error:Thats how I'm using it in Less file
Thats the plugin file content // ./getColor.js
Current behavior:
Throws and error and say that the color is not valid only when used in built-in functions like
fade(...)
. But if to use the result of the plugin function withoutfade()
the resulted CSS will be correct and the output too thats strange)Expected behavior:
Environment information:
Being hones I spent already 2 days understanding how I should return something from a plugin firstly I encountered this error when I was returning the raw value directly as a string "#ccc" That also doesn't work....Then I noticed somewhere in docs that I need to return these values using
less.tree.Color
but that also doesn't work...pls help(