Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

background css within theme.scss.liquid #626

Closed
mjoyce opened this issue Jun 7, 2018 · 3 comments
Closed

background css within theme.scss.liquid #626

mjoyce opened this issue Jun 7, 2018 · 3 comments
Assignees

Comments

@mjoyce
Copy link

mjoyce commented Jun 7, 2018

Problem

I'm trying to use the background-image css property within theme.scss.liquid, i.e:

background-image: url({{ '../images/sprites/social-icons-sprite.png' | asset_url }});

The resultant asset url:

//cdn.shopify.com/s/files/1/0017/3968/5949/t/3/assets/../images/sprites/social-icons-sprite.png?8360082786597144940

This does not render for me.

Yet when place that same liquid code in sections/footer.liquid, i.e:

<a style="background-image: url({{ '../assets/images/social-icons-sprite.png' | asset_url }})" .../>

The resultant asset url of http://localhost/social-icons-sprite.png renders properly.

For lack of better phrasing, what am I missing here?

@huguestennier
Copy link
Contributor

I can reproduce, so i'm gonna label it as bug.

Meanwhile, you can always put your images in the static folder (under assets). Since everything is under the same folder in dist, you don't have to specify the path when using | asset_url :

{{ 'social-icons-sprite.png' | asset_url }} will work fine.

@t-kelly
Copy link
Contributor

t-kelly commented Oct 25, 2018

@t-kelly t-kelly closed this as completed Oct 25, 2018
@lock
Copy link

lock bot commented Nov 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants