dekugrid

multiple implementations of the Deco Grid System  http://limi.net/deco.gs
git clone https://git.ce9e.org/dekugrid.git

commit
00397b09a28f9f52fba1d754b3a86834325be6e7
parent
4bfc8a75d9ff8680b503832920ce1e5e9803b8bb
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-01-16 10:24
add decogrid.less

Diffstat

A decogrid.less 42 ++++++++++++++++++++++++++++++++++++++++++

1 files changed, 42 insertions, 0 deletions


diff --git a/decogrid.less b/decogrid.less

@@ -0,0 +1,42 @@
   -1     1 /* LESS implementation of the Deco Grid System
   -1     2  * For the original, see <http://limi.net/deco.gs>
   -1     3  */
   -1     4 
   -1     5 // Modify these to your needs.
   -1     6 @prefix: escape('');  // e.g. 'deco-'
   -1     7 @cols: 12;
   -1     8 @margin: 2.08333%;
   -1     9 
   -1    10 .@{prefix}row {
   -1    11   float: left;
   -1    12   width: 100%;
   -1    13   display: block;
   -1    14   position: relative;
   -1    15   clear: both;
   -1    16 }
   -1    17 .@{prefix}cell {
   -1    18   position: relative;
   -1    19   float: left;
   -1    20   left: 100%;
   -1    21 }
   -1    22 
   -1    23 // Width mixin.
   -1    24 .width(@n) {
   -1    25   width: @n * (100% + @margin) / @cols - @margin;
   -1    26 }
   -1    27 
   -1    28 // Positioning mixin, this is subtracting from a rightmost
   -1    29 // position, which is why it seem the wrong way around
   -1    30 .position(@n) {
   -1    31   margin-left: -100% + @n * (100% + @margin) / @cols;
   -1    32 }
   -1    33 
   -1    34 // create classes
   -1    35 .loop(@n) when (@n > 0) {
   -1    36   .loop(@n - 1);
   -1    37 
   -1    38   .@{prefix}width-@{n} {.width(@n)}
   -1    39   @nn: @n - 1;
   -1    40   .@{prefix}position-@{nn} {.position(@nn)}
   -1    41 }
   -1    42 .loop(@cols);