Last active
December 29, 2015 02:18
-
-
Save imlinus/7599009 to your computer and use it in GitHub Desktop.
position mixin
This file contains hidden or 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 position( | |
$position: absolute, | |
$top: null, | |
$right: null, | |
$bottom: null, | |
$left: null | |
) { | |
position: $position; | |
top: $top; | |
right: $right; | |
bottom: $bottom; | |
left: $left; | |
} | |
// usage | |
// demo: http://codepen.io/liljalinus/pen/Esqhw | |
.box { | |
@include position(absolute, 50px, null, null, 50px); | |
width: 100px; | |
height: 100px; | |
background: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative usage, more semantic and almost negates the need for commenting :)
@include position(absolute, $top: 0, $left: 1.5rem);