Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/scss
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2022-04-28 06:40:23 +0300
committerMark Otto <otto@github.com>2022-04-30 22:55:27 +0300
commit8cd3c3e3bc6b966c2be9491091ad1c0c629a4b30 (patch)
tree757fa297a0bb15fbaeedfabc581c74b3c2c15510 /scss
parentec41392717c767ae0c862e30967774e9a5d6ba7a (diff)
Add new text-bg-color utilities
Diffstat (limited to 'scss')
-rw-r--r--scss/_helpers.scss1
-rw-r--r--scss/helpers/_color-bg.scss10
2 files changed, 11 insertions, 0 deletions
diff --git a/scss/_helpers.scss b/scss/_helpers.scss
index 4a989f5a5c..644b693fbc 100644
--- a/scss/_helpers.scss
+++ b/scss/_helpers.scss
@@ -1,4 +1,5 @@
@import "helpers/clearfix";
+@import "helpers/color-bg";
@import "helpers/colored-links";
@import "helpers/ratio";
@import "helpers/position";
diff --git a/scss/helpers/_color-bg.scss b/scss/helpers/_color-bg.scss
new file mode 100644
index 0000000000..80ba863034
--- /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;
+ }
+}