Solved

style.css.liquid not being applied

camicool09
Visitor
2 0 1

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:

Screen Shot 2021-11-12 at 10.48.47 AM.png

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:

Screen Shot 2021-11-12 at 10.52.46 AM.png

Accepted Solution (1)

Savior
Shopify Partner
537 108 161

This is an accepted solution.

@camicool09 

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.

banned

View solution in original post

Replies 5 (5)

Savior
Shopify Partner
537 108 161

This is an accepted solution.

@camicool09 

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.

banned
camicool09
Visitor
2 0 1

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.

jamestrenda
Visitor
2 0 0

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.

jamestrenda
Visitor
2 0 0

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!

raymondmsb
Shopify Partner
2 0 0

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...