Skip to content

Instantly share code, notes, and snippets.

@miminas
Created February 17, 2020 13:21
Show Gist options
  • Save miminas/5e3daf88c8d46fd2210d8d791b97ac7f to your computer and use it in GitHub Desktop.
Save miminas/5e3daf88c8d46fd2210d8d791b97ac7f to your computer and use it in GitHub Desktop.
Z-index get and set
/// 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