Skip to content

Instantly share code, notes, and snippets.

@startinggravity
Created March 24, 2015 15:55
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 startinggravity/0b6af8cb33ee22c5668a to your computer and use it in GitHub Desktop.
Save startinggravity/0b6af8cb33ee22c5668a to your computer and use it in GitHub Desktop.
Sassmap - Layers
/* Set x-index key value pairs */
$layers: (
modal: 8,
logo: 7,
header: 6,
footer: 5,
sidebar: 4,
caption: 3,
image: 2,
text: 1
);
/* Accccess this map with a mixin */
@mixin layer($layer-name) {
z-index: map-get($layers, $layer-name);
};
/* Use the mixin */
header {
@include layer('header');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment