@function map-collect($maps...) {
	$collection: ();

	@each $map in $maps {
		$collection: map-merge($collection, $map);
	}
	@return $collection;
}


// a map-set function (not included with Sass)
@function map-set($map, $key, $value) {
	$new: (
		$key: $value
	);
	@return map-merge($map, $new);
}

@function to-map($list) {
	$newmap: ();
	@if type-of($list) == "list" {
		@each $item-name, $item-value in $list {
			$item: (
				"#{$item-name}": $item-value
			);
			$newmap: map-merge($newmap, $item);
		}
		@return $newmap;
	} @else if type-of($list) == "map" {
		@return $list;
	} @else {
		@return ();
	}
}

@function map-next($val, $map) {
  $list: map-keys($map);
  $index: (index($list, $value)) + 1;
  @if $index > length($list) {
    @return null;
  }
  @return nth($list, $index);
}
@function map-previous($val, $map) {
  $list: map-keys($map);
  $index: (index($list, $value)) - 1;
  @if $index < 0 {
    @return null;
  }
  @return nth($list, $index);
}

