/// @name generate-icon-by-size
/// @author Stevan Stojanovic
/// @group mixins
/// @require {variable} $list-of-custom-icon-names
/// @require {variable} $icon-path
/// @param   {map}      $map  [$$list-of-custom-icon-names] of icons stored by theirs size
/// @param   {string}   $unit ['rem'] unit used for determining size of the icon wrapper
/// in order to generate this icons you must include this mixin into related project on main file
@mixin generate-icon-by-size(
	$map: $list-of-custom-icon-names,
	$unit: 'rem',
	$path: $icon-path) {
	$map-keys: map-keys($map);
	
	@each $key in $map-keys {
		
		@each $sub-key in map-deep-get($map, $key) {
			
			.#{$sub-key}-icon {
				align-items: center;
				cursor: pointer;
				display: inline-flex;
				height: unquote($key) + unquote($unit);
				justify-content: center;
				position: relative;
				width: unquote($key) + unquote($unit);
				
				&::before {
					background-image: url($path + $sub-key + '.svg');
					background-position: center;
					background-size: contain;
					content: '';
					height: inherit;
					width: inherit;
				}
			}
		}
	}
}
