Quantcast
Channel: Opinion: Shopify Community - Shopify Design
Viewing all articles
Browse latest Browse all 57838

Style sheet with .liquid extension does not load by Shawn Persels

$
0
0

I am just learning about how shopify works and I'm experimenting with various ways of loading style sheets.   I have a style sheet that I can "{% include..." within a <style> block in the header and it works just fine.   If I add the exact same style sheet code as an asset, "test.css", and use the {{ 'test.css' | asset_url | stylesheet_tag }} in my header it loads but none of the liquid statements in the style sheet get processed - I reference a couple of images for background etc.   If I use the EXACT same stylesheet code and create an asset called 'test.css.liquid', and reference it with

{{ 'test.css.liquid' | asset_url | stylesheet_tag }}

the stylesheet doesn't load at all.   If I look at the source generated I see a link tag generated by liquid - something like

<link href="//cdn.shopify.com/s/files/1/0335/4733/t/3/assets/test.css.liquid?424" rel="stylesheet" type="text/css" media="all" />

and if I follow the href link with the browser it does indeed bring up the stylesheet.

what might I be doing wrong?


Viewing all articles
Browse latest Browse all 57838

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>