$global-elements: ( content: 100, overlay: 400, ); /// Returns the z-index of the specified element. /// @param {String} $element - The key for the element. /// @param {Map} $context - The map in which to search for the element. /// @return {Number} The z-index for the element. @function z-index($element, $context: $global-elements) { $index: map-get($context, $element); @if $index { @return $index; } @else { @error 'z-index `#{$element}` in `#{$context}` not found.'; } }