diff --git a/index.js b/index.js index aafc53bd..7c95a4da 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var path = require('path'); var pkg = require('./package.json'); -var jeetPath = path.join(__dirname, 'styl') +var jeetPath = path.join(__dirname, 'styl'); exports = module.exports = function (opts) { var implicit = (opts && opts.implicit == false) ? false : true; @@ -12,8 +12,8 @@ exports = module.exports = function (opts) { if (implicit) { style.import(jeetPath); } - } -} + }; +}; exports.libname = pkg.name; exports.path = jeetPath; diff --git a/scss/_grid.scss b/scss/_grid.scss index a912df2b..6b96bf1c 100644 --- a/scss/_grid.scss +++ b/scss/_grid.scss @@ -1,4 +1,4 @@ -@mixin column($ratios: 1, $offset: 0, $cycle: 0, $gutter: map-get($jeet, 'gutter')) { +@mixin column($ratios: 1, $offset: 0, $cycle: 0, $gutter: map-get($jeet, 'gutter'), $clearfix: true) { $side: _get-layout-direction(); $opposite-side: _opposite-direction($side); $column-widths: _get-column($ratios, $gutter); @@ -18,7 +18,9 @@ } } - @include clearfix; + @if $clearfix { + @include clearfix; + } float: $side; clear: none; @@ -82,7 +84,7 @@ } -@mixin span($ratio: 1, $offset: 0, $cycle: 0) { +@mixin span($ratio: 1, $offset: 0, $cycle: 0, $clearfix: true) { $side: _get-layout-direction(); $opposite-side: _opposite-direction($side); $span-width: _get-span($ratio); @@ -97,7 +99,10 @@ } } - @include clearfix; + @if $clearfix { + @include clearfix; + } + float: $side; clear: none; text-align: inherit; diff --git a/styl/_grid.styl b/styl/_grid.styl index 7bf76e3b..70999b68 100644 --- a/styl/_grid.styl +++ b/styl/_grid.styl @@ -1,4 +1,4 @@ -column($ratios = 1, $offset = 0, $cycle = 0, $gutter = $jeet.gutter) +column($ratios = 1, $offset = 0, $cycle = 0, $gutter = $jeet.gutter, $clearfix = true) side = _get-layout-direction() opposite-side = opposite-position(side) column-widths = _get-column($ratios, $gutter) @@ -15,7 +15,9 @@ column($ratios = 1, $offset = 0, $cycle = 0, $gutter = $jeet.gutter) $offset = _get-column($offset, column-widths[1])[0] margin-l = $offset + column-widths[1] - clearfix() + if $clearfix + clearfix() + float: side clear: none text-align: inherit @@ -60,7 +62,7 @@ column-gutter($ratios = 1, $gutter = $jeet.gutter) return $gutter + '%' -span($ratio = 1, $offset = 0, $cycle = 0) +span($ratio = 1, $offset = 0, $cycle = 0, $clearfix = true) side = _get-layout-direction() opposite-side = opposite-position(side) span-width = _get-span($ratio) @@ -74,7 +76,9 @@ span($ratio = 1, $offset = 0, $cycle = 0) else margin-l = _get-span($offset) - clearfix() + if $clearfix + clearfix() + float: side clear: none text-align: inherit diff --git a/test/node-stylus/style.styl b/test/node-stylus/style.styl index b149426a..2548962d 100644 --- a/test/node-stylus/style.styl +++ b/test/node-stylus/style.styl @@ -1,2 +1,5 @@ div column(1/3) + +span + span(1/2, $clearfix: false) \ No newline at end of file