lancehmd
4/25/2017 - 8:12 PM

Removed an item for a SASS list based on it's index (mimics behavior of the native map-remove function)

Removed an item for a SASS list based on it's index (mimics behavior of the native map-remove function)

/// list-remove
/// Remove an item from a list
/// @param $list - A SASS list
/// @param $index - The list index to remove
/// @returns A SASS list
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function list-remove($list, $index) {
  $newList: ();
  @for $i from 1 through length($list) {
    @if $i != $index {
      $newList: append($newList, nth($list,$i), 'space');
    }
  }
  @return $newList;
}