Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Fixed each() not passing arguments correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
devatrox committed Jan 8, 2017
1 parent dc16e32 commit c60e63e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions assets/lists/_each.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@
/// // ('xa', 'xb', 'xc')

@function sg-each($list, $function, $args...) {
$separator: list-separator($list);
$newlist: ();
$listSeparator: list-separator($list);
$argSeparator: list-separator($args);
$results: ();

@if not function-exists($function) {
@error 'Function #{$function}() does not exist!';
}

@each $item in $list {
$newlist: append($newlist, call($function, $item, $args...), $separator);
$newArgs: join(append((), $item, $argSeparator), $args, $argSeparator);
$results: append($results, call($function, $newArgs...), $listSeparator);
}

@return $newlist;
@return $results;
}

/// @name walk
Expand Down

0 comments on commit c60e63e

Please sign in to comment.