Skip to content

Commit

Permalink
Make size-getting functions’ gutter vars explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Simmons committed Oct 25, 2016
1 parent f43b504 commit 2a24414
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Want to change it up when you get down to mobile? Maybe just show 2 images per r

Need to adjust column gutters for a specific container? `col(1/4, $gutter: .5)`. Note the gutter isn't a fixed width.

### column-width($ratios: 1, $g: map-get($jeet, 'gutter'))
### column-width($ratios: 1, $gutter: map-get($jeet, 'gutter'))

A function to return strictly the column width with none of the styles.

### column-gutter($ratios: 1, $g: map-get($jeet, 'gutter'))
### column-gutter($ratios: 1, $gutter: map-get($jeet, 'gutter'))

A function that returns the gutter size.

Expand Down
10 changes: 5 additions & 5 deletions scss/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,33 @@
}


@function column-width($ratios: 1, $g: map-get($jeet, 'gutter')) {
@function column-width($ratios: 1, $gutter: map-get($jeet, 'gutter')) {
@if (map-get($jeet, 'parent-first') != 'true') {
$ratios: _reverse($ratios);
}

$w: 100;

@each $ratio in $ratios {
$w: 100 * $ratio - $g + $ratio * $g;
$w: 100 * $ratio - $gutter + $ratio * $gutter;
}

@return unquote($w + '%');
}


@function column-gutter($ratios: 1, $g: map-get($jeet, 'gutter')) {
@function column-gutter($ratios: 1, $gutter: map-get($jeet, 'gutter')) {
@if (map-get($jeet, 'parent-first') != 'true') {
$ratios: _reverse($ratios);
}

$w: 100;

@each $ratio in $ratios {
$g: $g / $w * 100;
$gutter: $gutter / $w * 100;
}

@return unquote($g + '%');
@return unquote($gutter + '%');
}


Expand Down
4 changes: 2 additions & 2 deletions scss/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// API Quick Reference
// -------------------
// column($ratios: 1, $offset: 0, $cycle: 0, $gutter: map-get($jeet, 'gutter'))
// column-width($ratios: 1, $g: map-get($jeet, 'gutter'))
// column-gutter($ratios: 1, $g: map-get($jeet, 'gutter'))
// column-width($ratios: 1, $gutter: map-get($jeet, 'gutter'))
// column-gutter($ratios: 1, $gutter: map-get($jeet, 'gutter'))
// span($ratio: 1, $offset: 0, $cycle: 0)
// move($ratios: 0, $col-or-span: column, $gutter: map-get($jeet, 'gutter'))
// unmove()
Expand Down

0 comments on commit 2a24414

Please sign in to comment.