[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.
This commit is contained in:
qsm-odoo
2018-10-01 21:33:32 +02:00
parent 89678c6041
commit 8b2dbd1441
+6 -1
View File
@@ -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
//