Unless statement - settings font variable in Dawn theme

{%- unless settings.type_header_font.system? and settings.type_body_font.system? -%}
    
{%- endunless -%}

Can someone please describe what’s happening in this statement? I know it’s looking at a theme setting variable, but there are some things I don’t understand.

  1. No matter what I set the font to, system or Shopify font, the statement runs true.

  2. Is the question mark on the end turning the value into a boolean?

  3. What does system describe? It looks like an object key, but I can’t tell what it’s set to.

Thank you

Hi there, I believe that is referring to this:

If you aren’t using a system font for both of these, then it will add the prefetch link to the document in order to fetch the fonts faster. You’ll need to set both type_header_font and type_body_font to a system font if you don’t want this to resolve.

1 Like