Shopify / prettier-plugin-liquid

Prettier Liquid/HTML plugin
https://npm.im/@shopify/prettier-plugin-liquid
MIT License
93 stars 15 forks source link

Reformats CSS with Liquid in them improperly. #119

Closed charlespwd closed 1 year ago

charlespwd commented 1 year ago

Describe the bug Removes spaces where it should not.

Unformatted source

{%- style -%}
  @media screen and (max-width: 749px) {
    .collection-hero__inner {
      padding-bottom: calc({{ settings.media_shadow_vertical_offset | at_least: 0 }}px + 2rem);
    }
  }
{%- endstyle -%}

Expected output

{%- style -%}
  @media screen and (max-width: 749px) {
    .collection-hero__inner {
      padding-bottom: calc({{ settings.media_shadow_vertical_offset | at_least: 0 }}px + 2rem);
    }
  }
{%- endstyle -%}

Actual output

{%- style -%}
  @media screen and (max-width: 749px) {
    .collection-hero__inner {
      padding-bottom: calc({{settings.media_shadow_vertical_offset | at_least: 0}}px + 2rem);
    }
  }
{%- endstyle -%}

Additional context Add any other context about the problem here.

charlespwd commented 1 year ago

https://github.com/Shopify/dawn/pull/2126#discussion_r1030781423