[FIX] web_editor: restore snippet button text colors

This reverts commit [1]. It broke all snippet button colors, making
them invisible. Besides that, the fix seems not obvious to make properly
and would thus require some more testing, thus the need of reverting
this urgently.

There is probably more things to consider when remaking that fix:
- mass_mailing scss code in web_editor should not be a thing. Even if
  the comment about variables not being accessible is true, there are
  definitely other ways to do it (make them accessible, add those rules
  generically with a custom selector and fill that custom selector when
  mass_mailing is installed, etc etc)
- More than scss code, we really do not want mass_mailing *CSS* rules
  in website pages, especially in that code that generates *many* CSS
  rules. Of course web_editor.common.scss contains many things that
  should not be there and mass_mailing has probably already a lot of
  useless code in the frontend assets... but the goal is to fix those
  inconsistencies in the future.
- The fix impacts buttons which are not hovered while the goal seemed to
  be to have their hover style disabled...
- The fix impacts buttons which are in o_ccX environments only (?) but
  seemed to be about disabling all hover styles.
- Much doubt on the need of an at-root instruction, especially since
  it creates a bug in frontend pages without o_mail_wrapper containers
  so it probably does not work as intended.
- The fix should probably not be about overriding/duplicating the CSS
  rules but rather post-processing the mass_mailing assets to remove all
  hover rules. I guess it is even possible to do in JS removing the
  :hover CSS rules, at worst by moving all CSS rules to inline <style>
  rules or something like that.

Note: the main bug about button text being invisible is apparently from
16.0 and up only. This still reverts the code at its root (15.2) for all
mentioned reasons above.

[1]: https://github.com/odoo/odoo/commit/55aff2dcdf5537e16bdaf01ee68d776510572171

task-3376724

closes odoo/odoo#126116

X-original-commit: a6e861b19002b02e369d6b7c1ed5fe1401e77028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2023-06-23 16:35:30 +02:00
parent 66165e81ac
commit 8618d34953
@@ -767,16 +767,6 @@ blockquote {
.btn-outline-primary {
@include button-outline-variant($-btn-primary-border-color);
}
@at-root .o_mail_wrapper #{&}, .o_mail_wrapper {
// This requires variable definitions that are only available
// here in web_editor (not in mass_mailing).
.btn-fill-primary, .btn-primary {
@include button-variant($-btn-primary-color, $-btn-primary-border-color, $-btn-primary-color, $-btn-primary-border-color, $-btn-primary-color, $-btn-primary-border-color);
}
.btn-outline-primary {
@include button-outline-variant($-btn-primary-border-color, $-btn-primary-border-color, transparent);
}
}
// Secondary
$-btn-secondary-color: if($-btn-secondary, o-color($-btn-secondary), map-get($theme-colors, 'secondary'));
@@ -787,24 +777,6 @@ blockquote {
.btn-outline-secondary {
@include button-outline-variant($-btn-secondary-border-color);
}
@at-root .o_mail_wrapper #{&}, .o_mail_wrapper {
// This requires variable definitions that are only available
// here in web_editor (not in mass_mailing).
.btn-fill-secondary, .btn-secondary {
@include button-variant($-btn-secondary-color, $-btn-secondary-border-color, $-btn-secondary-color, $-btn-secondary-border-color, $-btn-secondary-color, $-btn-secondary-border-color);
}
.btn-outline-secondary {
@include button-outline-variant($-btn-secondary-border-color, $-btn-secondary-border-color, transparent);
}
.btn-custom:hover,
.btn-fill-custom:hover {
filter: invert(0);
}
.btn-outline-custom:hover {
background-color: transparent !important;
background-image: none !important;
}
}
// 'Active' states. Note: this only emulates very common components
// used in snippets. This might need to be more complex the day we