1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-29 16:19:53 +02:00

Add new text-bg-color utilities

This commit is contained in:
Mark Otto
2022-04-27 20:40:23 -07:00
committed by Mark Otto
parent ec41392717
commit 8cd3c3e3bc
4 changed files with 64 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
@import "helpers/clearfix";
@import "helpers/color-bg";
@import "helpers/colored-links";
@import "helpers/ratio";
@import "helpers/position";

View File

@@ -0,0 +1,10 @@
// stylelint-disable declaration-no-important, function-name-case
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
@each $color, $value in $theme-colors {
$color-rgb: to-rgb($value);
.text-bg-#{$color} {
color: color-contrast($value) !important;
background-color: RGBA($color-rgb, var(--#{$prefix}bg-opacity, 1)) !important;
}
}