Flex One is CSS Layout system based on one CSS class. This class: .fluid {flex:1}
With this .fluid {flex:1} you can build entire CSS grid system.
.main{display: flex; flex-flow: row wrap; width: 80%; margin: 0 auto}
.fluid{flex:1}
.clear{width: 100%}
This CSS is the base for everything. With this CSS you can build solid Grid System.
<div class="fluid">33,3%</div>
<div class="fluid">33,3%</div>
<div class="fluid">33,3%</div>
<div class="clear"></div>
<div class="fluid">25%</div>
<div class="fluid">25%</div>
<div class="fluid">25%</div>
<div class="fluid">25%</div>
<div class="clear"></div>
Super simple, just add the number of columns you need. You can have infinite number of columns. Plus is fluid with natural responsiveness.
When you are finished add the .clear class.
Here is clear dynamic example on how .fluid {flex:1} works
One of the biggest limitation is: you must use identical size columns. You can't have 1-1-1-3 or 1-2-1 grid.
We can fix these limitations by adding some CSS code:
.merge2 {flex:2}
.merge3 {flex:3}
Now we can have this 1-1-1-3:
<div class="fluid">1</div>
<div class="fluid">1</div>
<div class="fluid">1</div>
<div class="merge3">Merge 3</div>
<div class="clear"></div>
We can use this code for the nested columns:
.nested{display: flex; flex-flow: row wrap; padding:0 !important; margin:0 !important; border: 0 !important}
<div class="fluid nested">
<div class="fluid">Nested column</div>
<div class="fluid">Nested column</div>
</div>
Inside any fluid column we can insert any number of other fluid columns by adding the .nested class.
The Gutter is optional. If you need it you can use something like this:
.fluid,.merge2,.merge3 {margin:0 0 0 15px}
// or maybe
.fluid,.merge2,.merge3,.merge4 {padding:0 10px}
Here is also alternative to the .clear class:
<div class="fluid"></div>
<div class="fluid"></div>
<div class="fluid"></div>
<div class="clear"></div>
// Alternative columns class:
<div class="columns">
<div class="fluid"></div>
<div class="fluid"></div>
<div class="fluid"></div>
</div>
Complete version of the CSS code is included in fluid.css and fluid.scss file
Starting with the .fluid{flex:1} class and by adding few other CSS classes we can build infinite column grid system that is fluid and responsive. You need just few lines of CSS to build solid layout system.
This project is licensed under the MIT License
We can push the system even further and use only 2 classes .column and .row and make it more semantic.
// Just 2 classes for the layout
.column{display: flex; flex-flow: row wrap; width: 80%; margin: 0 auto}
.row{flex:1}
// Use the HTML like this:
<div class="column">
<div class="row"></div>
<div class="row"></div>
<div class="row"></div>
....
</div>