Shopify themes, liquid, logos, and UX
Hello,
Im new to Shopify theme development. So far all the documentation has been great, but I've run into a problem with my style.css.liquid file not connecting. I'm using a framework called Codyhouse, along with Theme Kit and I'm using gulp to compile my scss files and output it in the assets folder as "style.css.liquid". Here's a screenshot of my structure:
Everything in the assets file seems connected, except the style.css.liquid file.
Everything looks to be outputting correctly without error, so I don't know how to get that file up and running. Do I need to put it in a different folder or rename the file?
Here's a little of the style.css.liquid file:
Solved! Go to the solution
This is an accepted solution.
Please try replacing like this : <link rel='stylesheet' type='text/css' media='screen' href='{{ 'style.css' | asset_url }}'>
or remove .liquid {{ 'style.css' | asset_url | stylesheet_tag }}
If helpful then please Like and Accept Solution.
This is an accepted solution.
Please try replacing like this : <link rel='stylesheet' type='text/css' media='screen' href='{{ 'style.css' | asset_url }}'>
or remove .liquid {{ 'style.css' | asset_url | stylesheet_tag }}
If helpful then please Like and Accept Solution.
Thanks!
I had a script in my gulp file that converted sass to a "css.liquid file". I changed it to output a normal ".css " file and linked it up how you described and it worked.
Turns out, less was more.
I'm running into this issue as well. For context, I'm using the latest shopify cli with online store 2.0 for local development. I'm using gulp in order to use postcss in my css files and then I'm using gulp to rename the .css files to end in a .css.liquid format.
If I remove the .liquid as you suggest, the file is loaded by the browser, however, the liquid code between the curly braces {{ some liquid variable }} is not transpiled by shopify into its associated value. It is my understanding that even though Shopify has deprecated SCSS, we are still allowed to use .css.liquid files in our theme as needed. https://shopify.dev/themes/architecture#supporting-assets
Please advise.
Thank you.
Okay, so literally 30 seconds later, my .css.liquid file is now being loaded just fine. Maybe it was a cache issue. I'm not sure. All good now!
That didn't work for me however I found that removing the .liquid extension allows it to work. Very confused as to why it won't accept style.css.liquid as a css file. I'm getting the error in the console: MIME type not supported. But I suppose I will just leave it as .css for now...
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024