2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

optimized grid system from @necolas

This commit is contained in:
Jacob Thornton
2011-08-23 20:16:39 -07:00
parent 0bfce13983
commit 7d7156bff9
4 changed files with 132 additions and 213 deletions
+2 -12
View File
@@ -36,6 +36,7 @@
@gridColumns: 16;
@gridColumnWidth: 40px;
@gridGutterWidth: 20px;
@extraSpace: 40px;
@siteWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
// Color Scheme
@@ -125,21 +126,10 @@
.clearfix();
}
.columns(@columnSpan: 1) {
float: left;
width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
margin-left: @gridGutterWidth;
&:first-child {
margin-left: 0;
}
}
.offsetMath(@extraSpace: 40px) {
margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @extraSpace !important;
}
.offset(@columnOffset: 1) {
.offsetMath(40px);
&:first-child {
.offsetMath(20px);
}
margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @extraSpace;
}
// Border Radius
+23
View File
@@ -9,6 +9,29 @@
.row {
.clearfix();
margin: 0 -20px;
// Default columns
.span1,
.span2,
.span3,
.span4,
.span5,
.span6,
.span7,
.span8,
.span9,
.span10,
.span11,
.span12,
.span13,
.span14,
.span15,
.span16 {
float: left;
margin-left: 20px;
*display: inline; // IE6 double margin bug fix.
}
// Default columns
.span1 { .columns(1); }