@use "sass:map";
@use "./helper" as fh;
@use "../variables/default" as vd;
@use "../variables/theme" as vt;

@function themefix($value, $rest...) {
	$options: fh.merge((allow-css-variables: vd.$allow-css-variables, theme: vt.$theme), $rest...);
	$theme: map.get($options, 'theme');

	@if vd.$allow-css-variables {
		@return var(--#{$value});
	}

	@return map.get($theme, $value);
}
