@use "sass:list";

/**
 * Z-Index function
 *
 * @param {string} $list (Array) - The list to find the current z-index in
 * @param {string} $element (String) - The name of the current element, must be in the $list
 *
 * @returns {number}
 */
@function zindex($list, $element) {
  $zIndex: list.index($list, $element);

  @if $zIndex {
    @return $zIndex;
  }

  @warn 'There is no item "#{$element}" in this list; choose one of: #{$list}';
  @return null;
}
