Source

elbee-elgee / layouts / less / master.less

Full commit
/* Set width, fall back to a default if none specified */
.setwidth(@width, @defaultw) when (isnumber(@width)){
	width: @width;
}
.setwidth(@width, @defaultw) when not(isnumber(@width)){
	width: @defaultw;
}

.setmargins(@margins, @default) when (isnumber(@margins)){
	margin: @margins;
}
.setmargins(@margins, @default) when not (isnumber(@margins)){
	margin: @default;
}
.setmargins(@marginp, @margins, @default) when (isnumber(@marginp)) and (isnumber(@margins)){
	margin: 0 @marginp 0 @margins;
}
.setmargins(@marginp, @margins, @default) when not (isnumber(@marginp)) and not (isnumber(@margins)){
	margin: @default;
}

/* Specify left margin, fall back to a default. */
.marginl(@margin, @default) when (isnumber(@margin)){
	margin-left: @margin;
}
.marginl(@margin, @default) when not (isnumber(@margin)){
	margin-left: @default;
}

/* Specify right margin, fall back to a default. */
.marginr(@margin, @default) when (isnumber(@margin)){
	margin-right: @margin;
}
.marginr(@margin, @default) when not (isnumber(margin)){
	margin-right: @default;
}

.lbmargin(@margin, @default) when (isnumber(@margin)){
	margin: 0 @margin;
}
.lbmargin(@margin, @default) when not (isnumber(@margin)){
	margin: 0 @default;
}

/* Select a layout, fall back to a default if none specified */
.layout(@layout) when (isstring(@layout)){
	@import @layout;
}
.layout(@layout) when not (isstring(@layout)){
	@import "2-columns-fixed-sb-right.less";
}
.layout(@layout);