Skip to content
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

Possibly incorrect css-syntax-error? #13914

Closed
7 tasks done
brc-dd opened this issue Jul 21, 2023 · 2 comments
Closed
7 tasks done

Possibly incorrect css-syntax-error? #13914

brc-dd opened this issue Jul 21, 2023 · 2 comments

Comments

@brc-dd
Copy link
Contributor

brc-dd commented Jul 21, 2023

Describe the bug

Prettier formats some code like this:

:is(.vp-external-link-icon, .vp-doc a[href*=':/\/'], .vp-doc a[target='_blank']):not(.no-icon) {
  color: red;
}

to

:is(
    .vp-external-link-icon,
    .vp-doc a[href*=":/\/"],
    .vp-doc a[target="_blank"]
  ):not(.no-icon) {
  color: red;
}

But vite complains with the latter syntax:

warnings when minifying css:
▲ [WARNING] Unexpected whitespace [css-syntax-error]

    <stdin>:2:4:
      2 │ :is(
        ╵     ^

If this is expected behavior, let me know. I'll create an issue at prettier.

PS: vite@v4.3.9 doesn't give that warning

Reproduction

https://stackblitz.com/edit/vitejs-vite-yqhx6w?file=style.css&terminal=dev

Steps to reproduce

Run vite build

System Info

vite/4.4.5 linux-x64 node-v16.20.0 (stackblitz)

Used Package Manager

npm

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented Jul 21, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@bluwy
Copy link
Member

bluwy commented Jul 21, 2023

I think the error is coming from esbuild. It recently started parsing :is()

@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants