@use "sass:map";
@use '../00-abstract/index' as *;
@use "../tokens/variables";

/* Usefull - Shadow */
////
/// @group UsefullClasses-Shadow
/// Usefull - Shadow

// Maps old shadow names to token SCSS variables (null = no box-shadow / 'none')
$osui-shadow-token-vars: (
	'none': null,
	'xs': variables.$token-elevation-1,
	's': variables.$token-elevation-1,
	'm': variables.$token-elevation-2,
	'l': variables.$token-elevation-3,
	'xl': variables.$token-elevation-4
);

///
.shadow {
	@each $type, $value in $osui-shadow-types {
		$token: map.get($osui-shadow-token-vars, $type);
		&-#{$type} {
			@if $token == null {
				box-shadow: none;
			} @else {
				box-shadow: #{$token};
			}
		}
	}
}
