I’m am editing a Shopify site for a client and I came across this code in the css file.
.pass-foot a {
font-family: "Myriad Pro", "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
font-style: italic;
font-size: 16px;
font-weight: 600;
// It's this piece I'm talking about
**{% if settings.password_bg != "no_password_bg" %}
color: #fff;
{% endif %}**
}
I was wondering if anyone has seen anything like this and can explain to me what this if statement is.
3
Answers
Looks like
{% if %}
from Liquid template engine, probably this code is not in a CSS file and is raw on a view file.You have more information on the documentation here:
https://help.shopify.com/themes/liquid/basics
This is probably a server side notation that slipped into the client.
Since it’s Shopify – I would assume they use Django – a web development platform written in python:
https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#if
This statement is related to your theme settings.
Theme settings are options defined by theme dev in «schema_settings.json» file.
Eventually this statement shouldn’t work in a .css.liquid file which only supports and renders Liquid strings.
For example {{ mystring }} works.
But {% if some_condition %}do_sthg{% endif %} shouldn’t.
HTH