[FIX] web: use color-contrast instead of color-yiq
Previously, we were using the bootstrap 4 function "color-yiq" to choose a text color depending on the background color. Since the migration to BS5, color-yiq is no longer valid, and color-contrast should be used instead, but the wowl-views migration was maintained in parallel from the BS5 migration and some instance of this function call were added back with it. This commit fixes those. Functionally, this fixes the text color in the m2m_tags field. closes odoo/odoo#96598 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
//
|
||||
// Given two colors, returns the one which has the most constrast with another
|
||||
// given color. Careful: if you want to find the text color which will suit the
|
||||
// most on a given background color, you should use the 'color-yiq' function.
|
||||
// most on a given background color, you should use the 'color-contrast' function.
|
||||
//
|
||||
@function o-get-most-contrast($color, $c1, $c2, $background: #FFFFFF, $threshold: false, $cross-mix: true) {
|
||||
$background: if($background == null, #FFFFFF, $background);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
} @else {
|
||||
&, &::after {
|
||||
background-color: nth($o-colors, $size);
|
||||
color: color-yiq(nth($o-colors, $size));
|
||||
color: color-contrast(nth($o-colors, $size));
|
||||
}
|
||||
&:focus-within {
|
||||
background-color: darken(nth($o-colors, $size), 20%);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
&.btn-primary.disabled {
|
||||
background-color: $o-brand-odoo;
|
||||
color: color-yiq($o-brand-odoo);
|
||||
color: color-contrast($o-brand-odoo);
|
||||
|
||||
&:after, &:before {
|
||||
border-left-color: $o-brand-odoo;
|
||||
|
||||
Reference in New Issue
Block a user