Skip to content

Instantly share code, notes, and snippets.

@sou-lab
Created October 12, 2016 06:02
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 sou-lab/08cd1c946a78c3f699839f57191c5b18 to your computer and use it in GitHub Desktop.
Save sou-lab/08cd1c946a78c3f699839f57191c5b18 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
> 1%
last 2 versions
// ----
// libsass (v3.3.6)
// ----
$z-index:(
// ↑レイヤー上
child,
pulldown,
nav,
header
// ↓レイヤー下
);
//リストを逆転させる
@function list-reverse($map) {
$result: ();
@for $i from length($map)*-1 through -1 {
$result: append($result, nth($map, abs($i)), comma);
}
@return $result;
}
$z-index: list-reverse($z-index);
@function z($name) {
@return index($z-index, $name);
}
.child {
z-index: z(child); // 4
}
.pulldown {
z-index: z(pulldown); // 3
}
.nav {
z-index: z(nav); // 2
}
.header {
z-index: z(header); // 1
}
.child {
z-index: 4;
}
.pulldown {
z-index: 3;
}
.nav {
z-index: 2;
}
.header {
z-index: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment