// Removes all false and null values from $list // ------------------------------------------------------------------------------- // @documentation http://sassylists.com/documentation.html#purge // ------------------------------------------------------------------------------- // @alias `compact()` // @alias `clean()` // ------------------------------------------------------------------------------- // @example purge(a null b false c) => a, b, c // @example purge(a b c '') => a, b, c // ------------------------------------------------------------------------------- // @param $list [List] : list // ------------------------------------------------------------------------------- // @return [List] @function purge($list) { $result: (); @each $item in $list { @if $item and $item != "" and $value != () { $result: append($result, $item); } } @return $result; } // Aliases @function compact($list) { @return purge($list); } @function clean($list) { @return purge($list); }