Skip to content

Instantly share code, notes, and snippets.

@davidweatherall2
Created July 8, 2019 07:05
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidweatherall2/dfc469b7a4451b169ae5d51445bf3f34 to your computer and use it in GitHub Desktop.
Save davidweatherall2/dfc469b7a4451b169ae5d51445bf3f34 to your computer and use it in GitHub Desktop.
Z index sass helper function
// Z-index mapping: Correctly place your variable in the correct position based on what it should appear above and behind.
// Example usage: z-index: z(header);
$z-list: (
highest,
lowest
);
@function z($var) {
@return length($z-list) - index($z-list, $var) + 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment