Skip to content

Instantly share code, notes, and snippets.

@iilei
Created January 13, 2014 18:06
Show Gist options
  • Save iilei/8405041 to your computer and use it in GitHub Desktop.
Save iilei/8405041 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@function remove($list, $value, $recursive: false) {
$result: ();
@for $i from 1 through length($list) {
@if type-of(nth($list, $i)) == list and $recursive {
$result: append($result, remove(nth($list, $i), $value, $recursive));
}
@else if nth($list, $i) != $value {
$result: append($result, nth($list, $i));
}
}
@return $result;
}
$list: 1,2,3,4,5;
$value: 3;
$new-list: remove($list, 2);
/* #{$new-list} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment