diff --git a/README.md b/README.md index 45c4999..5412799 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gridlex ## Just a Flexbox Grid System -v. 2.0.2 +v. 2.0.3 The concept is simple: you need to wrap your `.col` in a `.grid`. diff --git a/bower.json b/bower.json index 386ee21..db39a34 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gridlex", - "version": "2.0.2", + "version": "2.0.3", "description": "Just a Flexbox Grid System", "repository": { "type": "git", diff --git a/dist/cards.html b/dist/cards.html index b4d006a..5df74cc 100644 --- a/dist/cards.html +++ b/dist/cards.html @@ -109,7 +109,7 @@

Gridlex

-

Just a Flexbox Grid System
(v2.0.1)

+

Just a Flexbox Grid System
(v2.0.3)

diff --git a/dist/demo/demo.less b/dist/demo/demo.less index 7efb0e3..520ec22 100644 --- a/dist/demo/demo.less +++ b/dist/demo/demo.less @@ -159,7 +159,7 @@ pre { .demo p { margin: 0; padding: 1rem; - @media @xs{ + @media @gl-xs{ padding: .5rem; } } @@ -191,7 +191,7 @@ section:not(:first-of-type){ content: attr(class); padding: 2px 8px; position: absolute; - left: @gutter; + left: @gl-gutter; top: 0; white-space: nowrap; z-index: 20; diff --git a/dist/index.html b/dist/index.html index d95fbe2..ddde53e 100644 --- a/dist/index.html +++ b/dist/index.html @@ -25,7 +25,7 @@

Gridlex

-

Just a Flexbox Grid System
(v2.0.2)

+

Just a Flexbox Grid System
(v2.0.3)

diff --git a/package.json b/package.json index dcb6089..785df7f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Just a Flexbox Grid System", "url": "https://github.com/devlint/gridlex", "author": "https://github.com/devlint", - "version": "2.0.2", + "version": "2.0.3", "repository": { "type": "git", "url": "git@github.com:devlint/gridlex.git" diff --git a/src/gridlex-vars.less b/src/gridlex-vars.less index 9af1c74..0cec185 100644 --- a/src/gridlex-vars.less +++ b/src/gridlex-vars.less @@ -1,64 +1,64 @@ //************************ // VARIABLES //************************ -@gutter: .5rem; +@gl-gutter: .5rem; -@xs: ~"screen and (max-width: 35.5em)"; // up to 568px -@sm: ~"screen and (max-width: 48em)"; // max 768px -@md: ~"screen and (max-width: 64em)"; // max 1024px -@lg: ~"screen and (max-width: 80em)"; // max 1280px +@gl-xs: ~"screen and (max-width: 35.5em)"; // up to 568px +@gl-sm: ~"screen and (max-width: 48em)"; // max 768px +@gl-md: ~"screen and (max-width: 64em)"; // max 1024px +@gl-lg: ~"screen and (max-width: 80em)"; // max 1280px -@col-1: (100%/12); -@col-2: (@col-1*2); -@col-3: (@col-1*3); -@col-4: (@col-1*4); -@col-5: (@col-1*5); -@col-6: (@col-1*6); -@col-7: (@col-1*7); -@col-8: (@col-1*8); -@col-9: (@col-1*9); -@col-10: (@col-1*10); -@col-11: (@col-1*11); -@col-12: 100%; +@glp_col-1: (100%/12); +@glp_col-2: (@glp_col-1*2); +@glp_col-3: (@glp_col-1*3); +@glp_col-4: (@glp_col-1*4); +@glp_col-5: (@glp_col-1*5); +@glp_col-6: (@glp_col-1*6); +@glp_col-7: (@glp_col-1*7); +@glp_col-8: (@glp_col-1*8); +@glp_col-9: (@glp_col-1*9); +@glp_col-10: (@glp_col-1*10); +@glp_col-11: (@glp_col-1*11); +@glp_col-12: 100%; -@col-5-12: (100%/5); -@col-7-12: (100%/7); -@col-8-12: (100%/8); -@col-9-12: (100%/9); -@col-10-12: (100%/10); -@col-11-12: (100%/11); +@glp_col-5-12: (100%/5); +@glp_col-7-12: (100%/7); +@glp_col-8-12: (100%/8); +@glp_col-9-12: (100%/9); +@glp_col-10-12: (100%/10); +@glp_col-11-12: (100%/11); // Function to generate the grid by number .makeGridByNumber(@grid){ - [class*="@{grid}-1"] > [class*='col']{ flex-basis: @col-12; max-width: @col-12; } - [class*="@{grid}-2"] > [class*='col']{ flex-basis: @col-6; max-width: @col-6; } - [class*="@{grid}-3"] > [class*='col']{ flex-basis: @col-4; max-width: @col-4; } - [class*="@{grid}-4"] > [class*='col']{ flex-basis: @col-3; max-width: @col-3; } - [class*="@{grid}-5"] > [class*='col']{ flex-basis: @col-5-12; max-width: @col-5-12; } - [class*="@{grid}-6"] > [class*='col']{ flex-basis: @col-2; max-width: @col-2; } - [class*="@{grid}-7"] > [class*='col']{ flex-basis: @col-7-12; max-width: @col-7-12; } - [class*="@{grid}-8"] > [class*='col']{ flex-basis: @col-8-12; max-width: @col-8-12; } - [class*="@{grid}-9"] > [class*='col']{ flex-basis: @col-9-12; max-width: @col-9-12; } - [class*="@{grid}-10"] > [class*='col']{ flex-basis: @col-10-12; max-width: @col-10-12; } - [class*="@{grid}-11"] > [class*='col']{ flex-basis: @col-11-12; max-width: @col-11-12; } - [class*="@{grid}-12"] > [class*='col']{ flex-basis: @col-1; max-width: @col-1; } + [class*="@{grid}-1"] > [class*='col']{ flex-basis: @glp_col-12; max-width: @glp_col-12; } + [class*="@{grid}-2"] > [class*='col']{ flex-basis: @glp_col-6; max-width: @glp_col-6; } + [class*="@{grid}-3"] > [class*='col']{ flex-basis: @glp_col-4; max-width: @glp_col-4; } + [class*="@{grid}-4"] > [class*='col']{ flex-basis: @glp_col-3; max-width: @glp_col-3; } + [class*="@{grid}-5"] > [class*='col']{ flex-basis: @glp_col-5-12; max-width: @glp_col-5-12; } + [class*="@{grid}-6"] > [class*='col']{ flex-basis: @glp_col-2; max-width: @glp_col-2; } + [class*="@{grid}-7"] > [class*='col']{ flex-basis: @glp_col-7-12; max-width: @glp_col-7-12; } + [class*="@{grid}-8"] > [class*='col']{ flex-basis: @glp_col-8-12; max-width: @glp_col-8-12; } + [class*="@{grid}-9"] > [class*='col']{ flex-basis: @glp_col-9-12; max-width: @glp_col-9-12; } + [class*="@{grid}-10"] > [class*='col']{ flex-basis: @glp_col-10-12; max-width: @glp_col-10-12; } + [class*="@{grid}-11"] > [class*='col']{ flex-basis: @glp_col-11-12; max-width: @glp_col-11-12; } + [class*="@{grid}-12"] > [class*='col']{ flex-basis: @glp_col-1; max-width: @glp_col-1; } } // Function to generate the grid by columns .makeCol(@col) { [class*='grid'] { - > [class*="@{col}-1"]{ flex-basis: @col-1;max-width: @col-1; } - > [class*="@{col}-2"]{ flex-basis: @col-2;max-width: @col-2; } - > [class*="@{col}-3"]{ flex-basis: @col-3;max-width: @col-3; } - > [class*="@{col}-4"]{ flex-basis: @col-4;max-width: @col-4;} - > [class*="@{col}-5"]{ flex-basis: @col-5;max-width: @col-5;} - > [class*="@{col}-6"]{ flex-basis: @col-6;max-width: @col-6;} - > [class*="@{col}-7"]{ flex-basis: @col-7;max-width: @col-7;} - > [class*="@{col}-8"]{ flex-basis: @col-8;max-width: @col-8;} - > [class*="@{col}-9"]{ flex-basis: @col-9;max-width: @col-9;} - > [class*="@{col}-10"]{ flex-basis: @col-10;max-width: @col-10;} - > [class*="@{col}-11"]{ flex-basis: @col-11;max-width: @col-11;} - > [class*="@{col}-12"]{ flex-basis: @col-12;max-width: @col-12;} + > [class*="@{col}-1"]{ flex-basis: @glp_col-1;max-width: @glp_col-1; } + > [class*="@{col}-2"]{ flex-basis: @glp_col-2;max-width: @glp_col-2; } + > [class*="@{col}-3"]{ flex-basis: @glp_col-3;max-width: @glp_col-3; } + > [class*="@{col}-4"]{ flex-basis: @glp_col-4;max-width: @glp_col-4;} + > [class*="@{col}-5"]{ flex-basis: @glp_col-5;max-width: @glp_col-5;} + > [class*="@{col}-6"]{ flex-basis: @glp_col-6;max-width: @glp_col-6;} + > [class*="@{col}-7"]{ flex-basis: @glp_col-7;max-width: @glp_col-7;} + > [class*="@{col}-8"]{ flex-basis: @glp_col-8;max-width: @glp_col-8;} + > [class*="@{col}-9"]{ flex-basis: @glp_col-9;max-width: @glp_col-9;} + > [class*="@{col}-10"]{ flex-basis: @glp_col-10;max-width: @glp_col-10;} + > [class*="@{col}-11"]{ flex-basis: @glp_col-11;max-width: @glp_col-11;} + > [class*="@{col}-12"]{ flex-basis: @glp_col-12;max-width: @glp_col-12;} } } @@ -66,31 +66,31 @@ .makeOff(@off) { [class*="grid"] > { > [push-left*="@{off}-0"]{ margin-left: 0; } - > [push-left*="@{off}-1"]{ margin-left: @col-1; } - > [push-left*="@{off}-2"]{ margin-left: @col-2; } - > [push-left*="@{off}-3"]{ margin-left: @col-3; } - > [push-left*="@{off}-4"]{ margin-left: @col-4; } - > [push-left*="@{off}-5"]{ margin-left: @col-5; } - > [push-left*="@{off}-6"]{ margin-left: @col-6; } - > [push-left*="@{off}-6"]{ margin-left: @col-6; } - > [push-left*="@{off}-7"]{ margin-left: @col-7; } - > [push-left*="@{off}-8"]{ margin-left: @col-8; } - > [push-left*="@{off}-9"]{ margin-left: @col-9; } - > [push-left*="@{off}-10"]{ margin-left: @col-10; } - > [push-left*="@{off}-11"]{ margin-left: @col-11; } + > [push-left*="@{off}-1"]{ margin-left: @glp_col-1; } + > [push-left*="@{off}-2"]{ margin-left: @glp_col-2; } + > [push-left*="@{off}-3"]{ margin-left: @glp_col-3; } + > [push-left*="@{off}-4"]{ margin-left: @glp_col-4; } + > [push-left*="@{off}-5"]{ margin-left: @glp_col-5; } + > [push-left*="@{off}-6"]{ margin-left: @glp_col-6; } + > [push-left*="@{off}-6"]{ margin-left: @glp_col-6; } + > [push-left*="@{off}-7"]{ margin-left: @glp_col-7; } + > [push-left*="@{off}-8"]{ margin-left: @glp_col-8; } + > [push-left*="@{off}-9"]{ margin-left: @glp_col-9; } + > [push-left*="@{off}-10"]{ margin-left: @glp_col-10; } + > [push-left*="@{off}-11"]{ margin-left: @glp_col-11; } > [push-right*="@{off}-0"]{ margin-right: 0; } - > [push-right*="@{off}-1"]{ margin-right: @col-1; } - > [push-right*="@{off}-2"]{ margin-right: @col-2; } - > [push-right*="@{off}-3"]{ margin-right: @col-3; } - > [push-right*="@{off}-4"]{ margin-right: @col-4; } - > [push-right*="@{off}-5"]{ margin-right: @col-5; } - > [push-right*="@{off}-6"]{ margin-right: @col-6; } - > [push-right*="@{off}-6"]{ margin-right: @col-6; } - > [push-right*="@{off}-7"]{ margin-right: @col-7; } - > [push-right*="@{off}-8"]{ margin-right: @col-8; } - > [push-right*="@{off}-9"]{ margin-right: @col-9; } - > [push-right*="@{off}-10"]{ margin-right: @col-10; } - > [push-right*="@{off}-11"]{ margin-right: @col-11; } + > [push-right*="@{off}-1"]{ margin-right: @glp_col-1; } + > [push-right*="@{off}-2"]{ margin-right: @glp_col-2; } + > [push-right*="@{off}-3"]{ margin-right: @glp_col-3; } + > [push-right*="@{off}-4"]{ margin-right: @glp_col-4; } + > [push-right*="@{off}-5"]{ margin-right: @glp_col-5; } + > [push-right*="@{off}-6"]{ margin-right: @glp_col-6; } + > [push-right*="@{off}-6"]{ margin-right: @glp_col-6; } + > [push-right*="@{off}-7"]{ margin-right: @glp_col-7; } + > [push-right*="@{off}-8"]{ margin-right: @glp_col-8; } + > [push-right*="@{off}-9"]{ margin-right: @glp_col-9; } + > [push-right*="@{off}-10"]{ margin-right: @glp_col-10; } + > [push-right*="@{off}-11"]{ margin-right: @glp_col-11; } } } \ No newline at end of file diff --git a/src/gridlex.less b/src/gridlex.less index c294444..970dbe4 100644 --- a/src/gridlex.less +++ b/src/gridlex.less @@ -9,12 +9,12 @@ box-sizing: border-box; display: flex; flex-flow: row wrap; - margin: 0 -@gutter; + margin: 0 -@gl-gutter; } [class*="col"]{ box-sizing: border-box; flex: 0 0 auto; - padding: 0 @gutter (@gutter*2); + padding: 0 @gl-gutter (@gl-gutter*2); } [class*="grid"][class*="col"]{ margin: 0; @@ -99,16 +99,16 @@ *************************/ .makeGridByNumber(grid); -@media @lg{ +@media @gl-lg{ .makeGridByNumber(_lg); } -@media @md{ +@media @gl-md{ .makeGridByNumber(_md); } -@media @sm{ +@media @gl-sm{ .makeGridByNumber(_sm); } -@media @xs{ +@media @gl-xs{ .makeGridByNumber(_xs); } @@ -119,19 +119,19 @@ .makeCol(col); .makeOff(off); -@media @lg{ +@media @gl-lg{ .makeCol(_lg); .makeOff(_lg); } -@media @md{ +@media @gl-md{ .makeCol(_md); .makeOff(_md); } -@media @sm{ +@media @gl-sm{ .makeCol(_sm); .makeOff(_sm); } -@media @xs{ +@media @gl-xs{ .makeCol(_xs); .makeOff(_xs); }