Skip to content

Multi-line format of composes breaks parsing #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
viveleroi opened this issue Aug 16, 2023 · 2 comments · Fixed by #62
Closed

Multi-line format of composes breaks parsing #54

viveleroi opened this issue Aug 16, 2023 · 2 comments · Fixed by #62

Comments

@viveleroi
Copy link

As of prettier v3, they now split CSS declarations by commas so multiple entries in composes: declarations are included.

.title {
  composes:
    body-copy,
    text-ellipsis from global;
}
Internal server error: [postcss] postcss-modules-scope: C:/Users/.../app/components/tree/tree.module.css:132:3: referenced class name "body-copy," in composes not found
[vite]   Plugin: vite:css
[vite]   File: C:/Users/.../app/components/tree/tree.module.css:132:3
[vite]   130|
[vite]   131|  .title {
[vite]   132|    composes:
[vite]      |     ^
[vite]   133|      body-copy,
[vite]   134|      text-ellipsis from global;

But this code worked fine as a single line, so we use the /* prettier ignore */ comment for now.

.title {
  /* prettier-ignore */
  composes: body-copy, text-ellipsis from global;
}
@alexander-akait
Copy link
Member

Sorry, it never works like you wrote, you can't use , in right now, but it sounds useful, we need update such things in all plugins

@alexander-akait
Copy link
Member

Do you want to send a PRs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants