Last active
December 15, 2015 20:58
-
-
Save mannieschumpert/5321866 to your computer and use it in GitHub Desktop.
Sass absolute positioning mixin demo
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
// Gist at https://gist.github.com/mannieschumpert/5321866 | |
// Future enhancements: support all four direction attributes (probably needs a different technique to avoid verboseness) | |
// Sass v3.2.7 | |
=absolute($args: NULL) | |
position: absolute | |
@if $args != NULL | |
#{nth($args, 1)}: nth($args, 2) | |
@if length($args) == 4 | |
#{nth($args, 3)}: nth($args, 4) | |
// Example usage | |
.div1 | |
+absolute | |
.div2 | |
+absolute(top 5px) | |
.div3 | |
+absolute(top 5px left 10px) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment