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

css && selector is not working properly during build #18843

Open
7 tasks done
aeharding opened this issue Nov 30, 2024 · 1 comment
Open
7 tasks done

css && selector is not working properly during build #18843

aeharding opened this issue Nov 30, 2024 · 1 comment
Labels
bug: upstream Bug in a dependency of Vite has workaround p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@aeharding
Copy link

aeharding commented Nov 30, 2024

Describe the bug

When I write the following css module:

.hi {
  && {
    color: blue;
  }

  color: red;
}

I expect

._hi_ffrjt_1._hi_ffrjt_1{color:#00f}
._hi_ffrjt_1 {color:red;}

But I get:

._hi_ffrjt_1{color:red;color:#00f}

This is not the specificity I was expecting and is causing bugs for me, specifically when using CSS modules composes property. I think the minifier is trying to be smart(?) but it doesn't work with CSS modules

Reproduction

https://stackblitz.com/edit/vue3-vite-typescript-starter-klkv2k?file=src%2Fhi.module.css

Steps to reproduce

Run pnpm build and inspect output css

System Info

Stackblitz environment

Used Package Manager

npm

Logs

Please see stackblitz after running prod build.

Validations

@sapphi-red
Copy link
Member

This seems to be a bug in esbuild (evanw/esbuild#3997).

@sapphi-red sapphi-red added bug: upstream Bug in a dependency of Vite has workaround p2-edge-case Bug, but has workaround or limited in scope (priority) labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: upstream Bug in a dependency of Vite has workaround p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

No branches or pull requests

2 participants