[FIX] theme_*: fix svg previews readability on safari

In Safari (14+) the CSS workaround to make block "readable" over any bg
is broken. By replacing the current CSS workaround by an appropriate
SVG filter in each themes svg, the problem will be fixed.
This commit will add the svg filter.

task-2667028

closes odoo/design-themes#522

Related: odoo/odoo#78617
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
xlu-odoo
2021-10-14 14:09:40 +00:00
committed by qsm-odoo
parent 208f6134a6
commit 545cf002ea
27 changed files with 1068 additions and 714 deletions
@@ -24,6 +24,19 @@
<pattern width="1" height="1" id="theme_treehouse_s_three_columns_default_image_3_id" patternunits="objectBoundingBox">
<image width="175" height="178" preserveAspectRatio="xMidYMid slice" href="#s_three_columns_default_image_3_url"/>
</pattern>
<filter id="filter_readability_treehouse">
<feColorMatrix in="SourceGraphic" type="saturate" values="0"/>
<feComponentTransfer>
<feFuncR type="table" tableValues="1 0"/>
<feFuncG type="table" tableValues="1 0"/>
<feFuncB type="table" tableValues="1 0"/>
</feComponentTransfer>
<feComponentTransfer>
<feFuncR type="linear" slope="10000" intercept="-4999.5"/>
<feFuncG type="linear" slope="10000" intercept="-4999.5"/>
<feFuncB type="linear" slope="10000" intercept="-4999.5"/>
</feComponentTransfer>
</filter>
</defs>
<!-- Layout -->
@@ -31,14 +44,14 @@
<g data-name="Header" class="svgc_menu">
<rect width="700" height="50" x="0" y="0" fill="#MENU_COLOR" class="svgc_menu_bg"/>
<text x="70" y="29" fill="#MENU_COLOR" class="svgc_text" font-size="14" font-family="Poppins, sans-serif" font-weight="500">LOGO</text>
<rect width="40" height="8" x="130" y="20" fill="#MENU_COLOR" class="svgc_text" opacity="0.5"/>
<rect width="40" height="8" x="180" y="20" fill="#MENU_COLOR" class="svgc_text" opacity="0.5"/>
<rect width="40" height="8" x="230" y="20" fill="#MENU_COLOR" class="svgc_text" opacity="0.5"/>
<rect width="40" height="8" x="490" y="20" fill="#MENU_COLOR" class="svgc_text" opacity="0.5"/>
<text x="70" y="29" fill="#MENU_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="14" font-family="Poppins, sans-serif" font-weight="500">LOGO</text>
<rect width="40" height="8" x="130" y="20" fill="#MENU_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<rect width="40" height="8" x="180" y="20" fill="#MENU_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<rect width="40" height="8" x="230" y="20" fill="#MENU_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<rect width="40" height="8" x="490" y="20" fill="#MENU_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<g class="svgc_btn_group">
<rect width="80" height="24" x="550" y="12" rx="12" fill="#3AADAA"/>
<text x="564" y="28" fill="#3AADAA" class="svgc_text" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Contact</text>
<text x="564" y="28" fill="#3AADAA" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Contact</text>
</g>
</g>
@@ -52,7 +65,7 @@
<rect width="200" height="8" x="250" y="280" fill="#FFFFFD" rx="2" opacity=".8"/>
<g class="svgc_btn_group">
<rect width="90" height="26" x="305" y="330" fill="#3AADAA" rx="13"/>
<text x="324" y="347" fill="#3AADAA" class="svgc_text" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Discover</text>
<text x="324" y="347" fill="#3AADAA" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Discover</text>
</g>
</g>
@@ -66,7 +79,7 @@
<rect width="120" height="6" x="70" y="614" rx="2" fill="#888"/>
<g class="svgc_btn_group">
<rect width="80" height="26" x="70" y="655" fill="#3AADAA" rx="13"/>
<text x="89" y="673" fill="#3AADAA" class="svgc_text" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Details</text>
<text x="89" y="673" fill="#3AADAA" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Details</text>
</g>
</g>
@@ -119,33 +132,33 @@
<rect width="120" height="6" x="290" y="1550" fill="#FFFFFD"/>
<g class="svgc_btn_group">
<rect width="90" height="24" rx="12" x="305" y="1578" fill="#3AADAA"/>
<text x="324" y="1594" fill="#3AADAA" class="svgc_text" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Contact</text>
<text x="324" y="1594" fill="#3AADAA" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="12" font-family="Poppins, sans-serif" font-weight="500">Contact</text>
</g>
</g>
<g data-name="Footer" class="svgc_footer">
<rect width="700" height="170" x="0" y="1645" fill="#FOOTER_COLOR" class="svgc_footer_bg"/>
<circle cx="573" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.5"/>
<circle cx="598" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.5"/>
<circle cx="623" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.5"/>
<rect width="560" height="1" x="70" y="1750" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="590" y="1778" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="590" y="1683" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="80" height="8" x="70" y="1683" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="120" height="8" x="70" y="1704" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="243" y="1683" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="385" y="1683" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="540" y="1778" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="490" y="1778" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="40" height="8" x="440" y="1778" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="70" height="8" x="243" y="1704" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<rect width="70" height="8" x="385" y="1704" fill="#FOOTER_COLOR" class="svgc_text" opacity="0.8"/>
<text x="70" y="1786" fill="#FOOTER_COLOR" class="svgc_text" font-size="14" font-family="Poppins, sans-serif" font-weight="500">LOGO</text>
<circle cx="573" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<circle cx="598" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<circle cx="623" cy="1708" r="8" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.5"/>
<rect width="560" height="1" x="70" y="1750" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="590" y="1778" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="590" y="1683" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="80" height="8" x="70" y="1683" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="120" height="8" x="70" y="1704" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="243" y="1683" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="385" y="1683" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="540" y="1778" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="490" y="1778" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="40" height="8" x="440" y="1778" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="70" height="8" x="243" y="1704" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<rect width="70" height="8" x="385" y="1704" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" opacity="0.8"/>
<text x="70" y="1786" fill="#FOOTER_COLOR" class="svgc_text" filter="url(#filter_readability_treehouse)" font-size="14" font-family="Poppins, sans-serif" font-weight="500">LOGO</text>
</g>
<g data-name="Copyright">
<rect width="700" height="40" x="0" y="1810" fill="#3AADAA"/>
<rect width="100" height="6" x="70" y="1828" rx="2" fill="#3AADAA" class="svgc_text"/>
<rect width="100" height="6" x="70" y="1828" rx="2" fill="#3AADAA" class="svgc_text" filter="url(#filter_readability_treehouse)"/>
<circle cx="350" cy="1810" r="20" fill="#3AADAA"/>
</g>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB