At the time of writing this answer, none of the following vars exist in Bootstrap: $alert-color
, $alert-bg
nor $alert-border-color
.
The value you try to modify are defined like this in Bootstrap source code:
.alert {
--#{$prefix}alert-bg: transparent;
--#{$prefix}alert-color: inherit;
--#{$prefix}alert-border-color: transparent;
color: var(--#{$prefix}alert-color);
background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border);
}
So as you said you might want to use CSS vars instead (the following example modify the color or all alerts as orange):
.alert {
--#{$prefix}alert-color: #{$orange}; // or --bs-alert-color: #{$orange};
}
There's another way to do this kind of things but it will only add a new theme color for each component and I'm not sure that's what you want:
$custom-colors: (
"custom-color": #f61
);
$theme-colors: map-merge($theme-colors, $custom-colors);
So you'll be able to use:
<div class="alert alert-custom-color" role="alert">
A simple custom color alert—check it out!
</div>
But also
<button type="button" class="btn btn-custom-color">Primary</button>
Third possibility:
.alert-custom-color { // Creating your own class
// .alert would modify all the alerts
// .alert-warning would modify the rendering only for this one
@include alert-variant(green, violet, yellow);
}