[FIX] theme_*: remove duplicate and conflicting classes

When default snippets have been updated to rely on color presets ([1]),
some themes were not adapted accordingly.
This also happened whenever paddings of base blocks were modified.
Because of this there are elements in themes for which some classes are
applied several times, and some where classes are not removed before
adding a contradicting one.

This commit adjusts the classes so that themes neither:
- produce snippets with duplicated classes
- produce snippets with contradicting classes (e.g. two different
bottom paddings on the same element)

This commit also fixes a typo from [2] which was the source of
duplicate classes.

[1]: https://github.com/odoo/odoo/commit/5953c4df6b9c08519f64a65c1cf5d5558d59f7d4
[2]: https://github.com/odoo/design-themes/commit/299d504df31bf179775eec1d37e71605c3637460#diff-86c142838104de06e89f629c51cf791464538dc8899e6a3f00c24f69638db409R34

task-3562147

X-original-commit: f3da06dc68
Part-of: odoo/design-themes#744
This commit is contained in:
Benoit Socias
2023-10-23 14:43:38 +02:00
parent de9d56190e
commit 76e9cbcdb6
44 changed files with 70 additions and 99 deletions
+3 -3
View File
@@ -8,7 +8,7 @@
</xpath>
<!-- Column #01 -->
<xpath expr="//div[hasclass('row')]/div[1]" position="attributes">
<attribute name="class" add="o_cc o_cc1 pt48 pb48" separator=" "/>
<attribute name="class" add="o_cc o_cc1 pt48 pb48" remove="pt32 pb32" separator=" "/>
</xpath>
<xpath expr="//div[hasclass('row')]/div[1]/i" position="replace">
<i class="fa fa-2x fa-image bg-o-color-1 m-3 rounded-circle"/>
@@ -21,7 +21,7 @@
</xpath>
<!-- Column #02 -->
<xpath expr="//div[hasclass('row')]/div[2]" position="attributes">
<attribute name="class" add="o_cc o_cc1 pt48 pb48" separator=" "/>
<attribute name="class" add="o_cc o_cc1 pt48 pb48" remove="pt32 pb32" separator=" "/>
</xpath>
<xpath expr="//div[hasclass('row')]/div[2]/i" position="replace">
<i class="fa fa-2x fa-eye bg-o-color-5 m-3 rounded-circle"/>
@@ -34,7 +34,7 @@
</xpath>
<!-- Column #03 -->
<xpath expr="//div[hasclass('row')]/div[3]" position="attributes">
<attribute name="class" add="o_cc o_cc1 pt48 pb48" separator=" "/>
<attribute name="class" add="o_cc o_cc1 pt48 pb48" remove="pt32 pb32" separator=" "/>
</xpath>
<xpath expr="//div[hasclass('row')]/div[3]/i" position="attributes">
<attribute name="class" add="fa-2x fa-microphone rounded-circle" remove="fa-3x fa-leaf rounded" separator=" "/>
+1 -1
View File
@@ -4,7 +4,7 @@
<template id="s_media_list" inherit_id="website.s_media_list">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="o_cc2 pt64 pb64" remove="o_cc1 pt32 pb32" separator=" "/>
<attribute name="class" add="pt64 pb64" remove="pt32 pb32" separator=" "/>
<attribute name="data-oe-shape-data">{"shape":"web_editor/Floats/01","flip":[]}</attribute>
</xpath>
<!-- Shape -->
+1 -1
View File
@@ -4,7 +4,7 @@
<template id="s_numbers" inherit_id="website.s_numbers">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="o_cc o_cc2 pt0 pb48" remove="pt24 pb24" separator=" "/>
<attribute name="class" add="pt0 pb48" remove="pt24 pb24" separator=" "/>
</xpath>
<!-- Replace h6 by paragraphs -->
<xpath expr="//h6" position="replace" mode="inner">