diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-09-25 16:08:43 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-09-28 13:36:09 +0000 |
| commit | f8abb476fe0475799a3da66d49a92c7de2ace8a0 (patch) | |
| tree | 27830986dd76b36efa25aa5d7ba51aace1bfa613 /addons/website/static | |
| parent | 9391d16c1ae21cbae07e26e3ace524b0e0bfd0a2 (diff) | |
[IMP] web_editor, *: automatically increase default link color contrast
*: website
Inside a color combination (or outside, as considered the same as inside
color combination number 1), the link color can be configured. It is
set by themes to one of the 5 theme colors. Sometimes, no color of
those 5 colors contrast enough with the color combination's background
and we accepted that before, relying on the fact the user can change the
link color if he wants too. Now we automatically increase the contrast
of those link colors, except if the user overrides it.
This system might be extended to all foreground colors in the future but
the system has to be improved for that.
closes odoo/odoo#58538
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static')
| -rw-r--r-- | addons/website/static/src/scss/bootstrap_overridden.scss | 5 | ||||
| -rw-r--r-- | addons/website/static/src/scss/secondary_variables.scss | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/addons/website/static/src/scss/bootstrap_overridden.scss b/addons/website/static/src/scss/bootstrap_overridden.scss index 3827d79ff91..e43f068409b 100644 --- a/addons/website/static/src/scss/bootstrap_overridden.scss +++ b/addons/website/static/src/scss/bootstrap_overridden.scss @@ -29,7 +29,10 @@ $body-color: o-color('o-cc1-text') or color-yiq(o-color('o-cc1-bg')) !default; // // Style anchor elements. -$link-color: o-color('o-cc1-link') !default; +$-link-color: o-color('o-cc1-link'); +$-link-color: if($-link-color, $-link-color, o-color('primary')); +$link-color: auto-contrast($-link-color, o-color('o-cc1-bg'), 'o-cc1-link') !default; +$link-hover-color: auto-contrast(darken($link-color, 15%), o-color('o-cc1-bg'), 'o-cc1-link') !default; $link-decoration: if(o-website-value('link-underline') == 'always', underline, none) !default; $link-hover-decoration: if(o-website-value('link-underline') != 'never', underline, none) !default; diff --git a/addons/website/static/src/scss/secondary_variables.scss b/addons/website/static/src/scss/secondary_variables.scss index d35d8b8bf02..1f42a6155b4 100644 --- a/addons/website/static/src/scss/secondary_variables.scss +++ b/addons/website/static/src/scss/secondary_variables.scss @@ -127,6 +127,9 @@ $o-original-color-palette-number: $o-color-palette-number; $o-color-palette-number: length($o-color-palettes); $o-theme-color-palette-number: length($o-theme-color-palettes); +$o-we-auto-contrast-exclusions: () !default; +$o-we-auto-contrast-exclusions: join($o-we-auto-contrast-exclusions, map-keys(o-map-omit($o-user-color-palette))); + //------------------------------------------------------------------------------ // Fonts //------------------------------------------------------------------------------ |
