diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-11 00:41:41 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-11 00:41:41 +0400 |
commit | 1a8d7576e091c06662ee94f84d0f3f88a2f2dad8 (patch) | |
tree | e827d9a5509f44c460aea13c67aaeb38e01b6134 /less | |
parent | 1562381114ce1ce5dc06d311ddb6d1e0f2048a1f (diff) | |
parent | 29c63fdb6ae4877160dbad05cdcf34f8cf1f66ad (diff) |
Merge branch 'new_grid' into 2.0.2-wip
Conflicts:
docs/assets/bootstrap.zip
docs/assets/css/bootstrap-responsive.css
docs/assets/css/bootstrap.css
less/mixins.less
Diffstat (limited to 'less')
-rw-r--r-- | less/mixins.less | 90 |
1 files changed, 37 insertions, 53 deletions
diff --git a/less/mixins.less b/less/mixins.less index 814a42b4bb..bba7544528 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -484,14 +484,26 @@ .core (@gridColumnWidth, @gridGutterWidth) { - .span (@columns) { - width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); + .spanX (@index) when (@index > 0) { + (~".span@{index}") { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + + .offsetX (@index) when (@index > 0) { + (~".offset@{index}") { .offset(@index); } + .offsetX(@index - 1); } + .offsetX (0) {} .offset (@columns) { margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2); } + .span (@columns) { + width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); + } + .row { margin-left: @gridGutterWidth * -1; .clearfix(); @@ -505,38 +517,22 @@ // Set the container width, and override it for fixed navbars in media queries .container, .navbar-fixed-top .container, - .navbar-fixed-bottom .container { .span(12); } - - .span1 { .span(1); } - .span2 { .span(2); } - .span3 { .span(3); } - .span4 { .span(4); } - .span5 { .span(5); } - .span6 { .span(6); } - .span7 { .span(7); } - .span8 { .span(8); } - .span9 { .span(9); } - .span10 { .span(10); } - .span11 { .span(11); } - .span12 { .span(12); } - - .offset1 { .offset(1); } - .offset2 { .offset(2); } - .offset3 { .offset(3); } - .offset4 { .offset(4); } - .offset5 { .offset(5); } - .offset6 { .offset(6); } - .offset7 { .offset(7); } - .offset8 { .offset(8); } - .offset9 { .offset(9); } - .offset10 { .offset(10); } - .offset11 { .offset(11); } - .offset12 { .offset(12); } + .navbar-fixed-bottom .container { .span(@gridColumns); } + + // generate .spanX and .offsetX + .spanX (@gridColumns); + .offsetX (@gridColumns); } .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) { + .spanX (@index) when (@index > 0) { + (~"> .span@{index}") { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + .span (@columns) { width: 1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); } @@ -551,24 +547,21 @@ > [class*="span"]:first-child { margin-left: 0; } - > .span1 { .span(1); } - > .span2 { .span(2); } - > .span3 { .span(3); } - > .span4 { .span(4); } - > .span5 { .span(5); } - > .span6 { .span(6); } - > .span7 { .span(7); } - > .span8 { .span(8); } - > .span9 { .span(9); } - > .span10 { .span(10); } - > .span11 { .span(11); } - > .span12 { .span(12); } + + // generate .spanX + .spanX (@gridColumns); } } .input(@gridColumnWidth, @gridGutterWidth) { + .spanX (@index) when (@index > 0) { + (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + .span(@columns) { width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10; } @@ -577,20 +570,11 @@ textarea, .uneditable-input { margin-left: 0; // override margin-left from core grid system - &.span1 { .span(1); } - &.span2 { .span(2); } - &.span3 { .span(3); } - &.span4 { .span(4); } - &.span5 { .span(5); } - &.span6 { .span(6); } - &.span7 { .span(7); } - &.span8 { .span(8); } - &.span9 { .span(9); } - &.span10 { .span(10); } - &.span11 { .span(11); } - &.span12 { .span(12); } } + // generate .spanX + .spanX (@gridColumns); + } } |