Skip to content

Instantly share code, notes, and snippets.

@nicubarbaros
Created October 3, 2022 11:45
Show Gist options
  • Save nicubarbaros/3a5a1a769377a8a87054acaadfe4f238 to your computer and use it in GitHub Desktop.
Save nicubarbaros/3a5a1a769377a8a87054acaadfe4f238 to your computer and use it in GitHub Desktop.
z-index mixin
@function z($name) {
@if index($z-indexes, $name) {
@return (length($z-indexes) - index($z-indexes, $name)) + 1;
} @else {
@warn 'There is no item "#{$name}" in this list; choose one of: #{$z-indexes}';
@return null;
}
}
$z-indexes: (
"outdated-browser",
"modal",
"site-header",
"page-wrapper",
"site-footer"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment