// Casts `$list` into a map, using indexes as keys (starting with `$start`).
// Useful for iterating through a list with an index variable.
// e.g. `@each $index, $value in to-map($list)`
//
// @author Andrey "Lolmaus" Mikhaylov and Chris Eppstein
//
// @ignore Documentation: http://sassylists.com/documentation.html#sl-to-map
//
// @param {List} $list - list to turn into map
//
// @requires sl-range
//
// @throws List cannot be empty for `sl-to-map`.
//
// @return {Map | Null}
@function sl-to-map($list) {
@if sl-missing-dependencies(sl-range) { @return null; }
@if length($list) == 0 {
@warn "List cannot be empty for `sl-to-map`.";
@return null;
}
@return zip(sl-range(length($list)), $list);
}