From f8d68002dc22a15a84c0a4dff5a5851ff131c9c8 Mon Sep 17 00:00:00 2001 From: Igor Rzegocki Date: Wed, 9 May 2012 15:50:13 +0200 Subject: [PATCH 1/3] Added offsets for .row-fluid --- less/mixins.less | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/less/mixins.less b/less/mixins.less index 4f204d1af7..47353bcc55 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -596,6 +596,17 @@ } .spanX (0) {} + .offsetX (@index) when (@index > 0) { + (~'.offset@{index}, .row-fluid > .offset@{index}[class*="span"]') { .offset(@index); } + .offsetX(@index - 1); + } + .offsetX (0) {} + + .offset (@columns) { + margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + @fluidGridGutterWidth; + *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); + } + .span (@columns) { width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%); @@ -614,8 +625,9 @@ margin-left: 0; } - // generate .spanX + // generate .spanX and .offsetX .spanX (@gridColumns); + .offsetX (@gridColumns); } } From c3f5d7c62d49de8de9947e84e9186bd2bf374008 Mon Sep 17 00:00:00 2001 From: Marcus Schwab Date: Thu, 7 Jun 2012 14:36:45 -0700 Subject: [PATCH 2/3] ajgon's fluid offsets working with first-child --- less/mixins.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 less/mixins.less diff --git a/less/mixins.less b/less/mixins.less old mode 100644 new mode 100755 index 47353bcc55..8f89beb794 --- a/less/mixins.less +++ b/less/mixins.less @@ -597,7 +597,7 @@ .spanX (0) {} .offsetX (@index) when (@index > 0) { - (~'.offset@{index}, .row-fluid > .offset@{index}[class*="span"]') { .offset(@index); } + (~'.offset@{index}, .row-fluid .offset@{index}:first-child') { .offset(@index); } .offsetX(@index - 1); } .offsetX (0) {} From bd19b42c15108b3c60407924a1725473660120d9 Mon Sep 17 00:00:00 2001 From: Marcus Schwab Date: Mon, 11 Jun 2012 01:51:19 -0700 Subject: [PATCH 3/3] Proper spacing between offsets row-fluids don't have the same negative margin-left as rows. This was throwing everything off. So added a different rule for first-child and subsequent "spans". --- less/mixins.less | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100755 => 100644 less/mixins.less diff --git a/less/mixins.less b/less/mixins.less old mode 100755 new mode 100644 index 8f89beb794..8698ab0e3b --- a/less/mixins.less +++ b/less/mixins.less @@ -597,14 +597,20 @@ .spanX (0) {} .offsetX (@index) when (@index > 0) { - (~'.offset@{index}, .row-fluid .offset@{index}:first-child') { .offset(@index); } + (~'.offset@{index}') { .offset(@index); } + (~'.offset@{index}:first-child') { .offsetFirstChild(@index); } .offsetX(@index - 1); } .offsetX (0) {} .offset (@columns) { - margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + @fluidGridGutterWidth; - *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); + margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2); + *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%); + } + + .offsetFirstChild (@columns) { + margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth); + *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); } .span (@columns) {