Skip to content

Commit

Permalink
Merge pull request #528 from Forked-Projects/login2030
Browse files Browse the repository at this point in the history
Added by param $clearfix in column() and span() mixins.
  • Loading branch information
pixeldesu authored Mar 17, 2017
2 parents 4671454 + 9fc66a6 commit 3a79f8f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -12,8 +12,8 @@ exports = module.exports = function (opts) {
if (implicit) {
style.import(jeetPath);
}
}
}
};
};

exports.libname = pkg.name;
exports.path = jeetPath;
Expand Down
13 changes: 9 additions & 4 deletions scss/_grid.scss
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -18,7 +18,9 @@
}
}

@include clearfix;
@if $clearfix {
@include clearfix;
}

float: $side;
clear: none;
Expand Down Expand Up @@ -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);
Expand All @@ -97,7 +99,10 @@
}
}

@include clearfix;
@if $clearfix {
@include clearfix;
}

float: $side;
clear: none;
text-align: inherit;
Expand Down
12 changes: 8 additions & 4 deletions styl/_grid.styl
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/node-stylus/style.styl
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
div
column(1/3)

span
span(1/2, $clearfix: false)

0 comments on commit 3a79f8f

Please sign in to comment.