Created
October 19, 2016 09:07
-
-
Save ralexandr/154a0682324350589a318b670d3caf50 to your computer and use it in GitHub Desktop.
SASS: Z-Index mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// .site-header { | |
// z-index: z('site-header'); | |
// } | |
@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