Skip to content

Instantly share code, notes, and snippets.

@tai2
Last active February 13, 2018 08:03
Show Gist options
  • Save tai2/42fd7ccf23fa8c3e69acb16d8c4d29c4 to your computer and use it in GitHub Desktop.
Save tai2/42fd7ccf23fa8c3e69acb16d8c4d29c4 to your computer and use it in GitHub Desktop.
// _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