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

Create function with return value

Open MarianaSilva opened this issue 14 years ago • 2 comments

Hello!

I need to do something like this:

.GetColorByLightness (@color) when (lightness(@color) < 50%) { return #FFFFFF; } .GetColorByLightness (@color) when (lightness(@color) >= 50%) { return #000000; }

body{ color: .GetColorByLightness(#CCC); }

So I need to create a function that I can use to return a value and not an attibute and its value.

Thanks, Mariana Silva

MarianaSilva avatar Jan 31 '12 17:01 MarianaSilva

I've just proposed similar functionality in issue 637.

tylertate avatar Mar 21 '12 13:03 tylertate

going to move discussion over custom functions over to #637 - more comments there.

lukeapage avatar Aug 12 '12 16:08 lukeapage