diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-05-28 10:04:50 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-06-02 12:17:23 +0000 |
| commit | 00f70f7936d37ec1c7c26065b2126045337e2825 (patch) | |
| tree | ede44cb84e8a3dd088c1a9cb06e8140ea9e4fbfb /addons/web | |
| parent | dadcec593d8328727b17f218c69fa1bc1433686f (diff) | |
[IMP] website, *: allow to use a color preset for menu and footer
*: web_editor, web
Also now allows to control the copyright section color.
This commit also allows to use color name alias when the user choose
one of the 5 main colors or a gray color for one component (e.g. if the
user picks 'o-color-1' as the color for its text in preset 4, then it
will no longer be linked to the current css color of 'o-color-1' but to
'o-color-1' directly; meaning that if that color changes in the future,
so will the text of preset 4).
Part of https://github.com/odoo/odoo/pull/52223
task-2197038
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/static/src/js/widgets/colorpicker.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/scss/bs_mixins_overrides.scss | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/colorpicker.js b/addons/web/static/src/js/widgets/colorpicker.js index 6b17431259a..8c3556df60f 100644 --- a/addons/web/static/src/js/widgets/colorpicker.js +++ b/addons/web/static/src/js/widgets/colorpicker.js @@ -592,6 +592,8 @@ ColorpickerWidget.convertCSSColorToRgba = function (cssColor) { // TODO maybe implement a support for receiving css color like 'red' or // 'transparent' (which are now considered non-css color by isCSSColor...) + // Note: however, if ever implemented be careful of 'white'/'black' which + // actually are color names for our color system... return false; }; diff --git a/addons/web/static/src/scss/bs_mixins_overrides.scss b/addons/web/static/src/scss/bs_mixins_overrides.scss index e12c41b7def..cc7ea1d4ec2 100644 --- a/addons/web/static/src/scss/bs_mixins_overrides.scss +++ b/addons/web/static/src/scss/bs_mixins_overrides.scss @@ -30,11 +30,11 @@ $enable-deprecation-messages: false !default; $o-yiq-min-opacity-threshold: 0.3 !default; $o-color-extras-nesting-selector: '&' !default; -@mixin o-bg-color($color, $text-color: null, $with-extras: true, $important: true, $yiq-min-opacity-threshold: $o-yiq-min-opacity-threshold, $nesting-selector: $o-color-extras-nesting-selector) { +@mixin o-bg-color($color, $text-color: null, $with-extras: true, $important: true, $yiq-min-opacity-threshold: $o-yiq-min-opacity-threshold, $background: $body-bg, $nesting-selector: $o-color-extras-nesting-selector) { @if ($color) { $-yiq-threshold-met: alpha($color) > $yiq-min-opacity-threshold; - $-yiq-color: if($text-color, $text-color, if($-yiq-threshold-met, color-yiq($color), null)); + $-yiq-color: if($text-color, $text-color, if($-yiq-threshold-met, color-yiq($color, $background: $background), null)); background-color: $color#{if($important, ' !important', '')}; color: $-yiq-color; // not important so that text utilities still work |
