@function removeListItem($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;
}
