From 815d64d48bf2bf490311541dff85c7154b76d7dd Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 18 Nov 2022 09:26:38 +0000 Subject: [PATCH] [FIX] web_editor: removes blue filter on selected image in edit mode This commit removes the default image selection color (added by this commit: [1]) used in "web_editor" in edit mode (Website, Email Marketing). This prevents selected images from being covered with a blue filter and allows to see the correct final rendering of an image when it is edited (e.g. Apply a color filter to an image in a website page). This commit also moves the rule (added by this commit: [2]) that overridden the portal selection rule to "web_editor.frontend" because it was applied everywhere even outside of the website/email marketing edit mode. This rule no longer worked because of the "!important" in [1]. [1]: https://github.com/odoo/odoo/commit/3da301fcb24998333039a7b636cec0e5be8694c6 [2]: https://github.com/odoo/odoo/commit/aa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c task-3073192 closes odoo/odoo#108732 X-original-commit: 19bebfc29f5c94ab11dab1fac2e6676eaab51592 Signed-off-by: Guillaume-gdi --- .../static/src/scss/web_editor.frontend.scss | 10 ++++++++++ addons/web_editor/static/src/scss/wysiwyg.scss | 6 +----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/web_editor/static/src/scss/web_editor.frontend.scss b/addons/web_editor/static/src/scss/web_editor.frontend.scss index d949eae7ea9..c95b964d41f 100644 --- a/addons/web_editor/static/src/scss/web_editor.frontend.scss +++ b/addons/web_editor/static/src/scss/web_editor.frontend.scss @@ -69,3 +69,13 @@ object-fit: contain !important; } } + +// Override the default image selection color used in "web_editor". This +// prevents selected images from being covered with a blue filter in edit mode +// (Website, Email Marketing). This allows to see the correct final rendering +// of an image when it is edited. +body.editor_enable:not(.o_basic_theme) .odoo-editor-editable { + img::selection { + background-color: transparent !important; + } +} diff --git a/addons/web_editor/static/src/scss/wysiwyg.scss b/addons/web_editor/static/src/scss/wysiwyg.scss index ff39e9b2f90..abbea20d849 100644 --- a/addons/web_editor/static/src/scss/wysiwyg.scss +++ b/addons/web_editor/static/src/scss/wysiwyg.scss @@ -501,11 +501,7 @@ img.o_we_selected_image { .fa.o_we_selected_image::before { @extend %o-we-selected-image; } -// Override default image selection color from portal. It prevents your from -// seeing the images' quality clearly in the wysiwyg. -img::selection { - background: transparent; -} + .o_we_media_author { font-size: 11px; @include o-position-absolute($bottom: 0, $left: 0, $right: 0);