Can i use liquid in css?

Shopify Expert
2 0 0

Hi I just wanted to know if I can use liquid in css . Example :
Screenshot 2019-01-29 at 10.51.58 AM.pngproduct-template.liquid

 

Screenshot 2019-01-29 at 10.51.50 AM.pngcustom.scss.liquid

Instead hardcode it in my custom.scss.liquid file. I want to use :
.usp_{{ shop.name }} {
background-color: ...

 

Is this possible?

0 Likes

Hello,

 

Hope following links will help you.

 

https://github.com/Shopify/slate/wiki/Styles-with-Liquid

https://www.shopify.in/partners/blog/topics/learning-liquid

 


Thanks & Regards

MS Web Designer Team
Official Shopify Expert and Partner
https://experts.shopify.com/ms-webservices

 

Official Shopify Experts & Partner - https://experts.shopify.com/ms-webservices

20000+ Task Completed
1000+ Satisfied Client
9.9*/10 Customer Rating
10*/10 Shopify Services Marketplace
E-mail: hello@mswebdesigner.com
Skype: shopify.mswebdesigner@gmail.com
0 Likes
Highlighted
Shopify Expert
2000 82 1452

Liquid CSS files do support Liquid (makes sense when you say it out loud) but you won't get the full suite of objects and functions.

This is a 5 second test, but can say that the shop object isn't available so you won't be able to pull that name property.

 

If it's super important to have the css pull the name you'll need to inline the CSS into a template file instead.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes