Skip to content

Instantly share code, notes, and snippets.

@airen
Created May 23, 2015 09:03
Show Gist options
  • Save airen/a70eb473b806c4e2a57d to your computer and use it in GitHub Desktop.
Save airen/a70eb473b806c4e2a57d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
@mixin position($position,$args){
@each $o in top right bottom left {
$i: index($args, $o);
@if $i and $i + 1 <= length($args) and type-of(nth($args, $i + 1)) == number {
#{$o}: nth($args, $i + 1);
}
}
position: $position;
}
.absolute{
@include position(absolute,top 10px right 20px);
}
.absolute{
@include position(absolute,top 0 right 0 bottom 0 left 0);
}
.absolute {
top: 10px;
right: 20px;
position: absolute; }
.absolute {
top: 0;
right: 0;
bottom: 0;
left: 0;
position: absolute; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment