@use "sass:map";
@use "sass:color";
@use "../../variables" as *;

///
/// Mixin that applies background color using a key from $color_theme
/// @param {String} $key - The color token key
///
@mixin object--fill($key) {
    background-color: var(--color_#{$key});
}

// Generate utility classes and emit CSS custom properties
@each $key, $value in $color_theme {
    // Solid fill class
    .object--fill--#{$key} {
        @include object--fill($key);
    }

    // Tinted fills using precomputed --color_*--XX variables
    @each $label, $amount in $tint-levels {
        .object--fill--#{$key}--#{$label} {
            background-color: var(--color_#{$key}--#{$label});
        }
    }
}
