@mixin _contained($t, $r, $b, $l) {
	position: absolute;
	top: $t; right: $r; bottom: $b; left: $l;
}

@mixin contained($offset...) {
	$o: $offset;
	$len: length($o);	

	@if ($len == 4) {
		@include _contained(nth($o, 1), nth($o, 2), nth($o, 3), nth($o, 4));
	} @else if ($len == 3) {
		@include _contained(nth($o, 1), nth($o, 2), nth($o, 3), nth($o, 2));
	} @else if ($len == 2) {
		@include _contained(nth($o, 1), nth($o, 2), nth($o, 1), nth($o, 2));
	} @else if ($len == 1) {
		@include _contained(nth($o, 1), nth($o, 1), nth($o, 1), nth($o, 1));
	} @else {
		@warn "contained mixin needs 1-4 args";
	}
}