Last active
February 13, 2018 08:03
-
-
Save tai2/42fd7ccf23fa8c3e69acb16d8c4d29c4 to your computer and use it in GitHub Desktop.
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
// _z-index.scss | |
$zIndexList: ( | |
Background: -50100, | |
ContentFront: 50100, | |
UI: 50200, | |
UIPopup: 50300, | |
Modal: 50400, | |
); | |
@function zIndex($value, $list: $zIndexList) { | |
$_i: map-get($list, $value); | |
@if $_i { | |
@return $_i; | |
} @else { | |
@error "Function `zIndex` has taken invalid argument: #{$value}."; | |
} | |
} | |
// foo.scss | |
@import 'z-index'; | |
.foo { | |
z-index: zIndex(UI); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment