Skip to content

Instantly share code, notes, and snippets.

@pablolobos
Created August 6, 2013 13:08
Show Gist options
  • Save pablolobos/6164297 to your computer and use it in GitHub Desktop.
Save pablolobos/6164297 to your computer and use it in GitHub Desktop.
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%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment