aboutsummaryrefslogtreecommitdiff
path: root/scss/helpers
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2022-04-27 20:40:23 -0700
committerMark Otto <[email protected]>2022-04-30 12:55:27 -0700
commit8cd3c3e3bc6b966c2be9491091ad1c0c629a4b30 (patch)
tree757fa297a0bb15fbaeedfabc581c74b3c2c15510 /scss/helpers
parentec41392717c767ae0c862e30967774e9a5d6ba7a (diff)
downloadbootstrap-8cd3c3e3bc6b966c2be9491091ad1c0c629a4b30.tar.xz
bootstrap-8cd3c3e3bc6b966c2be9491091ad1c0c629a4b30.zip
Add new text-bg-color utilities
Diffstat (limited to 'scss/helpers')
-rw-r--r--scss/helpers/_color-bg.scss10
1 files changed, 10 insertions, 0 deletions
diff --git a/scss/helpers/_color-bg.scss b/scss/helpers/_color-bg.scss
new file mode 100644
index 000000000..80ba86303
--- /dev/null
+++ b/scss/helpers/_color-bg.scss
@@ -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;
+ }
+}