react/docs/_css/bourbon/addons/_position.scss

33 lines
715 B
SCSS
Raw Normal View History

2014-08-14 02:20:00 +08:00
@mixin position ($position: relative, $coordinates: null null null null) {
2013-05-30 03:46:11 +08:00
@if type-of($position) == list {
$coordinates: $position;
$position: relative;
}
2014-08-14 02:20:00 +08:00
$coordinates: unpack($coordinates);
2013-05-30 03:46:11 +08:00
$top: nth($coordinates, 1);
$right: nth($coordinates, 2);
$bottom: nth($coordinates, 3);
$left: nth($coordinates, 4);
position: $position;
2014-08-14 02:20:00 +08:00
@if ($top and $top == auto) or (type-of($top) == number) {
2013-05-30 03:46:11 +08:00
top: $top;
}
2014-08-14 02:20:00 +08:00
@if ($right and $right == auto) or (type-of($right) == number) {
2013-05-30 03:46:11 +08:00
right: $right;
}
2014-08-14 02:20:00 +08:00
@if ($bottom and $bottom == auto) or (type-of($bottom) == number) {
2013-05-30 03:46:11 +08:00
bottom: $bottom;
}
2014-08-14 02:20:00 +08:00
@if ($left and $left == auto) or (type-of($left) == number) {
2013-05-30 03:46:11 +08:00
left: $left;
}
}