Created
September 6, 2015 19:01
-
-
Save matesnippets/11548cb340c8d840bc49 to your computer and use it in GitHub Desktop.
Sass, z-index mixin for smart z-index management
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
// ---- | |
// z-index mixin to help organize z-indexes | |
// ---- | |
// Start with a map | |
$z-layers: ( | |
"cog": 50, | |
"overlay": 40, | |
"toc": 30, | |
"iframe-loader": 25, | |
"tooltip": 20 | |
) !default; | |
@function z($layer) { | |
@if not map-has-key($z-layers, $layer) { | |
@warn "No layer found for `#{$layer}` in $z-layers map. Property omitted."; | |
} | |
@return map-get($z-layers, $layer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment