cloudhead/less.js — Issue #521: feature suggestion
Author: madevelopers
Created: 2011-12-14 03:59:07+00:00
State: open

I would suggest that less should support conditions and ternary operator and js like arguments (e.g. @arguments.param org @arguments[0]). I had this mixin to assign heading fonts. what I want here is to have a second optional lineHeight argument.

@__baseFontSize	: 16;
@__baseLineHeight	: 1.5;
@__theMagicNumber	: @__baseFontSize * @__baseLineHeight;

.headingFont ( @increment ) {
@addedSize	: @__baseFontSize + @increment;
@newSize	: @addedSize / @__baseFontSize;

font-size: 1em * @newSize;
line-height: @__theMagicNumber / @addedSize;
}

/**** so I like to have a code like this ***/

.headingFont ( @increment ) {
@addedSize	: @__baseFontSize + @increment;
@newSize	: @addedSize / @__baseFontSize;

/** something like this line **/
@lineHeight : @arguments.lineHeight || @__theMagicNumber / @addedSize;

font-size: 1em * @newSize;
line-height: @lineHeight;
}

so the broader picture is to have some native javascript inside of your less stylesheet.