Created
April 25, 2017 20:12
-
-
Save Jakobud/ec056b52f3673cc369dc97f2c2428424 to your computer and use it in GitHub Desktop.
Removed an item for a SASS list based on it's index (mimics behavior of the native map-remove function)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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 <[email protected]> | |
@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
I don't want to be nitpicky, but... Sass not SASS