|
1 | 1 | # css-flex-layout |
2 | 2 |
|
3 | 3 | A tiny framework based on css flex box to manage grids without flood your html |
| 4 | + |
| 5 | +It is only necessary to add 1 class to the columns container. |
| 6 | +Keep your code slim and clean. |
| 7 | + |
| 8 | +## Usage: |
| 9 | + |
| 10 | +### Auto sized columns |
| 11 | + |
| 12 | +Divide all available space between columns. |
| 13 | +If a column don't fit on the line, it will break to the next line. |
| 14 | + |
| 15 | +```html |
| 16 | +<section class="fl-cols-container"> |
| 17 | + <div>1</div> |
| 18 | + <div>2</div> |
| 19 | + <div>3</div> |
| 20 | +</section> |
| 21 | +``` |
| 22 | + |
| 23 | +### Specific columns per line |
| 24 | + |
| 25 | +Define the number of columns you want per line and available space will be divided |
| 26 | +to fit the columns on the line and the other columns will break to the next line. |
| 27 | + |
| 28 | + |
| 29 | +| Columns | Class | |
| 30 | +| ------- | ---------------------- | |
| 31 | +| 2 | `.fl-2-cols-container` | |
| 32 | +| 3 | `.fl-3-cols-container` | |
| 33 | +| 4 | `.fl-4-cols-container` | |
| 34 | +| 6 | `.fl-6-cols-container` | |
| 35 | + |
| 36 | + |
| 37 | +```html |
| 38 | +<section class="fl-3-cols-container"> |
| 39 | + <aside>001</aside> |
| 40 | + <aside>002</aside> |
| 41 | + <aside>003</aside><!-- break to next line --> |
| 42 | + <aside>004</aside> |
| 43 | + <aside>005</aside> |
| 44 | + <aside>006</aside><!-- break to next line --> |
| 45 | + <aside>007</aside><!-- alone on the last line --> |
| 46 | +</section> |
| 47 | +``` |
| 48 | + |
| 49 | +### Gutters |
| 50 | + |
| 51 | +Gutters add padding to the columns, without change its size. |
| 52 | + |
| 53 | + |
| 54 | +| Padding | class | |
| 55 | +| ------- | ----------------------------------------------------------- | |
| 56 | +| 5px | `.fl-gutter-5` or `.fl-gutter-tb-5` or `.fl-gutter-rl-5` | |
| 57 | +| 10px | `.fl-gutter-10` or `.fl-gutter-tb-10` or `.fl-gutter-rl-10` | |
| 58 | +| 15px | `.fl-gutter-15` or `.fl-gutter-tb-15` or `.fl-gutter-rl-15` | |
| 59 | +| 20px | `.fl-gutter-20` or `.fl-gutter-tb-20` or `.fl-gutter-rl-20` | |
| 60 | + |
| 61 | +> tb = **Top** and **Bottom** |
| 62 | +> rl = **Right** and **Left** |
| 63 | +
|
| 64 | +```html |
| 65 | +<section class="fl-cols-container fl-gutter-5"> |
| 66 | + <div>1</div> |
| 67 | + <div>2</div> |
| 68 | + <div>3</div> |
| 69 | +</section> |
| 70 | +``` |
| 71 | + |
| 72 | +### Spacers |
| 73 | + |
| 74 | +Spacers add **margin bottom** to all columns, pushing the cells that fell to the next line. |
| 75 | + |
| 76 | + |
| 77 | +| Padding | class | |
| 78 | +| ------- | --------------- | |
| 79 | +| 5px | `.fl-spacer-5` | |
| 80 | +| 10px | `.fl-spacer-10` | |
| 81 | +| 15px | `.fl-spacer-15` | |
| 82 | +| 20px | `.fl-spacer-20` | |
| 83 | + |
| 84 | + |
| 85 | +```html |
| 86 | +<section class="fl-2-cols-container fl-spacer-20"> |
| 87 | + <aside>001</aside> |
| 88 | + <aside>002</aside><!-- break to next line --> |
| 89 | + <!-- 20px spacer between --> |
| 90 | + <aside>003</aside> |
| 91 | + <aside>004</aside> |
| 92 | +</section> |
| 93 | +``` |
0 commit comments