@use 'sass:map';
@use '../../mixins/background-variant';
@use '../../variables';
@use '../functions-variables';

// stylelint-disable declaration-no-important

$bg-colors: () !default;
$bg-colors: map.merge(
    (
        '.bg-lighter': variables.$bg-lighter,
        '.bg-bright': variables.$bg-bright,
        '.bg-secondary': variables.$bg-secondary,
        '.bg-content': variables.$bg-content,
        '.bg-primary': variables.$bg-primary,
        '.bg-success': variables.$bg-success,
        '.bg-info': variables.$bg-info,
        '.bg-warning': variables.$bg-warning,
        '.bg-danger': variables.$bg-danger,
        '.bg-light': variables.$bg-light,
        '.bg-dark': variables.$bg-dark
    ),
    $bg-colors
);

$bg-subtle-colors: () !default;
$bg-subtle-colors: map.merge(
    (
        '.bg-primary-subtle': color-mix(in srgb, variables.$bg-primary 10%, transparent),
        '.bg-success-subtle': color-mix(in srgb, variables.$bg-success 10%, transparent),
        '.bg-info-subtle': color-mix(in srgb, variables.$bg-info 10%, transparent),
        '.bg-warning-subtle': color-mix(in srgb, variables.$bg-warning 10%, transparent),
        '.bg-danger-subtle': color-mix(in srgb, variables.$bg-danger 10%, transparent),
        '.bg-light-subtle': color-mix(in srgb, variables.$bg-light 10%, transparent),
        '.bg-dark-subtle': color-mix(in srgb, variables.$bg-dark 10%, transparent)
    ),
    $bg-subtle-colors
);

@each $color, $value in $bg-colors {
    @include background-variant.bg-variant($color, $value, true);
}

@each $color, $value in $bg-subtle-colors {
    @include background-variant.bg-variant($color, $value, true);
}

@if variables.$enable-gradients {
    @each $color, $value in functions-variables.$theme-colors {
        @include background-variant.bg-gradient-variant('.bg-gradient-#{$color}', $value, true);
    }
}

.bg-white {
    background-color: variables.$white !important;
}

.bg-default {
    background-color: variables.$bg-default !important;
}

.bg-transparent {
    background-color: transparent !important;
}
