Skip to content

Instantly share code, notes, and snippets.

@non-carbondated
Created June 13, 2014 18:15
Show Gist options
  • Save non-carbondated/9868ba071b38856bd27a to your computer and use it in GitHub Desktop.
Save non-carbondated/9868ba071b38856bd27a to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
// Example based on http://www.smashingmagazine.com/2014/06/12/sassy-z-index-management-for-complex-layouts/
// This example reduces effort and required code by using @each and #{} to make updating a z-index list the only effort needed.
$elements: project-covers, user-tooltip, sorting-bar, modals, navigation;
$modal-elements: field, form-controls, error, autocomplete-dropdown;
.modal {
z-index: index($elements, modals);
@each $el in $modal-elements {
.#{$el} {
z-index: index($modal-elements, $el);
}
}
}
.modal {
z-index: 4;
}
.modal .field {
z-index: 1;
}
.modal .form-controls {
z-index: 2;
}
.modal .error {
z-index: 3;
}
.modal .autocomplete-dropdown {
z-index: 4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment