43081j / postcss-lit

PostCSS syntax for extracting CSS from template literals inside JS/TS files
84 stars 6 forks source link

Slashes incorrectly escaped in output? #51

Closed adrianbruntonsagecom closed 6 months ago

adrianbruntonsagecom commented 7 months ago

We've noticed that slashes in the CSS output are doubling in quantity. Therefore, this:

  static override styles = css`
  .block {
    content: "\\e90e";
  }
  `;

Is becoming this:

  static override styles = css`
.block {
    content: "\\\\e90e";
  }
  `;

I've made a reproduction of the problem here: https://github.com/adrianbruntonsagecom/postcss-lit-escaping-issue

To see it: Clone repo: git clone https://github.com/adrianbruntonsagecom/postcss-lit-escaping-issue.git

Install dependencies: npm i

Run postcss: npm start

You'll see output.ts is generated with twice the number of slashes in the content property than expected.

43081j commented 6 months ago

i suspect i've fixed this in #52 FYI

adrianbruntonsagecom commented 6 months ago

i suspect i've fixed this in #52 FYI

Looks like it does the job thanks :)