From 8b2dbd1441d6713d9072db03e8d3cb6c2246410f Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 1 Oct 2018 16:45:37 +0200 Subject: [PATCH] [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. --- addons/website/static/src/scss/bootstrap_overridden.scss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 //