Last active
August 29, 2015 14:19
-
-
Save airen/313e517ab7efa1f8c8b6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
@function map-has-nested-keys($map, $keys...) { | |
@each $key in $keys { | |
@if not map-has-key($map, $key) { | |
@return false; | |
} | |
$map: map-get($map, $key); | |
} | |
@return true; | |
} | |
@function map-deep-get($map, $keys...) { | |
@each $key in $keys { | |
$map: map-get($map, $key); | |
} | |
@return $map; | |
} | |
@function z($layers...) { | |
@if not map-has-nested-keys($z-layers, $layers...) { | |
@warn "No layer found for `#{inspect($layers...)}` in $z-layers map. Property omitted."; | |
} | |
@return map-deep-get($z-layers, $layers...); | |
} | |
$z-layers: ( | |
'bar': 1000, | |
'dropdown': 1000, | |
'popover': 1060, | |
'tooltip': 1070, | |
'modal': ( | |
'base': 1100, | |
'close': 1100, | |
'header': 1050, | |
'footer': 1010 | |
), | |
'default': 1, | |
'below': -1, | |
) !default; | |
.modal { | |
z-index: z(modal,base); | |
} | |
.tooltip{ | |
z-index: z(tooltip); | |
} |
This file contains hidden or 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
.modal { | |
z-index: 1100; | |
} | |
.tooltip { | |
z-index: 1070; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment