Created
July 8, 2019 07:05
-
-
Save davidweatherall2/dfc469b7a4451b169ae5d51445bf3f34 to your computer and use it in GitHub Desktop.
Z index sass helper function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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