[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
+1 -1
View File
@@ -42,7 +42,7 @@
<!-- Carousel-item #03 -->
<xpath expr="//div[hasclass('carousel-item')][3]" position="attributes">
<attribute name="class" add="o_cc o_cc5 pt152 pb152" remove="pb112 pt112" separator=" "/>
<attribute name="class" add="o_cc o_cc5 pt152 pb152" remove="pb128 pt128" separator=" "/>
</xpath>
<!-- Shape & filter -->
<xpath expr="//div[hasclass('carousel-item')][3]//div[hasclass('container')]" position="before">
@@ -28,7 +28,7 @@
</xpath>
<!-- Card #3 -->
<xpath expr="(//div[hasclass('card')])[3]" position="attributes">
<attribute name="class" add="bg-o-color-1" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-1" remove="bg-o-color-2" separator=" "/>
</xpath>
<!-- Card #3 - Button -->
<xpath expr="(//a[hasclass('btn')])[3]" position="attributes">
+2 -2
View File
@@ -13,11 +13,11 @@
</xpath>
<!-- Feature #01 - Icon -->
<xpath expr="//i" position="attributes">
<attribute name="class" add="bg-o-color-5" remove="bg-primary" separator=" "/>
<attribute name="class" add="bg-o-color-5" remove="bg-o-color-1" separator=" "/>
</xpath>
<!-- Feature #03 - Icon -->
<xpath expr="(//i)[3]" position="attributes">
<attribute name="class" add="bg-o-color-5" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-5" remove="bg-o-color-2" separator=" "/>
</xpath>
</template>
@@ -17,13 +17,13 @@
<attribute name="class" add="rounded" remove="rounded-circle" separator=" "/>
</xpath>
<xpath expr="(//i)[4]" position="attributes">
<attribute name="class" add="bg-o-color-1" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-1" remove="bg-o-color-2" separator=" "/>
</xpath>
<xpath expr="(//i)[5]" position="attributes">
<attribute name="class" add="bg-o-color-1" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-1" remove="bg-o-color-2" separator=" "/>
</xpath>
<xpath expr="(//i)[6]" position="attributes">
<attribute name="class" add="bg-o-color-1" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-1" remove="bg-o-color-2" separator=" "/>
</xpath>
</template>
@@ -8,10 +8,10 @@
</xpath>
<!-- Icons -->
<xpath expr="//i" position="attributes">
<attribute name="class" add="bg-o-color-5" remove="bg-primary" separator=" "/>
<attribute name="class" add="bg-o-color-5" remove="bg-o-color-1" separator=" "/>
</xpath>
<xpath expr="(//i)[3]" position="attributes">
<attribute name="class" add="bg-o-color-5" remove="bg-secondary" separator=" "/>
<attribute name="class" add="bg-o-color-5" remove="bg-o-color-2" separator=" "/>
</xpath>
<xpath expr="(//i)[4]" position="attributes">
<attribute name="class" add="bg-o-color-5" remove="bg-o-color-3" separator=" "/>
@@ -4,7 +4,7 @@
<template id="s_three_columns" inherit_id="website.s_three_columns">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="o_cc4 o_colored_level" remove="o_cc2" separator=" "/>
<attribute name="class" add="o_cc4" remove="o_cc2" separator=" "/>
</xpath>
<!-- Column #1 -->
<xpath expr="//div[hasclass('card')]" position="attributes">