/** Optimize values
  * @description coverts a list like: (5,5,5,5) to 5
  * @param $list
  */
@function optimize-values($list) {
	$match: true;
	$first: nth($list, 1);
	$result: $list;

	// If any list item doesn't match, set on match on false
	@for $i from 1 through length($list) {
		$e: nth($list, $i);

		@if $e != $first {
			$match: false;
		}
	}

	// If all items match then only use first value
	@if $match == true {
		$result: $first;
	}

	@return $result;
}
