Created
February 17, 2020 13:21
-
-
Save miminas/5e3daf88c8d46fd2210d8d791b97ac7f to your computer and use it in GitHub Desktop.
Z-index get and set
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-indexes map, gathering all Z layers of the application | |
/// @access private | |
/// @type Map | |
/// @prop {String} key - Layer’s name | |
/// @prop {Number} value - Z value mapped to the key | |
$z-indexes: ( | |
'modal': 5000, | |
'dropdown': 4000, | |
'default': 1, | |
'below': -1, | |
); | |
/// Get a z-index value from a layer name | |
/// @access public | |
/// @param {String} $layer - Layer’s name | |
/// @return {Number} | |
/// @require $z-indexes | |
@function z($layer) { | |
@return map-get($z-indexes, $layer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment