Skip to content

Instantly share code, notes, and snippets.

@dannygarcia
Created July 27, 2013 00:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannygarcia/6093089 to your computer and use it in GitHub Desktop.
Save dannygarcia/6093089 to your computer and use it in GitHub Desktop.
Absolute Mixin
@mixin absolute($top: false, $right: false, $bottom: false, $left: false) {
position: absolute;
@if $top != false {
top: $top;
}
@if $right != false {
right: $right;
}
@if $bottom != false {
bottom: $bottom;
}
@if $left != false {
left: $left;
}
}
// Example
.item {
@include absolute(0, 10%, false, 20%);
// generates
position: absolute;
top: 0;
right: 10%;
left: 20%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment