/**
 * Position mixin for setting absolute position values
 *
 * The mixin can have multiple arguments providing a number
 * @param {number} $top (0) - Top Position
 * @param {number} $right ($top) - Right Position
 * @param {number} $bottom ($top) - Bottom Position
 * @param {number} $left ($right) - Left Position
 *
 * Or a map of multiple positions
 * @param {map} $args... - A map containing multiple positions (top: 1px, left: 1px)
 */
@mixin position($args...) {
	$argsLength: length($args);

	@if (type-of(nth($args, 1)) == 'map')
	{
		@each $prop, $value in nth($args, 1) {
			#{$prop}: $value;
		}
	}
	@else
	{
		@if ($argsLength == 1) {
			top: nth($args, 1);
			right: nth($args, 1);
			bottom: nth($args, 1);
			left: nth($args, 1);
		}
		@else if ($argsLength == 2) {
			top: nth($args, 1);
			bottom: nth($args, 1);
			left: nth($args, 2);
			right: nth($args, 2);
		}
		@else if ($argsLength == 3) {
			top: nth($args, 1);
			bottom: nth($args, 3);
			left: nth($args, 2);
			right: nth($args, 2);
		}
		@else {
			top: nth($args, 1);
			right: nth($args, 2);
			bottom: nth($args, 3);
			left: nth($args, 4);
		}
	}

}
