Skip to main content

SpaceInsideBraces

Deprecated

This check only exists in Theme Check v1.X.X. We consider this to be the formatter's job.

Identifies inconsistent spacing inside Liquid tags and variables. Consistent spacing makes your code easier to search, read, and maintain.


The following examples contain code snippets that either fail or pass this check.

<!-- Around braces -->
{% assign x = 1%}
{{ x}}
{{x }}
<!-- After commas and semicolons -->
{% form 'type', object, key:value %}
{% endform %}
<!-- Around filter pipelines -->
{{ url | asset_url | image_tag }}
{% assign my_upcase_string = "Hello world"| upcase %}
<!-- Around symbol operators -->
{%- if target == product and product.price_varies -%}
{%- if product.featured_media.width >=165 -%}

{% assign x = 1 %}
{{ x }}
{% form 'type', object, key: value, key2: value %}
{% endform %}
{{ "ignore:stuff, indeed" }}
{% render 'product-card',
product_card_product: product_recommendation,
show_vendor: section.settings.show_vendor,
media_size: section.settings.product_recommendations_image_ratio,
center_align_text: section.settings.center_align_text
%}
{{ url | asset_url | image_tag }}
{% assign my_upcase_string = "Hello world" | upcase %}
{%- if target == product and product.price_varies -%}
{%- if product.featured_media.width >= 165 -%}

Theme Check can correct this error using the --auto-correct flag. When the flag is specified, Theme Check trims or add spaces around {{ ... }}.

{{ x}}
{{x}}
{{ x }}

{{ x }}

Anchor to Disabling this checkDisabling this check

This check is safe to disable.


Was this page helpful?