Liquid, JavaScript, themes, sales channels
I have an image Wave_Bottom.png in my Assets.
{{ 'Wave_Bottom.png' | asset_img_url: '122x35' }} in the body of a section produces the correct the URL. However:
background-image: url("{{ 'Wave_Bottom.png' | asset_img_url: '122x35' }}");
in the Stylesheet of the section produces:
which does not exist.
Any idea?
Solved! Go to the solution
This is an accepted solution.
Solved.
Turns out we can't have liquid inside {% stylesheet %}. So the solution is to have a <style></style> in the body of the section and complete ignore {% stylesheet %}.
I fail to see the point of {% stylesheet %}. I know it gets injected dynamically, but as soon as liquid is required (such as a background image), I need to move from {% stylesheet %} to <style>. Why would anyone ever use {% stylesheet %} ?
Hi @Basharc,
You can change the code:
background-image: url("{{ 'Wave_Bottom.png' | asset_img_url: '122x35' }}");
=>
background-image: url(Wave_Bottom.png);
Or please send your site and if your site is password protected, please send me the password.
I will check it for you.
url(Wave_Bottom.png) also produce an invalid URL
This is an accepted solution.
Solved.
Turns out we can't have liquid inside {% stylesheet %}. So the solution is to have a <style></style> in the body of the section and complete ignore {% stylesheet %}.
I fail to see the point of {% stylesheet %}. I know it gets injected dynamically, but as soon as liquid is required (such as a background image), I need to move from {% stylesheet %} to <style>. Why would anyone ever use {% stylesheet %} ?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024