Created
September 15, 2015 14:05
-
-
Save jackw/c1ac24de6e34a45d87fe to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<div id="ORB_BUTTONELEMENT"> | |
<input id="btnSubmit" type="submit" value="Continue" class="ORB_BUTTON"> | |
</div> |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
$zindex-array: ( | |
'content-overlay', | |
'main-nav', | |
'header', | |
'modal', | |
'whatever', | |
'footer' | |
); | |
@function stack($needle: 'content-overlay', $haystack: $zindex-array) { | |
// create shorthand to reset item. | |
@if $needle == 'default' { | |
@return auto; | |
} | |
// create a shorthand to force item to top of stack. | |
@if $needle == 'force' { | |
@return length($haystack); | |
} | |
// check for stack item and return index or error. | |
@if index($haystack, $needle) { | |
@return index($haystack, $needle); | |
} @else { | |
@warn "`#{inspect($haystack)}` doesn't seem to have a key named `#{inspect($needle)}` setting z-index to 0."; | |
@return 0; | |
} | |
}; | |
.selector { | |
z-index: stack('footer'); | |
} | |
.some-other-selector { | |
z-index: stack('sausage'); | |
} | |
.modal { | |
z-index: stack('force'); | |
} | |
.whatever { | |
z-index: stack('default'); | |
} | |
// If we wanted to do something like create a component... | |
$modal-stack: ('cloak', 'window', 'title'); | |
.modal { | |
z-index: stack('modal'); | |
.cloak { | |
z-index: stack('cloak', $modal-stack); | |
} | |
} | |
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
.selector { | |
z-index: 6; | |
} | |
.some-other-selector { | |
z-index: 0; | |
} | |
.modal { | |
z-index: 6; | |
} | |
.whatever { | |
z-index: auto; | |
} | |
.modal { | |
z-index: 4; | |
} | |
.modal .cloak { | |
z-index: 1; | |
} |
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
<div id="ORB_BUTTONELEMENT"> | |
<input id="btnSubmit" type="submit" value="Continue" class="ORB_BUTTON"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment