Skip to content

Instantly share code, notes, and snippets.

@Razenbull
Last active August 29, 2015 14:15
Show Gist options
  • Save Razenbull/31135b411962ba9b64d9 to your computer and use it in GitHub Desktop.
Save Razenbull/31135b411962ba9b64d9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// 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;
}
@mixin absolute($args) {
@include position("absolute", $args);
}
@mixin fixed($args) {
@include position("fixed", $args);
}
@mixin relative($args) {
@include position("relative", $args);
}
.example {
@include absolute(top 50px right 100% bottom 1em);
}
.example {
top: 50px;
right: 100%;
bottom: 1em;
position: "absolute";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment