Iterations in Less

Posted on December 11, 2012 by

Part of the beauty of Less and other CSS ‘compilers’ is to enable the author to automate tedious functions that normally must be coded by hand. Suppose you needed several classes that specified padding/margins: .mRight50{margin-right:50px} .mLeft50{margin-left:50px} .pRight50{padding-right:50px} .pLeft50{padding-left:50px} .mRight25{margin-right:25px} .mLeft25{margin-left:25px} .pRight25{padding-right:25px} .pLeft25{padding-left:25px} No big deal, right? It wouldn’t take that long to type in; just […]