Skip to content

Instantly share code, notes, and snippets.

@matesnippets
Created September 6, 2015 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matesnippets/11548cb340c8d840bc49 to your computer and use it in GitHub Desktop.
Save matesnippets/11548cb340c8d840bc49 to your computer and use it in GitHub Desktop.
Sass, z-index mixin for smart z-index management
// ----
// 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