summaryrefslogtreecommitdiff
path: root/addons/website/static/src/scss/bootstrap_overridden.scss
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-12 13:06:48 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-12 13:06:48 +0100
commit99d0e1b80e5b2d5eb59b96c6ce1bf246f8df2326 (patch)
tree6c53282f8a22e9b59d83762ebe057173172c5f63 /addons/website/static/src/scss/bootstrap_overridden.scss
parent4d53266e236d1816e45b13aa50bcafb1bab2bc8c (diff)
parenta403155dec769418ede3c9128a887847f97a956f (diff)
[MERGE] forward port branch 12.0 up to a403155dec7
Diffstat (limited to 'addons/website/static/src/scss/bootstrap_overridden.scss')
-rw-r--r--addons/website/static/src/scss/bootstrap_overridden.scss13
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/website/static/src/scss/bootstrap_overridden.scss b/addons/website/static/src/scss/bootstrap_overridden.scss
index 3f9b3de7ae7..4dc818b7eea 100644
--- a/addons/website/static/src/scss/bootstrap_overridden.scss
+++ b/addons/website/static/src/scss/bootstrap_overridden.scss
@@ -2,10 +2,15 @@
// Color system
//
-// TODO should take into account the final values of yiq-text-light and
-// yiq-text-dark, not consider it is white and black, but this is ok as a
-// first approximation.
-$-is-light: if(color('text') != null, (luma(color('text')) > 50%), null);
+// Bootstrap default for $yiq-text-light and $yiq-text-dark are $white and
+// $gray-900. What we want to do is use the user text color as light or dark
+// depending on its contrast. Themes should be careful if they decide to
+// override those values. This would be simplified by giving the user the choice
+// for its dark *and* light text colors.
+$-light: if($white != null, $white, #FFFFFF);
+$-dark: if($gray-900 != null, $gray-900, #212529);
+$-text: if(color('text') != null, color('text'), $-dark);
+$-is-light: (o-get-most-contrast($-text, $-light, $-dark, color('body'), $cross-mix: false) == $-dark);
$yiq-text-light: if($-is-light, color('text'), null);
$yiq-text-dark: if($-is-light, null, color('text'));