diff --git a/scss/_variables.scss b/scss/_variables.scss index 3114eac922..620fb8040c 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -96,6 +96,18 @@ $theme-colors: map-merge( ); // Boosted mod +$supporting-colors: () !default; +// stylelint-disable-next-line scss/dollar-variable-default +$supporting-colors: map-merge( + ( + "success": $teal, + "info": $cyan, + "warning": $yellow-2, + "danger": $pink, + "purple": $purple + ), + $supporting-colors +); $chevron-icon: url("data:image/svg+xml,") !default; $chevron-icon-hover: url("data:image/svg+xml,") !default; $chevron-icon-active: url("data:image/svg+xml,") !default; diff --git a/scss/utilities/_background.scss b/scss/utilities/_background.scss index a997b1bdda..c85ce9d789 100644 --- a/scss/utilities/_background.scss +++ b/scss/utilities/_background.scss @@ -1,9 +1,23 @@ // stylelint-disable declaration-no-important @each $color, $value in $theme-colors { - @include bg-variant(".bg-#{$color}", $value, true); + // Boosted mod: disallow functionnal colors for background + @if ($value != $success) and ($value != $danger) and ($value != $info) and ($value != $warning) { + @include bg-variant(".bg-#{$color}", $value, true); + } +} + +// Boosted mod: supporting colour as background +@each $color, $value in $supporting-colors { + @include bg-variant(".bg-#{$color}", $value); } +.bg-teal { @extend .bg-success; } +.bg-cyan { @extend .bg-info; } +.bg-yellow { @extend .bg-warning; } +.bg-pink { @extend .bg-danger; } +// end mod + @if $enable-gradients { @each $color, $value in $theme-colors { @include bg-gradient-variant(".bg-gradient-#{$color}", $value); diff --git a/site/docs/4.4/utilities/colors.md b/site/docs/4.4/utilities/colors.md index 14bf9edb42..a459e1ba90 100644 --- a/site/docs/4.4/utilities/colors.md +++ b/site/docs/4.4/utilities/colors.md @@ -50,10 +50,16 @@ Similar to the contextual text color classes, easily set the background of an el {% capture example %} -{% for color in site.data.theme-colors %} -
.bg-{{ color.name }}
{% endfor %} -
.bg-white
-
.bg-transparent
+
.bg-primary
+
.bg-secondary
+
.bg-success or .bg-teal
+
.bg-danger or .bg-pink
+
.bg-warning or .bg-yellow
+
.bg-info or .bg-cyan
+
.bg-purple
+
.bg-light
+
.bg-white
+
.bg-transparent
{% endcapture %} {% include example.html content=example %}