diff options
Diffstat (limited to 'addons/website/static/src/scss/bootstrap_overridden.scss')
| -rw-r--r-- | addons/website/static/src/scss/bootstrap_overridden.scss | 13 |
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')); |
