-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Child combinator (>) in :has sometimes vanishes when transpiling nested css in scoped styles #11613
Comments
It seems a bug with export default defineConfig({
plugins: [vue()],
build:{
cssMinify: 'lightningcss',
}
}); |
Thanks for having a look and mentioning With
Disabling the css minification is not an option as then the css does not work for browsers without nested css support. I'll raise the bug with |
Closing as not related to vue |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.4.24
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-uflhun?file=vite.config.js,src%2FApp.vue&terminal=dev
Steps to reproduce
npm run dev
npm run build
andnpm run preview
Please note the defined target browser version in the vite.config.js
What is expected?
Only the first two spans are colored in every case. The transpiled css works the same as the original css.
What is actually happening?
All three spans are colored as the transpiled css looses the child combinator (>) used in
:deep(.foo:has(> span))
.System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm npmPackages: vue: ^3.4.37 => 3.4.37 pnpm: 8.15.6 - /usr/local/bin/pnpm System: OS: macOS 14.5 Browsers: Chrome: 127.0.6533.100
Any additional comments?
When using scoped styles and nested css the child combinator (>) is sometimes lost when transpiling the css for browsers without support for nested css.
is wrongly converted into
instead of the correct
As far as my testing has gone this only happens when
:deep(&)
is used in the nested part of the css.The text was updated successfully, but these errors were encountered: