summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-10-01 16:45:37 +0200
committerqsm-odoo <qsm@odoo.com>2018-10-01 21:33:32 +0200
commit8b2dbd1441d6713d9072db03e8d3cb6c2246410f (patch)
treef6f2b5737582567fb2929739dc303150b1332f1b
parent89678c60412feea004cd3081200092365e6ef3b4 (diff)
[FIX] website: handle light colors as body text color
Before this commit, if the user chose a light color for the text (with a dark color for the body for example), that color was also used for the automatic "dark" color, leaving the "light" color to the default $white. That means that when a light snippet background was set, the automatic color which was used was the light color the user chose. We want to invert the system in that case: use the user color as the "light" color to use over dark backgrounds and leave the "dark" color to the default $gray-900. This is what this commit does.
-rw-r--r--addons/website/static/src/scss/bootstrap_overridden.scss7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/website/static/src/scss/bootstrap_overridden.scss b/addons/website/static/src/scss/bootstrap_overridden.scss
index d82f6ccd096..3f9b3de7ae7 100644
--- a/addons/website/static/src/scss/bootstrap_overridden.scss
+++ b/addons/website/static/src/scss/bootstrap_overridden.scss
@@ -2,7 +2,12 @@
// Color system
//
-$yiq-text-dark: color('text');
+// 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);
+$yiq-text-light: if($-is-light, color('text'), null);
+$yiq-text-dark: if($-is-light, null, color('text'));
// Body
//