Last active
September 4, 2015 12:33
-
-
Save rocbear/8c7f85744502b8c54f7a to your computer and use it in GitHub Desktop.
SCSS place something in the four corners of a container [with Bourbon]
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
@import "bourbon"; | |
$padding: 1em; | |
$positions: ("t", "l"), ("t", "r"), ("b", "r"), ("b", "l"); | |
@each $v, $h in $positions { | |
#{".position-" + $v + $h} { | |
@include position(absolute, | |
if($v == "t", $padding, auto) | |
if($h == "r", $padding, auto) | |
if($v == "b", $padding, auto) | |
if($h == "l", $padding, auto) | |
); | |
} | |
} | |
/* | |
Outputs: | |
.position-tl { ... | |
.position-tr { ... | |
.position-br { ... | |
.position-bl { ... | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment