Created
April 4, 2018 18:17
-
-
Save mborsare/cc7446c22a1f45a6d31580a434fbc274 to your computer and use it in GitHub Desktop.
A nice little z-index Sass map thing
This file contains hidden or 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
This may be a little heavy-handed for this project, but here's a map I often use for z-indexes (mostly to keep things agnostic and in context). Values Eric Bailey originally concocted actually! | |
$z-index: ( | |
basement: -999999, | |
layout: 1000, | |
object: 2000, | |
component: 3000, | |
subcomponent: 3010, | |
modal: 4000, | |
submodal: 4010, | |
ceiling: 999999, | |
); | |
And then use this function: | |
@function get-z-index($index) { | |
@return map-get($z-index, $index); | |
} | |
In use: | |
.foo-modal { | |
z-index: get-z-index("modal"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment