Created
July 27, 2013 00:20
-
-
Save dannygarcia/6093089 to your computer and use it in GitHub Desktop.
Absolute Mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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