diff options
| author | Jacob Thornton <[email protected]> | 2011-08-23 20:16:39 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-08-23 20:16:39 -0700 |
| commit | 7d7156bff9818c8d50affffb750b6019a9f20f26 (patch) | |
| tree | 39371f8b3b9a5f28bab309d8a396a340c4633afd /lib | |
| parent | 0bfce13983ada3029d98916b01703d5c0cef2104 (diff) | |
| download | bootstrap-7d7156bff9818c8d50affffb750b6019a9f20f26.tar.xz bootstrap-7d7156bff9818c8d50affffb750b6019a9f20f26.zip | |
optimized grid system from @necolas
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/preboot.less | 14 | ||||
| -rw-r--r-- | lib/scaffolding.less | 23 |
2 files changed, 25 insertions, 12 deletions
diff --git a/lib/preboot.less b/lib/preboot.less index 370cbcdb8..399d50825 100644 --- a/lib/preboot.less +++ b/lib/preboot.less @@ -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 diff --git a/lib/scaffolding.less b/lib/scaffolding.less index b1900f012..a75a47c5f 100644 --- a/lib/scaffolding.less +++ b/lib/scaffolding.less @@ -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); } |
