Created
June 13, 2014 11:39
-
-
Save pisandelli/2e261d5035719d3a60e0 to your computer and use it in GitHub Desktop.
Generate columns in a grid (12col) using LESS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Colunas Customizadas*/ | |
@list: one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve; | |
.wide.column { | |
.generate-columns(@columns); | |
padding:0 .3125rem; | |
&.floated { | |
&.left { | |
padding-left: 0; | |
} | |
&.right { | |
padding-right: 0; | |
} | |
} | |
} | |
.generate-columns (@n, @i: 1) when (@i =< @n) { | |
@valor: extract(@list, @i); | |
.@{valor}& { | |
width:unit(((@i*100)/@n),%); | |
} | |
.generate-columns(@n, (@i + 1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment