Created
August 6, 2013 13:08
-
-
Save pablolobos/6164297 to your computer and use it in GitHub Desktop.
mixin: absolute-position
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
@mixin absolute($args) { | |
$offsets: top right bottom left; | |
@each $o in $offsets { | |
$i: index($args, $o); | |
@if $i | |
and $i + 1 <= length($args) | |
and type-of( nth($args, $i + 1) ) == number { | |
#{$o}: nth($args, $i + 1); | |
} | |
} | |
} | |
//example | |
.element { | |
@include absolute(top 1em right 10%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment