1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 06:44:35 +02:00

Add check to rgba-css-var function for body or bg (#34699)

This commit is contained in:
Mark Otto
2021-08-10 07:16:48 -07:00
committed by GitHub
parent fd92e353d0
commit 612d235faf
3 changed files with 30 additions and 13 deletions

View File

@@ -37,11 +37,17 @@
@return red($value), green($value), blue($value);
}
// stylelint-disable scss/dollar-variable-pattern
@function rgba-css-var($identifier, $target) {
@return rgba(var(--#{$variable-prefix}#{$identifier}-rgb), var(--#{$variable-prefix}#{$target}-opacity));
@if $identifier == "body" and $target == "bg" {
@return rgba(var(--#{$variable-prefix}#{$identifier}-bg-rgb), var(--#{$variable-prefix}#{$target}-opacity));
} @if $identifier == "body" and $target == "text" {
@return rgba(var(--#{$variable-prefix}#{$identifier}-color-rgb), var(--#{$variable-prefix}#{$target}-opacity));
} @else {
@return rgba(var(--#{$variable-prefix}#{$identifier}-rgb), var(--#{$variable-prefix}#{$target}-opacity));
}
}
// stylelint-disable scss/dollar-variable-pattern
@function map-loop($map, $func, $args...) {
$_map: ();