sata-list($outer-width: false, $inner-width: false, $element-width: false, $element-margin: false, $count-in-row: false)
A list of elements (block float). Some parameters can be calculated automatically.
$outer-width - container width
$inner-width - inner container width (often $outer-width + 2 x $element-margin)
$element-width - one element width
$element-margin - one element margin (it will be left and right margins, so spacing between two elements = 2 x $element-margin)
$count-in-row - number of elements in a row
There is no need to specify all parameters. If you pass false to some parameters, they will calculated automatically.
You must specify $element-width, $element-margin, $count-in-row or (two of ($element-width, $element-margin, $count-in-row) and one of ($outer-width, $inner-width)).
Also applies clear and clearfix.
See examples.
<div class="outer-list">
<ul class="inner-list">
...
<li class="element"></li>
...
</ul>
</div>
#sata-list-example1 {
@include sata-list($element-width: 100px, $count-in-row: 3, $element-margin: 15px);
}
#sata-list-example1 {
overflow: hidden;
width: 360px;
}
#sata-list-example1 > ul {
margin: 0;
padding: 0;
border: 0;
*zoom: 1;
}
#sata-list-example1 > ul:after {
content: "";
display: table;
clear: both;
}
#sata-list-example1 > ul > li {
list-style-image: none;
list-style-type: none;
margin-left: 0;
float: left;
}
#sata-list-example1 > ul {
width: 390px;
margin-left: -15px;
}
#sata-list-example1 > ul > li {
width: 100px;
margin-left: 15px;
margin-right: 15px;
}
#sata-list-example2 {
@include sata-list($outer-width: 500px, $count-in-row: 4, $element-margin: 15px);
}
#sata-list-example2 {
overflow: hidden;
width: 500px;
}
#sata-list-example2 > ul {
margin: 0;
padding: 0;
border: 0;
*zoom: 1;
}
#sata-list-example2 > ul:after {
content: "";
display: table;
clear: both;
}
#sata-list-example2 > ul > li {
list-style-image: none;
list-style-type: none;
margin-left: 0;
float: left;
}
#sata-list-example2 > ul {
width: 530px;
margin-left: -15px;
}
#sata-list-example2 > ul > li {
width: 102px;
margin-left: 15px;
margin-right: 15px;
}
#sata-list-example3 {
@include sata-list($outer-width: 600px, $count-in-row: 3, $element-width: 150px);
}
#sata-list-example3 {
overflow: hidden;
width: 600px;
}
#sata-list-example3 > ul {
margin: 0;
padding: 0;
border: 0;
*zoom: 1;
}
#sata-list-example3 > ul:after {
content: "";
display: table;
clear: both;
}
#sata-list-example3 > ul > li {
list-style-image: none;
list-style-type: none;
margin-left: 0;
float: left;
}
#sata-list-example3 > ul {
width: 674px;
margin-left: -37px;
}
#sata-list-example3 > ul > li {
width: 150px;
margin-left: 37px;
margin-right: 37px;
}