pablolobos
8/6/2013 - 1:08 PM

mixin: absolute-position

mixin: absolute-position

@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%);
}