@charset "UTF-8";

/* -----------------------------------------------------------------

    Copyright  : 2022
    Created on : 2022-11-6, 7:01 PM
    Author     : Sébastien FOURNIER <contact@sebastien-fournier.com>

    FUNCTIONS :
    ==========

------------------------------------------------------------------ */

@function str-replace($string, $search, $replace: "") {
    $index: str-index($string, $search);
    @if $index {
        @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    }
    @return $string;
}

@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;
}