Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment