I am trying to figure out Joni Korpi's Frameless CSS frameless grid (http://framelessgrid.com/) and I'm having a hard time reading the .less file he has. I have a basic understanding that LESS uses variables so I know column = 48 and gutter = 24 and that's about it.
Does 1cols = 1 * (48 + 24) - 24)/ 12 ?
What I don't understand is @1col: @1cols;
and .width (@cols:1) {
width: (@cols * (@column + @gutter) - @gutter) / @em;
}
Can anybody help?
https://github.com/jonikorpi/Frameless/blob/master/frameless.less
@font-size: 16; // Your base font-size in pixels
@em: @font-size*1em; // Shorthand for outputting ems, e.g. "12/@em"
@column: 48; // The column-width of your grid in pixels
@gutter: 24; // The gutter-width of your grid in pixels
//
// Column-widths in variables, in ems
//
@1cols: ( 1 * (@column + @gutter) - @gutter) / @em; @1col: @1cols;
@2cols: ( 2 * (@column + @gutter) - @gutter) / @em;
@3cols: ( 3 * (@column + @gutter) - @gutter) / @em;
@4cols: ( 4 * (@column + @gutter) - @gutter) / @em;
@5cols: ( 5 * (@column + @gutter) - @gutter) / @em;
@6cols: ( 6 * (@column + @gutter) - @gutter) / @em;
@7cols: ( 7 * (@column + @gutter) - @gutter) / @em;
@8cols: ( 8 * (@column + @gutter) - @gutter) / @em;
@9cols: ( 9 * (@column + @gutter) - @gutter) / @em;
@10cols: (10 * (@column + @gutter) - @gutter) / @em;
@11cols: (11 * (@column + @gutter) - @gutter) / @em;
@12cols: (12 * (@column + @gutter) - @gutter) / @em;
@13cols: (13 * (@column + @gutter) - @gutter) / @em;
@14cols: (14 * (@column + @gutter) - @gutter) / @em;
@15cols: (15 * (@column + @gutter) - @gutter) / @em;
@16cols: (16 * (@column + @gutter) - @gutter) / @em;
//
// Column-widths in a function, in ems
//
.width (@cols:1) {
width: (@cols * (@column + @gutter) - @gutter) / @em;
}