/// Reverse a list
///
/// @author Hugo Giraudel
/// @access public
/// @link http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/
///
/// @param {list }$list - the list which you wish to reverse
/// @param {bool} $recursive [false] - enable if target list has nested values
///
/// @return {list} - reversed list
@function list-reverse($list, $recursive: false) {
    $result: ();

    @for $i from length($list) * -1 through -1 {
        @if type-of(nth($list, abs($i))) == list and $recursive {
            $result: append($result, list-reverse(nth($list, abs($i)), $recursive));
        } @else {
            $result: append($result, nth($list, abs($i)));
        }
    }

    @return $result;
}