skip to Main Content

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


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

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search