Skip to content

Instantly share code, notes, and snippets.

@dtothefp
Created June 17, 2014 14:39
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 dtothefp/128e8f44eeee4e34b1ff to your computer and use it in GitHub Desktop.
Save dtothefp/128e8f44eeee4e34b1ff to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
$elements: project-covers, user-tooltip, sorting-bar, modals, navigation;
$modal-elements: modal__header, modal__content, modal__footer;
@mixin make-z( $class, $value) {
.#{$class} {
z-index: #{$value};
}
}
@mixin for-z($properties) {
@for $i from 1 through length($properties) {
.#{nth($properties, $i)} {
z-index: index($properties, nth($properties, $i));
}
}
}
@mixin nested-z($parent, $children){
.#{$parent} {
@include for-z($children)
}
}
@include for-z($elements);
@include nested-z(modal, $modal-elements);
// @each $val in $elements {
// @include make-z($val, index($elements, $val));
// }
.project-covers {
z-index: 1;
}
.user-tooltip {
z-index: 2;
}
.sorting-bar {
z-index: 3;
}
.modals {
z-index: 4;
}
.navigation {
z-index: 5;
}
.modal .modal__header {
z-index: 1;
}
.modal .modal__content {
z-index: 2;
}
.modal .modal__footer {
z-index: 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment