Use a mixin for setting bs css variables
Prerequisites
-
I have searched for duplicate or closed feature requests -
I have read the contributing guidelines
Proposal
In my opinion it would be nice to use some kind of a mixin to set bs css variables. For example we could use this mixin to set css variables. In this way users don't require to start the var name with the $prefix variable when they are customizing bootstrap to their own needs.
@mixin set-var($name, $value) {
--#{$prefix}#{$name}: #{$value};
}
.card-primary {
$background: blue;
$border: if($color == $color-contrast-light, shade-color($background, 10%), tint-color($background, 10%));
$color: color-contrast($background);
@include set-var(card-border-color, $border);
@include set-var(card-cap-bg, $background);
@include set-var(card-cap-color, $color);
@include set-var(card-color, $color);
@include set-var(card-bg, tint-color($background, 5%));
}
Motivation and context
I see a lot of repetitive variables using the $prefix variable directly in sass. In my opinion this could be better, so that users who like to customize bootstrap don't have to do much