@use "sass:map";
@use "../../functions/index" as fi;

$base-options: (allow-css-variables: false, theme: ());

@mixin theme($prefix, $options: ()) {
	$options: fi.merge($base-options, $options);
	$theme: map.get($options, 'theme');
	$allow-css-variables: map.get($options, 'allow-css-variables');

	@if  $allow-css-variables {
		#{$prefix} {
			@each $key, $value in $theme {
				--#{$key}: #{$value};
			}
		}
	}
}
