[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:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user