[REF] web: backport .text-bg-#{$color} from BS 5.2

Add the new helper `.text-bg-#{$color}` to restore the old behaviour like in
BS4 for the `.bg-#{$color}`

In short, in BS5 `.bg-#{$color}` don't change anymore the text color but
only the background. `.text-bg-#{$color}` change both color text and
background.

Task ID: 2766483

Part-of: odoo/odoo#95450
This commit is contained in:
Romeo Fragomeli
2022-07-07 13:30:16 +02:00
parent 03f95c0f6d
commit 8d8afbddf5
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -327,6 +327,7 @@ This module provides the core of the Odoo Web Client.
],
'web._assets_bootstrap': [
'web/static/src/legacy/scss/import_bootstrap.scss',
'web/static/src/libs/bootstrap/helpers_backport.scss',
'web/static/src/legacy/scss/bootstrap_review.scss',
],
'web._assets_backend_helpers': [
@@ -0,0 +1,14 @@
// Backport from BS 5.2
// TODO remove me when migrate to new Bootstrap 5.2 +
$prefix: '' !default;
$theme-colors: () !default;
// 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;
}
}