Skip to content

Instantly share code, notes, and snippets.

@iilei
Created January 14, 2014 10:01
Show Gist options
  • Save iilei/8415987 to your computer and use it in GitHub Desktop.
Save iilei/8415987 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)
// ----
/**
* some helpers fetched from
* http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/
*/
@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;
}
/**
* Unset removes the values from one list of another
* @param {List} $list original list
* @param {List} $values list of values to remove
* @return {List} result list
*/
@function unset($list, $values) {
$result: $list;
@for $i from 1 through length($values) {
$result: remove($result, nth($values, $i));
}
@return $result;
}
/**
* some helpers fetched from
* http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/
*/
/**
* Unset removes the values from one list of another
* @param {List} $list original list
* @param {List} $values list of values to remove
* @return {List} result list
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment