@use 'sass:map';
@use '../utils';

$theme-prefix: ic-theme;
$typography-prefix: ic-typography;

@mixin ic-css-variables($map, $prefix, $ignore-root-keys) {
    $modified-map: $map;
    @each $key in $ignore-root-keys {
        $modified-map: map.remove($modified-map, $key);
    }

    $result: utils.flatten-map($modified-map, $path-items: [$prefix]);

    @each $key in map.keys($result) {
        #{$key}: map.get($result, $key);
    }
}

@mixin ic-theme-css-variables($ic-theme) {
    @include ic-css-variables($ic-theme, $theme-prefix, [icon]);
}
