From a1e8d116d5915cd0fc670af7508bf94187ce719b Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Tue, 24 May 2022 09:43:13 +0000 Subject: [PATCH] [FIX] mass_mailing: properly allow global customize separator colors The design tab allows the customization of the separators' colors but this is currently broken because it gets overridden by the default style of the snippet, which has higher specificity. Besides, the priority of styles was lost. closes odoo/odoo#92174 X-original-commit: 098202ba584ca6ba3544ccd00397578f5deb12ad Related: odoo/enterprise#27719 Signed-off-by: David Monjoie (dmo) --- .../static/src/js/mass_mailing_design_constants.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js index ed4a837608f..b692acd0678 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js @@ -28,7 +28,7 @@ export const PRIORITY_STYLES = { 'a:not(.btn)': [], 'a.btn.btn-primary': [], 'a.btn.btn-secondary': [], - 'hr': [], + 'hr': ['border-top-color'], }; export const RE_CSS_TEXT_MATCH = /([^{]+)([^}]+)/; export const RE_SELECTOR_ENDS_WITH_GT_STAR = />\s*\*\s*$/; @@ -75,7 +75,7 @@ export const splitCss = css => { if (!stylesToWrite[selectorToWriteTo]) { stylesToWrite[selectorToWriteTo] = []; } - stylesToWrite[selectorToWriteTo].push([style, styles[style]]); + stylesToWrite[selectorToWriteTo].push([style, styles[style] + (styles.getPropertyPriority(style) === 'important' ? ' !important' : '')]); } } }