Created
January 14, 2014 10:01
-
-
Save iilei/8415987 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
// ---- | |
// 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; | |
} |
This file contains hidden or 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
/** | |
* 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