Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm trying to figure out, how to override the current colour of an SVG that is actually inside an image. It seems actually only works with filters CSS, but I need it to work with HEX code. Is there any chance to recolor the SVG file uploaded via Metafield? Any help will be much appreciated.
The code:
{{- block.settings.custom_icon | image_url: width: block.settings.custom_icon.width | image_tag: loading: 'lazy', style: style, sizes: sizes, widths: widths, class: 'test-2' -}}
.test-2 { filter: invert(50%) sepia(92%) saturate(2575%) hue-rotate(161deg) brightness(94%) contrast(101%); }
what I want to make:
.test-2 { color: rgb(var(--text-color)) !important; } /*================ OR ================*/ .test-2 { color: #FFFF !important; } /*Note, nothing of above works*/
The input and output
(The idea is to recolor the custom icon by metafield...
Thank you so much
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025